From 76e1cc99368d12543e3c09cf47ef223579f84449 Mon Sep 17 00:00:00 2001 From: sccdeveloper Date: Fri, 5 Aug 2022 10:18:16 +0000 Subject: [PATCH 1/5] Update version 2.0.1 -> 3.0.0 Signed-off-by: Pavan K Manda --- .bumpversion.cfg | 2 +- README.md | 10 +++++----- modules/common/pom.xml | 2 +- modules/configuration-governance/pom.xml | 2 +- modules/coverage-reports/pom.xml | 2 +- modules/examples/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 54851e89..b34fb7ef 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.1 +current_version = 3.0.0 commit = True message = Update version {current_version} -> {new_version} diff --git a/README.md b/README.md index 00f2720a..80de59b8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Maven Central](https://img.shields.io/maven-central/v/com.ibm.cloud/scc.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.ibm.cloud%22%20AND%20a:%22scc%22) -# IBM Cloud Security & Compliance Center Java SDK Version 2.0.1 +# IBM Cloud Security & Compliance Center Java SDK Version 3.0.0 Java client library to interact with various [IBM Cloud Security & Compliance Center](https://cloud.ibm.com/docs?tab=api-docs&category=platform_services%2Csecurity). Disclaimer: this SDK is being released initially as a **pre-release** version. @@ -46,7 +46,7 @@ The IBM Cloud Security & Compliance Center Java SDK allows developers to program Service Name | Imported Class Name --- | --- -[ConfigurationGovernanceApi](https://cloud.ibm.com/apidocs/security-compliance/config) | ConfigurationGovernanceApi:2.0.1 +[ConfigurationGovernanceApi](https://cloud.ibm.com/apidocs/security-compliance/config) | ConfigurationGovernanceApi:3.0.0 ## Prerequisites @@ -57,7 +57,7 @@ Service Name | Imported Class Name * Java 8 or above. ## Installation -The current version of this SDK is: 2.0.1 +The current version of this SDK is: 3.0.0 Each service's artifact coordinates are listed in the table above. @@ -76,13 +76,13 @@ Here are examples for maven and gradle: com.ibm.cloud configuration_governance - 2.0.1 + 3.0.0 ``` ### Gradle ```gradle -compile 'com.ibm.cloud:configuration_governance:2.0.1' +compile 'com.ibm.cloud:configuration_governance:3.0.0' ``` ## Using the SDK diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 56982976..48c9206b 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -7,7 +7,7 @@ scc com.ibm.cloud - 2.0.1 + 3.0.0 ../.. diff --git a/modules/configuration-governance/pom.xml b/modules/configuration-governance/pom.xml index a6842848..12be3a85 100644 --- a/modules/configuration-governance/pom.xml +++ b/modules/configuration-governance/pom.xml @@ -6,7 +6,7 @@ scc com.ibm.cloud - 2.0.1 + 3.0.0 ../.. diff --git a/modules/coverage-reports/pom.xml b/modules/coverage-reports/pom.xml index 0b2d1ad9..1ba67d0b 100644 --- a/modules/coverage-reports/pom.xml +++ b/modules/coverage-reports/pom.xml @@ -5,7 +5,7 @@ scc com.ibm.cloud - 2.0.1 + 3.0.0 ../.. 4.0.0 diff --git a/modules/examples/pom.xml b/modules/examples/pom.xml index ae2696e5..70dd034c 100644 --- a/modules/examples/pom.xml +++ b/modules/examples/pom.xml @@ -5,7 +5,7 @@ scc com.ibm.cloud - 2.0.1 + 3.0.0 ../.. diff --git a/pom.xml b/pom.xml index 512934a0..0a0faf0c 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ https://github.ibm.com/CloudEngineering/java-sdk-template com.ibm.cloud - 2.0.1 + 3.0.0 pom From 413851d680e0db79cd017dd678e564a8ca63fd59 Mon Sep 17 00:00:00 2001 From: sccdeveloper Date: Fri, 5 Aug 2022 10:18:16 +0000 Subject: [PATCH 2/5] chore(release): 3.0.0 release notes # [3.0.0](https://github.com/IBM/scc-java-sdk/compare/2.0.1...3.0.0) (2022-08-05) ### Bug Fixes * **FindingsAPI:** deprecated ([fe11482](https://github.com/IBM/scc-java-sdk/commit/fe11482670f9fbaf0b37db1039b7416cef1607c4)) * Merge pull request #51 from IBM/si-deprecation ([7458078](https://github.com/IBM/scc-java-sdk/commit/7458078e97f35a158e72ad72ce861c01719ab598)), closes [#51](https://github.com/IBM/scc-java-sdk/issues/51) ### BREAKING CHANGES * Deprecating Security Insights * **FindingsAPI:** deprecating Security Insights Signed-off-by: Pavan K Manda --- CHANGELOG.md | 16 +++ package-lock.json | 307 +++++++++++++++++++++++++++++----------------- package.json | 2 +- 3 files changed, 210 insertions(+), 115 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20547199..2d2b433c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +# [3.0.0](https://github.com/IBM/scc-java-sdk/compare/2.0.1...3.0.0) (2022-08-05) + + +### Bug Fixes + +* **FindingsAPI:** deprecated ([fe11482](https://github.com/IBM/scc-java-sdk/commit/fe11482670f9fbaf0b37db1039b7416cef1607c4)) + + +* Merge pull request #51 from IBM/si-deprecation ([7458078](https://github.com/IBM/scc-java-sdk/commit/7458078e97f35a158e72ad72ce861c01719ab598)), closes [#51](https://github.com/IBM/scc-java-sdk/issues/51) + + +### BREAKING CHANGES + +* Deprecating Security Insights +* **FindingsAPI:** deprecating Security Insights + ## [2.0.1](https://github.com/IBM/scc-java-sdk/compare/2.0.0...2.0.1) (2021-12-20) diff --git a/package-lock.json b/package-lock.json index 853fe307..f5e1b945 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "@semantic-release/changelog": "^6.0.1", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^8.0.2" + "@semantic-release/github": "^8.0.5" } }, "node_modules/@babel/code-frame": { @@ -76,61 +76,76 @@ } }, "node_modules/@octokit/auth-token": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", - "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.0.tgz", + "integrity": "sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==", "dependencies": { "@octokit/types": "^6.0.3" + }, + "engines": { + "node": ">= 14" } }, "node_modules/@octokit/core": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", - "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", - "dependencies": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.0", - "@octokit/request-error": "^2.0.5", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.4.tgz", + "integrity": "sha512-sUpR/hc4Gc7K34o60bWC7WUH6Q7T6ftZ2dUmepSyJr9PRF76/qqkWjE2SOEzCqLA5W83SaISymwKtxks+96hPQ==", + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", "@octokit/types": "^6.0.3", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" } }, "node_modules/@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.0.tgz", + "integrity": "sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==", "dependencies": { "@octokit/types": "^6.0.3", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" } }, "node_modules/@octokit/graphql": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.6.4.tgz", - "integrity": "sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.0.tgz", + "integrity": "sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==", "dependencies": { - "@octokit/request": "^5.6.0", + "@octokit/request": "^6.0.0", "@octokit/types": "^6.0.3", "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" } }, "node_modules/@octokit/openapi-types": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-8.1.3.tgz", - "integrity": "sha512-iK7SfjjkGdIiopuKEMAzPxSagZtIzWjwfYFBFxLKIS4Q4S8rSLQk7EnlTok2/bNAz1BvxnGKPKe+auSiCIU5QQ==" + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", + "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" }, "node_modules/@octokit/plugin-paginate-rest": { - "version": "2.13.6", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.6.tgz", - "integrity": "sha512-ai7TNKLi8tGkDvLM7fm0X1fbIP9u1nfXnN49ZAw2PgSoQou9yixKn5c3m0awuLacbuX2aXEvJpv1gKm3jboabg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.1.0.tgz", + "integrity": "sha512-+cfc40pMzWcLkoDcLb1KXqjX0jTGYXjKuQdFQDc6UAknISJHnZTiBqld6HDwRJvD4DsouDKrWXNbNV0lE/3AXA==", "dependencies": { - "@octokit/types": "^6.17.3" + "@octokit/types": "^6.41.0" + }, + "engines": { + "node": ">= 14" }, "peerDependencies": { - "@octokit/core": ">=2" + "@octokit/core": ">=4" } }, "node_modules/@octokit/plugin-request-log": { @@ -142,57 +157,69 @@ } }, "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.5.tgz", - "integrity": "sha512-QL3vIDYbANwxfrWOFlgn0rkp1ojlZKccsTb0+9x9keG8XGIq4ZJhxgpyJASYIui1QqCV8JIfDiEqX2dzr7x8KA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.2.0.tgz", + "integrity": "sha512-PZ+yfkbZAuRUtqu6Y191/V3eM0KBPx+Yq7nh+ONPdpm3EX4pd5UnK2y2XgO/0AtNum5a4aJCDjqsDuUZ2hWRXw==", "dependencies": { - "@octokit/types": "^6.17.1", + "@octokit/types": "^6.41.0", "deprecation": "^2.3.1" }, + "engines": { + "node": ">= 14" + }, "peerDependencies": { "@octokit/core": ">=3" } }, "node_modules/@octokit/request": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.0.tgz", - "integrity": "sha512-4cPp/N+NqmaGQwbh3vUsYqokQIzt7VjsgTYVXiwpUP2pxd5YiZB2XuTedbb0SPtv9XS7nzAKjAuQxmY8/aZkiA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.0.tgz", + "integrity": "sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==", "dependencies": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", "@octokit/types": "^6.16.1", "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.1", + "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" } }, "node_modules/@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.0.tgz", + "integrity": "sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==", "dependencies": { "@octokit/types": "^6.0.3", "deprecation": "^2.0.0", "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" } }, "node_modules/@octokit/rest": { - "version": "18.6.4", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.6.4.tgz", - "integrity": "sha512-1q1H1rJIjOjGd9/qIWaQgLaxtWcQ5H0tdh1D7JHqdsxopGciIUfU15GOZQf5lhW1YeQnlILHFynhKaZpXDiwuA==", + "version": "19.0.3", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.3.tgz", + "integrity": "sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ==", "dependencies": { - "@octokit/core": "^3.5.0", - "@octokit/plugin-paginate-rest": "^2.6.2", - "@octokit/plugin-request-log": "^1.0.2", - "@octokit/plugin-rest-endpoint-methods": "5.3.5" + "@octokit/core": "^4.0.0", + "@octokit/plugin-paginate-rest": "^3.0.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^6.0.0" + }, + "engines": { + "node": ">= 14" } }, "node_modules/@octokit/types": { - "version": "6.17.3", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.17.3.tgz", - "integrity": "sha512-l3JiWbtK95CTsHTuF8WpE0Raq9efWUUU88CiWiCxRgTsauUkIRmVYZoDZTwAHn1xAnPz0aezQynIo6igS9EqQA==", + "version": "6.41.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", + "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", "dependencies": { - "@octokit/openapi-types": "^8.1.3" + "@octokit/openapi-types": "^12.11.0" } }, "node_modules/@semantic-release/changelog": { @@ -385,11 +412,11 @@ } }, "node_modules/@semantic-release/github": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.2.tgz", - "integrity": "sha512-wIbfhOeuxlYzMTjtSAa2xgr54n7ZuPAS2gadyTWBpUt2PNAPgla7A6XxCXJnaKPgfVF0iFfSk3B+KlVKk6ByVg==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.5.tgz", + "integrity": "sha512-9pGxRM3gv1hgoZ/muyd4pWnykdIUVfCiev6MXE9lOyGQof4FQy95GFE26nDcifs9ZG7bBzV8ue87bo/y1zVf0g==", "dependencies": { - "@octokit/rest": "^18.0.0", + "@octokit/rest": "^19.0.0", "@semantic-release/error": "^2.2.0", "aggregate-error": "^3.0.0", "bottleneck": "^2.18.1", @@ -2203,11 +2230,22 @@ } }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/normalize-package-data": { @@ -6238,6 +6276,11 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/traverse": { "version": "0.6.6", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", @@ -6324,6 +6367,20 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6508,31 +6565,31 @@ } }, "@octokit/auth-token": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", - "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.0.tgz", + "integrity": "sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==", "requires": { "@octokit/types": "^6.0.3" } }, "@octokit/core": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", - "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", - "requires": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.0", - "@octokit/request-error": "^2.0.5", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.4.tgz", + "integrity": "sha512-sUpR/hc4Gc7K34o60bWC7WUH6Q7T6ftZ2dUmepSyJr9PRF76/qqkWjE2SOEzCqLA5W83SaISymwKtxks+96hPQ==", + "requires": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", "@octokit/types": "^6.0.3", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" } }, "@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.0.tgz", + "integrity": "sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==", "requires": { "@octokit/types": "^6.0.3", "is-plain-object": "^5.0.0", @@ -6540,26 +6597,26 @@ } }, "@octokit/graphql": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.6.4.tgz", - "integrity": "sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.0.tgz", + "integrity": "sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==", "requires": { - "@octokit/request": "^5.6.0", + "@octokit/request": "^6.0.0", "@octokit/types": "^6.0.3", "universal-user-agent": "^6.0.0" } }, "@octokit/openapi-types": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-8.1.3.tgz", - "integrity": "sha512-iK7SfjjkGdIiopuKEMAzPxSagZtIzWjwfYFBFxLKIS4Q4S8rSLQk7EnlTok2/bNAz1BvxnGKPKe+auSiCIU5QQ==" + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", + "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" }, "@octokit/plugin-paginate-rest": { - "version": "2.13.6", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.6.tgz", - "integrity": "sha512-ai7TNKLi8tGkDvLM7fm0X1fbIP9u1nfXnN49ZAw2PgSoQou9yixKn5c3m0awuLacbuX2aXEvJpv1gKm3jboabg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.1.0.tgz", + "integrity": "sha512-+cfc40pMzWcLkoDcLb1KXqjX0jTGYXjKuQdFQDc6UAknISJHnZTiBqld6HDwRJvD4DsouDKrWXNbNV0lE/3AXA==", "requires": { - "@octokit/types": "^6.17.3" + "@octokit/types": "^6.41.0" } }, "@octokit/plugin-request-log": { @@ -6569,31 +6626,31 @@ "requires": {} }, "@octokit/plugin-rest-endpoint-methods": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.5.tgz", - "integrity": "sha512-QL3vIDYbANwxfrWOFlgn0rkp1ojlZKccsTb0+9x9keG8XGIq4ZJhxgpyJASYIui1QqCV8JIfDiEqX2dzr7x8KA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.2.0.tgz", + "integrity": "sha512-PZ+yfkbZAuRUtqu6Y191/V3eM0KBPx+Yq7nh+ONPdpm3EX4pd5UnK2y2XgO/0AtNum5a4aJCDjqsDuUZ2hWRXw==", "requires": { - "@octokit/types": "^6.17.1", + "@octokit/types": "^6.41.0", "deprecation": "^2.3.1" } }, "@octokit/request": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.0.tgz", - "integrity": "sha512-4cPp/N+NqmaGQwbh3vUsYqokQIzt7VjsgTYVXiwpUP2pxd5YiZB2XuTedbb0SPtv9XS7nzAKjAuQxmY8/aZkiA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.0.tgz", + "integrity": "sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==", "requires": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", "@octokit/types": "^6.16.1", "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.1", + "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" } }, "@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.0.tgz", + "integrity": "sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==", "requires": { "@octokit/types": "^6.0.3", "deprecation": "^2.0.0", @@ -6601,22 +6658,22 @@ } }, "@octokit/rest": { - "version": "18.6.4", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.6.4.tgz", - "integrity": "sha512-1q1H1rJIjOjGd9/qIWaQgLaxtWcQ5H0tdh1D7JHqdsxopGciIUfU15GOZQf5lhW1YeQnlILHFynhKaZpXDiwuA==", + "version": "19.0.3", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.3.tgz", + "integrity": "sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ==", "requires": { - "@octokit/core": "^3.5.0", - "@octokit/plugin-paginate-rest": "^2.6.2", - "@octokit/plugin-request-log": "^1.0.2", - "@octokit/plugin-rest-endpoint-methods": "5.3.5" + "@octokit/core": "^4.0.0", + "@octokit/plugin-paginate-rest": "^3.0.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^6.0.0" } }, "@octokit/types": { - "version": "6.17.3", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.17.3.tgz", - "integrity": "sha512-l3JiWbtK95CTsHTuF8WpE0Raq9efWUUU88CiWiCxRgTsauUkIRmVYZoDZTwAHn1xAnPz0aezQynIo6igS9EqQA==", + "version": "6.41.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", + "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", "requires": { - "@octokit/openapi-types": "^8.1.3" + "@octokit/openapi-types": "^12.11.0" } }, "@semantic-release/changelog": { @@ -6752,11 +6809,11 @@ } }, "@semantic-release/github": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.2.tgz", - "integrity": "sha512-wIbfhOeuxlYzMTjtSAa2xgr54n7ZuPAS2gadyTWBpUt2PNAPgla7A6XxCXJnaKPgfVF0iFfSk3B+KlVKk6ByVg==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.5.tgz", + "integrity": "sha512-9pGxRM3gv1hgoZ/muyd4pWnykdIUVfCiev6MXE9lOyGQof4FQy95GFE26nDcifs9ZG7bBzV8ue87bo/y1zVf0g==", "requires": { - "@octokit/rest": "^18.0.0", + "@octokit/rest": "^19.0.0", "@semantic-release/error": "^2.2.0", "aggregate-error": "^3.0.0", "bottleneck": "^2.18.1", @@ -8142,9 +8199,12 @@ } }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } }, "normalize-package-data": { "version": "3.0.3", @@ -11065,6 +11125,11 @@ "is-number": "^7.0.0" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "traverse": { "version": "0.6.6", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", @@ -11130,6 +11195,20 @@ "spdx-expression-parse": "^3.0.0" } }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index c40eaebd..6ef9f5b0 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,6 @@ "@semantic-release/changelog": "^6.0.1", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^8.0.2" + "@semantic-release/github": "^8.0.5" } } From 392476e6742ba66cf0cdf4f487149c46f6d310dc Mon Sep 17 00:00:00 2001 From: Pavan K Manda Date: Tue, 29 Aug 2023 09:33:48 +0530 Subject: [PATCH 3/5] fix: commit_1: remove the preexisiting code Signed-off-by: Pavan K Manda --- modules/configuration-governance/pom.xml | 64 -- .../v1/ConfigurationGovernance.java | 425 ---------- .../model/CreateRuleAttachmentsOptions.java | 175 ---- .../model/CreateRuleAttachmentsResponse.java | 35 - .../v1/model/CreateRuleRequest.java | 130 --- .../v1/model/CreateRuleResponse.java | 100 --- .../v1/model/CreateRulesOptions.java | 147 ---- .../v1/model/CreateRulesResponse.java | 37 - .../v1/model/DeleteRuleAttachmentOptions.java | 157 ---- .../v1/model/DeleteRuleOptions.java | 127 --- .../v1/model/EnforcementAction.java | 108 --- .../v1/model/GetRuleAttachmentOptions.java | 157 ---- .../v1/model/GetRuleOptions.java | 127 --- .../v1/model/Link.java | 35 - .../v1/model/ListRuleAttachmentsOptions.java | 187 ----- .../v1/model/ListRulesOptions.java | 265 ------ .../v1/model/Rule.java | 214 ----- .../v1/model/RuleAttachment.java | 91 -- .../v1/model/RuleAttachmentList.java | 97 --- .../v1/model/RuleAttachmentRequest.java | 176 ---- .../v1/model/RuleCondition.java | 146 ---- .../v1/model/RuleConditionAndLvl2.java | 116 --- .../v1/model/RuleConditionOrLvl2.java | 116 --- .../v1/model/RuleConditionSingleProperty.java | 171 ---- .../v1/model/RuleList.java | 99 --- .../v1/model/RuleRequest.java | 345 -------- .../v1/model/RuleRequiredConfig.java | 145 ---- .../RuleRequiredConfigMultipleProperties.java | 31 - ...dConfigMultiplePropertiesConditionAnd.java | 116 --- ...edConfigMultiplePropertiesConditionOr.java | 116 --- .../RuleRequiredConfigSingleProperty.java | 171 ---- .../v1/model/RuleResponseError.java | 47 -- .../v1/model/RuleScope.java | 171 ---- .../v1/model/RuleSingleProperty.java | 226 ----- .../v1/model/TargetResource.java | 177 ---- ...esourceAdditionalTargetAttributesItem.java | 204 ----- .../v1/model/TemplateAttachment.java | 89 -- .../v1/model/TemplateScope.java | 79 -- .../v1/model/UpdateRuleAttachmentOptions.java | 297 ------- .../v1/model/UpdateRuleOptions.java | 435 ---------- .../v1/package-info.java | 16 - .../v1/ConfigurationGovernanceIT.java | 496 ----------- .../v1/ConfigurationGovernanceTest.java | 781 ------------------ .../CreateRuleAttachmentsOptionsTest.java | 71 -- .../CreateRuleAttachmentsResponseTest.java | 41 - .../v1/model/CreateRuleRequestTest.java | 114 --- .../v1/model/CreateRuleResponseTest.java | 49 -- .../v1/model/CreateRulesOptionsTest.java | 115 --- .../v1/model/CreateRulesResponseTest.java | 46 -- .../DeleteRuleAttachmentOptionsTest.java | 49 -- .../v1/model/DeleteRuleOptionsTest.java | 47 -- .../v1/model/EnforcementActionTest.java | 51 -- .../model/GetRuleAttachmentOptionsTest.java | 49 -- .../v1/model/GetRuleOptionsTest.java | 47 -- .../v1/model/LinkTest.java | 37 - .../model/ListRuleAttachmentsOptionsTest.java | 51 -- .../v1/model/ListRulesOptionsTest.java | 57 -- .../v1/model/RuleAttachmentListTest.java | 47 -- .../v1/model/RuleAttachmentRequestTest.java | 68 -- .../v1/model/RuleAttachmentTest.java | 42 - .../v1/model/RuleConditionAndLvl2Test.java | 67 -- .../v1/model/RuleConditionOrLvl2Test.java | 67 -- .../RuleConditionSinglePropertyTest.java | 60 -- .../v1/model/RuleConditionTest.java | 40 - .../v1/model/RuleListTest.java | 50 -- .../v1/model/RuleRequestTest.java | 110 --- ...figMultiplePropertiesConditionAndTest.java | 67 -- ...nfigMultiplePropertiesConditionOrTest.java | 67 -- ...eRequiredConfigMultiplePropertiesTest.java | 41 - .../RuleRequiredConfigSinglePropertyTest.java | 60 -- .../v1/model/RuleRequiredConfigTest.java | 40 - .../v1/model/RuleResponseErrorTest.java | 38 - .../v1/model/RuleScopeTest.java | 57 -- .../v1/model/RuleSinglePropertyTest.java | 60 -- .../v1/model/RuleTest.java | 50 -- ...rceAdditionalTargetAttributesItemTest.java | 57 -- .../v1/model/TargetResourceTest.java | 68 -- .../v1/model/TemplateAttachmentTest.java | 42 - .../v1/model/TemplateScopeTest.java | 39 - .../UpdateRuleAttachmentOptionsTest.java | 69 -- .../v1/model/UpdateRuleOptionsTest.java | 105 --- .../v1/utils/TestUtilities.java | 129 --- modules/examples/pom.xml | 59 -- .../v1/ConfigurationGovernanceExamples.java | 328 -------- service-pom.xml | 67 -- 85 files changed, 10262 deletions(-) delete mode 100644 modules/configuration-governance/pom.xml delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernance.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponse.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequest.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponse.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponse.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementAction.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Link.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Rule.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachment.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentList.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequest.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleCondition.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSingleProperty.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleList.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequest.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfig.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultipleProperties.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAnd.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOr.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSingleProperty.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseError.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScope.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSingleProperty.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResource.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItem.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachment.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScope.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptions.java delete mode 100644 modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/package-info.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceIT.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponseTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequestTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponseTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponseTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementActionTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/LinkTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentListTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequestTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2Test.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2Test.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSinglePropertyTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleListTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequestTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAndTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOrTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSinglePropertyTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseErrorTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScopeTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSinglePropertyTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItemTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachmentTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScopeTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptionsTest.java delete mode 100644 modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/utils/TestUtilities.java delete mode 100644 modules/examples/pom.xml delete mode 100644 modules/examples/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceExamples.java delete mode 100644 service-pom.xml diff --git a/modules/configuration-governance/pom.xml b/modules/configuration-governance/pom.xml deleted file mode 100644 index 12be3a85..00000000 --- a/modules/configuration-governance/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - 4.0.0 - - - scc - com.ibm.cloud - 3.0.0 - ../.. - - - configuration_governance - jar - IBM Cloud Security & Compliance Center Configuration Governance API - - - - com.ibm.cloud - sdk-core - - - ${project.groupId} - common - ${project.version} - - - ${project.groupId} - common - test-jar - tests - test - ${project.version} - - - org.testng - testng - test - - - com.squareup.okhttp3 - mockwebserver - test - - - org.powermock - powermock-api-mockito2 - test - - - org.powermock - powermock-module-testng - test - - - - - - IBM Cloud DevX SDK Development - devxsdk@us.ibm.com - https://www.ibm.com/ - - - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernance.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernance.java deleted file mode 100644 index f4888cb8..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernance.java +++ /dev/null @@ -1,425 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -/* - * IBM OpenAPI SDK Code Generator Version: 3.32.0-4c6a3129-20210514-210323 - */ - -package com.ibm.cloud.scc.configuration_governance.v1; - -import com.google.gson.JsonObject; -import com.ibm.cloud.scc.common.SdkCommon; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleList; -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleOptions; -import com.ibm.cloud.sdk.core.http.RequestBuilder; -import com.ibm.cloud.sdk.core.http.ResponseConverter; -import com.ibm.cloud.sdk.core.http.ServiceCall; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.ConfigBasedAuthenticatorFactory; -import com.ibm.cloud.sdk.core.service.BaseService; -import com.ibm.cloud.sdk.core.util.ResponseConverterUtils; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -/** - * API specification for the Configuration Governance service. - * - * @version v1 - */ -public class ConfigurationGovernance extends BaseService { - - public static final String DEFAULT_SERVICE_NAME = "configuration_governance"; - - public static final String DEFAULT_SERVICE_URL = "https://us.compliance.cloud.ibm.com"; - - /** - * Class method which constructs an instance of the `ConfigurationGovernance` client. - * The default service name is used to configure the client instance. - * - * @return an instance of the `ConfigurationGovernance` client using external configuration - */ - public static ConfigurationGovernance newInstance() { - return newInstance(DEFAULT_SERVICE_NAME); - } - - /** - * Class method which constructs an instance of the `ConfigurationGovernance` client. - * The specified service name is used to configure the client instance. - * - * @param serviceName the service name to be used when configuring the client instance - * @return an instance of the `ConfigurationGovernance` client using external configuration - */ - public static ConfigurationGovernance newInstance(String serviceName) { - Authenticator authenticator = ConfigBasedAuthenticatorFactory.getAuthenticator(serviceName); - ConfigurationGovernance service = new ConfigurationGovernance(serviceName, authenticator); - service.configureService(serviceName); - return service; - } - - /** - * Constructs an instance of the `ConfigurationGovernance` client. - * The specified service name and authenticator are used to configure the client instance. - * - * @param serviceName the service name to be used when configuring the client instance - * @param authenticator the {@link Authenticator} instance to be configured for this client - */ - public ConfigurationGovernance(String serviceName, Authenticator authenticator) { - super(serviceName, authenticator); - setServiceUrl(DEFAULT_SERVICE_URL); - } - - /** - * Create rules. - * - * Creates one or more rules that you can use to govern the way that IBM Cloud resources can be provisioned and - * configured. - * - * A successful `POST /config/rules` request defines a rule based on the target, conditions, and enforcement actions - * that you specify. The response returns the ID value for your rule, along with other metadata. - * - * To learn more about rules, check out the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule). - * - * @param createRulesOptions the {@link CreateRulesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link CreateRulesResponse} - */ - public ServiceCall createRules(CreateRulesOptions createRulesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createRulesOptions, - "createRulesOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules")); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "createRules"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (createRulesOptions.transactionId() != null) { - builder.header("Transaction-Id", createRulesOptions.transactionId()); - } - final JsonObject contentJson = new JsonObject(); - contentJson.add("rules", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRulesOptions.rules())); - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List rules. - * - * Retrieves a list of the rules that are available in your account. - * - * @param listRulesOptions the {@link ListRulesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RuleList} - */ - public ServiceCall listRules(ListRulesOptions listRulesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listRulesOptions, - "listRulesOptions cannot be null"); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules")); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "listRules"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (listRulesOptions.transactionId() != null) { - builder.header("Transaction-Id", listRulesOptions.transactionId()); - } - builder.query("account_id", String.valueOf(listRulesOptions.accountId())); - if (listRulesOptions.attached() != null) { - builder.query("attached", String.valueOf(listRulesOptions.attached())); - } - if (listRulesOptions.labels() != null) { - builder.query("labels", String.valueOf(listRulesOptions.labels())); - } - if (listRulesOptions.scopes() != null) { - builder.query("scopes", String.valueOf(listRulesOptions.scopes())); - } - if (listRulesOptions.limit() != null) { - builder.query("limit", String.valueOf(listRulesOptions.limit())); - } - if (listRulesOptions.offset() != null) { - builder.query("offset", String.valueOf(listRulesOptions.offset())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get a rule. - * - * Retrieves an existing rule and its details. - * - * @param getRuleOptions the {@link GetRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Rule} - */ - public ServiceCall getRule(GetRuleOptions getRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getRuleOptions, - "getRuleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", getRuleOptions.ruleId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "getRule"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (getRuleOptions.transactionId() != null) { - builder.header("Transaction-Id", getRuleOptions.transactionId()); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update a rule. - * - * Updates an existing rule based on the properties that you specify. - * - * @param updateRuleOptions the {@link UpdateRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Rule} - */ - public ServiceCall updateRule(UpdateRuleOptions updateRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateRuleOptions, - "updateRuleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", updateRuleOptions.ruleId()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "updateRule"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.header("If-Match", updateRuleOptions.ifMatch()); - if (updateRuleOptions.transactionId() != null) { - builder.header("Transaction-Id", updateRuleOptions.transactionId()); - } - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("name", updateRuleOptions.name()); - contentJson.addProperty("description", updateRuleOptions.description()); - contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateRuleOptions.target())); - contentJson.add("required_config", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateRuleOptions.requiredConfig())); - contentJson.add("enforcement_actions", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateRuleOptions.enforcementActions())); - if (updateRuleOptions.accountId() != null) { - contentJson.addProperty("account_id", updateRuleOptions.accountId()); - } - if (updateRuleOptions.ruleType() != null) { - contentJson.addProperty("rule_type", updateRuleOptions.ruleType()); - } - if (updateRuleOptions.labels() != null) { - contentJson.add("labels", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateRuleOptions.labels())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a rule. - * - * Deletes an existing rule. - * - * @param deleteRuleOptions the {@link DeleteRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteRule(DeleteRuleOptions deleteRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteRuleOptions, - "deleteRuleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", deleteRuleOptions.ruleId()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "deleteRule"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - if (deleteRuleOptions.transactionId() != null) { - builder.header("Transaction-Id", deleteRuleOptions.transactionId()); - } - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create attachments. - * - * Creates one or more scope attachments for an existing rule. - * - * You can attach an existing rule to a scope, such as a specific IBM Cloud account, to start evaluating the rule for - * compliance. A successful - * `POST /config/v1/rules/{rule_id}/attachments` returns the ID value for the attachment, along with other metadata. - * - * @param createRuleAttachmentsOptions the {@link CreateRuleAttachmentsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link CreateRuleAttachmentsResponse} - */ - public ServiceCall createRuleAttachments(CreateRuleAttachmentsOptions createRuleAttachmentsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createRuleAttachmentsOptions, - "createRuleAttachmentsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", createRuleAttachmentsOptions.ruleId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}/attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "createRuleAttachments"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (createRuleAttachmentsOptions.transactionId() != null) { - builder.header("Transaction-Id", createRuleAttachmentsOptions.transactionId()); - } - final JsonObject contentJson = new JsonObject(); - contentJson.add("attachments", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRuleAttachmentsOptions.attachments())); - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List attachments. - * - * Retrieves a list of scope attachments that are associated with the specified rule. - * - * @param listRuleAttachmentsOptions the {@link ListRuleAttachmentsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RuleAttachmentList} - */ - public ServiceCall listRuleAttachments(ListRuleAttachmentsOptions listRuleAttachmentsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listRuleAttachmentsOptions, - "listRuleAttachmentsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", listRuleAttachmentsOptions.ruleId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}/attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "listRuleAttachments"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (listRuleAttachmentsOptions.transactionId() != null) { - builder.header("Transaction-Id", listRuleAttachmentsOptions.transactionId()); - } - if (listRuleAttachmentsOptions.limit() != null) { - builder.query("limit", String.valueOf(listRuleAttachmentsOptions.limit())); - } - if (listRuleAttachmentsOptions.offset() != null) { - builder.query("offset", String.valueOf(listRuleAttachmentsOptions.offset())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get an attachment. - * - * Retrieves an existing scope attachment for a rule. - * - * @param getRuleAttachmentOptions the {@link GetRuleAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RuleAttachment} - */ - public ServiceCall getRuleAttachment(GetRuleAttachmentOptions getRuleAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getRuleAttachmentOptions, - "getRuleAttachmentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", getRuleAttachmentOptions.ruleId()); - pathParamsMap.put("attachment_id", getRuleAttachmentOptions.attachmentId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}/attachments/{attachment_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "getRuleAttachment"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (getRuleAttachmentOptions.transactionId() != null) { - builder.header("Transaction-Id", getRuleAttachmentOptions.transactionId()); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update an attachment. - * - * Updates an existing scope attachment based on the properties that you specify. - * - * @param updateRuleAttachmentOptions the {@link UpdateRuleAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link TemplateAttachment} - */ - public ServiceCall updateRuleAttachment(UpdateRuleAttachmentOptions updateRuleAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateRuleAttachmentOptions, - "updateRuleAttachmentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", updateRuleAttachmentOptions.ruleId()); - pathParamsMap.put("attachment_id", updateRuleAttachmentOptions.attachmentId()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}/attachments/{attachment_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "updateRuleAttachment"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.header("If-Match", updateRuleAttachmentOptions.ifMatch()); - if (updateRuleAttachmentOptions.transactionId() != null) { - builder.header("Transaction-Id", updateRuleAttachmentOptions.transactionId()); - } - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("account_id", updateRuleAttachmentOptions.accountId()); - contentJson.add("included_scope", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateRuleAttachmentOptions.includedScope())); - if (updateRuleAttachmentOptions.excludedScopes() != null) { - contentJson.add("excluded_scopes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateRuleAttachmentOptions.excludedScopes())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete an attachment. - * - * Deletes an existing scope attachment. - * - * @param deleteRuleAttachmentOptions the {@link DeleteRuleAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteRuleAttachment(DeleteRuleAttachmentOptions deleteRuleAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteRuleAttachmentOptions, - "deleteRuleAttachmentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("rule_id", deleteRuleAttachmentOptions.ruleId()); - pathParamsMap.put("attachment_id", deleteRuleAttachmentOptions.attachmentId()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/config/v1/rules/{rule_id}/attachments/{attachment_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("configuration_governance", "v1", "deleteRuleAttachment"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - if (deleteRuleAttachmentOptions.transactionId() != null) { - builder.header("Transaction-Id", deleteRuleAttachmentOptions.transactionId()); - } - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - -} diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptions.java deleted file mode 100644 index bd964030..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptions.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The createRuleAttachments options. - */ -public class CreateRuleAttachmentsOptions extends GenericModel { - - protected String ruleId; - protected List attachments; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private List attachments; - private String transactionId; - - private Builder(CreateRuleAttachmentsOptions createRuleAttachmentsOptions) { - this.ruleId = createRuleAttachmentsOptions.ruleId; - this.attachments = createRuleAttachmentsOptions.attachments; - this.transactionId = createRuleAttachmentsOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - * @param attachments the attachments - */ - public Builder(String ruleId, List attachments) { - this.ruleId = ruleId; - this.attachments = attachments; - } - - /** - * Builds a CreateRuleAttachmentsOptions. - * - * @return the new CreateRuleAttachmentsOptions instance - */ - public CreateRuleAttachmentsOptions build() { - return new CreateRuleAttachmentsOptions(this); - } - - /** - * Adds an attachment to attachments. - * - * @param attachment the new attachment - * @return the CreateRuleAttachmentsOptions builder - */ - public Builder addAttachment(RuleAttachmentRequest attachment) { - com.ibm.cloud.sdk.core.util.Validator.notNull(attachment, - "attachment cannot be null"); - if (this.attachments == null) { - this.attachments = new ArrayList(); - } - this.attachments.add(attachment); - return this; - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the CreateRuleAttachmentsOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the attachments. - * Existing attachments will be replaced. - * - * @param attachments the attachments - * @return the CreateRuleAttachmentsOptions builder - */ - public Builder attachments(List attachments) { - this.attachments = attachments; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the CreateRuleAttachmentsOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected CreateRuleAttachmentsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attachments, - "attachments cannot be null"); - ruleId = builder.ruleId; - attachments = builder.attachments; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a CreateRuleAttachmentsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the attachments. - * - * @return the attachments - */ - public List attachments() { - return attachments; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponse.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponse.java deleted file mode 100644 index db9748d0..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponse.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * CreateRuleAttachmentsResponse. - */ -public class CreateRuleAttachmentsResponse extends GenericModel { - - protected List attachments; - - /** - * Gets the attachments. - * - * @return the attachments - */ - public List getAttachments() { - return attachments; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequest.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequest.java deleted file mode 100644 index 9475f1ae..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * A rule to be created. - */ -public class CreateRuleRequest extends GenericModel { - - @SerializedName("request_id") - protected String requestId; - protected RuleRequest rule; - - /** - * Builder. - */ - public static class Builder { - private String requestId; - private RuleRequest rule; - - private Builder(CreateRuleRequest createRuleRequest) { - this.requestId = createRuleRequest.requestId; - this.rule = createRuleRequest.rule; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param rule the rule - */ - public Builder(RuleRequest rule) { - this.rule = rule; - } - - /** - * Builds a CreateRuleRequest. - * - * @return the new CreateRuleRequest instance - */ - public CreateRuleRequest build() { - return new CreateRuleRequest(this); - } - - /** - * Set the requestId. - * - * @param requestId the requestId - * @return the CreateRuleRequest builder - */ - public Builder requestId(String requestId) { - this.requestId = requestId; - return this; - } - - /** - * Set the rule. - * - * @param rule the rule - * @return the CreateRuleRequest builder - */ - public Builder rule(RuleRequest rule) { - this.rule = rule; - return this; - } - } - - protected CreateRuleRequest(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.rule, - "rule cannot be null"); - requestId = builder.requestId; - rule = builder.rule; - } - - /** - * New builder. - * - * @return a CreateRuleRequest builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the requestId. - * - * A field that you can use in bulk operations to store a custom identifier for an individual request. If you omit - * this field, the service generates and sends a `request_id` string for each new rule. The generated string - * corresponds with the numerical order of the rules request array. For example, `"request_id": "1"`, `"request_id": - * "2"`. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `request_id` with - * each request. - * - * @return the requestId - */ - public String requestId() { - return requestId; - } - - /** - * Gets the rule. - * - * Properties that you can associate with a rule. - * - * @return the rule - */ - public RuleRequest rule() { - return rule; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponse.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponse.java deleted file mode 100644 index 4d18b0d1..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponse.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * Response information for a rule request. - * - * If the 'status_code' property indicates success, the 'request_id' and 'rule' properties are returned in the response. - * If the 'status_code' property indicates an error, the 'request_id', 'errors', and 'trace' fields are returned. - */ -public class CreateRuleResponse extends GenericModel { - - @SerializedName("request_id") - protected String requestId; - @SerializedName("status_code") - protected Long statusCode; - protected Rule rule; - protected List errors; - protected String trace; - - /** - * Gets the requestId. - * - * The identifier that is used to correlate an individual request. - * - * To assist with debugging, you can use this ID to identify and inspect only one request that was made as part of a - * bulk operation. - * - * @return the requestId - */ - public String getRequestId() { - return requestId; - } - - /** - * Gets the statusCode. - * - * The HTTP response status code. - * - * @return the statusCode - */ - public Long getStatusCode() { - return statusCode; - } - - /** - * Gets the rule. - * - * Information about a newly-created rule. - * - * This field is present for successful requests. - * - * @return the rule - */ - public Rule getRule() { - return rule; - } - - /** - * Gets the errors. - * - * The error contents of the multi-status response. - * - * This field is present for unsuccessful requests. - * - * @return the errors - */ - public List getErrors() { - return errors; - } - - /** - * Gets the trace. - * - * The UUID that uniquely identifies the request. - * - * This field is present for unsuccessful requests. - * - * @return the trace - */ - public String getTrace() { - return trace; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptions.java deleted file mode 100644 index c3ed64a3..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptions.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The createRules options. - */ -public class CreateRulesOptions extends GenericModel { - - protected List rules; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private List rules; - private String transactionId; - - private Builder(CreateRulesOptions createRulesOptions) { - this.rules = createRulesOptions.rules; - this.transactionId = createRulesOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param rules the rules - */ - public Builder(List rules) { - this.rules = rules; - } - - /** - * Builds a CreateRulesOptions. - * - * @return the new CreateRulesOptions instance - */ - public CreateRulesOptions build() { - return new CreateRulesOptions(this); - } - - /** - * Adds an rule to rules. - * - * @param rule the new rule - * @return the CreateRulesOptions builder - */ - public Builder addRule(CreateRuleRequest rule) { - com.ibm.cloud.sdk.core.util.Validator.notNull(rule, - "rule cannot be null"); - if (this.rules == null) { - this.rules = new ArrayList(); - } - this.rules.add(rule); - return this; - } - - /** - * Set the rules. - * Existing rules will be replaced. - * - * @param rules the rules - * @return the CreateRulesOptions builder - */ - public Builder rules(List rules) { - this.rules = rules; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the CreateRulesOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected CreateRulesOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.rules, - "rules cannot be null"); - rules = builder.rules; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a CreateRulesOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the rules. - * - * A list of rules to be created. - * - * @return the rules - */ - public List rules() { - return rules; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponse.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponse.java deleted file mode 100644 index 3a3727ea..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The response associated with a request to create one or more rules. - */ -public class CreateRulesResponse extends GenericModel { - - protected List rules; - - /** - * Gets the rules. - * - * An array of rule responses. - * - * @return the rules - */ - public List getRules() { - return rules; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptions.java deleted file mode 100644 index 051d7e7d..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptions.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The deleteRuleAttachment options. - */ -public class DeleteRuleAttachmentOptions extends GenericModel { - - protected String ruleId; - protected String attachmentId; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private String attachmentId; - private String transactionId; - - private Builder(DeleteRuleAttachmentOptions deleteRuleAttachmentOptions) { - this.ruleId = deleteRuleAttachmentOptions.ruleId; - this.attachmentId = deleteRuleAttachmentOptions.attachmentId; - this.transactionId = deleteRuleAttachmentOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - * @param attachmentId the attachmentId - */ - public Builder(String ruleId, String attachmentId) { - this.ruleId = ruleId; - this.attachmentId = attachmentId; - } - - /** - * Builds a DeleteRuleAttachmentOptions. - * - * @return the new DeleteRuleAttachmentOptions instance - */ - public DeleteRuleAttachmentOptions build() { - return new DeleteRuleAttachmentOptions(this); - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the DeleteRuleAttachmentOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the attachmentId. - * - * @param attachmentId the attachmentId - * @return the DeleteRuleAttachmentOptions builder - */ - public Builder attachmentId(String attachmentId) { - this.attachmentId = attachmentId; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the DeleteRuleAttachmentOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected DeleteRuleAttachmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, - "attachmentId cannot be empty"); - ruleId = builder.ruleId; - attachmentId = builder.attachmentId; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a DeleteRuleAttachmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the attachmentId. - * - * The UUID that uniquely identifies the attachment. - * - * @return the attachmentId - */ - public String attachmentId() { - return attachmentId; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptions.java deleted file mode 100644 index 9ed76447..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptions.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The deleteRule options. - */ -public class DeleteRuleOptions extends GenericModel { - - protected String ruleId; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private String transactionId; - - private Builder(DeleteRuleOptions deleteRuleOptions) { - this.ruleId = deleteRuleOptions.ruleId; - this.transactionId = deleteRuleOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - */ - public Builder(String ruleId) { - this.ruleId = ruleId; - } - - /** - * Builds a DeleteRuleOptions. - * - * @return the new DeleteRuleOptions instance - */ - public DeleteRuleOptions build() { - return new DeleteRuleOptions(this); - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the DeleteRuleOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the DeleteRuleOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected DeleteRuleOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - ruleId = builder.ruleId; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a DeleteRuleOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementAction.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementAction.java deleted file mode 100644 index 141006a4..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementAction.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * EnforcementAction. - */ -public class EnforcementAction extends GenericModel { - - /** - * To block a request from completing, use `disallow`. To log the request to Activity Tracker with LogDNA, use - * `audit_log`. - */ - public interface Action { - /** audit_log. */ - String AUDIT_LOG = "audit_log"; - /** disallow. */ - String DISALLOW = "disallow"; - } - - protected String action; - - /** - * Builder. - */ - public static class Builder { - private String action; - - private Builder(EnforcementAction enforcementAction) { - this.action = enforcementAction.action; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param action the action - */ - public Builder(String action) { - this.action = action; - } - - /** - * Builds a EnforcementAction. - * - * @return the new EnforcementAction instance - */ - public EnforcementAction build() { - return new EnforcementAction(this); - } - - /** - * Set the action. - * - * @param action the action - * @return the EnforcementAction builder - */ - public Builder action(String action) { - this.action = action; - return this; - } - } - - protected EnforcementAction(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, - "action cannot be null"); - action = builder.action; - } - - /** - * New builder. - * - * @return a EnforcementAction builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the action. - * - * To block a request from completing, use `disallow`. To log the request to Activity Tracker with LogDNA, use - * `audit_log`. - * - * @return the action - */ - public String action() { - return action; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptions.java deleted file mode 100644 index 5cdb8302..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptions.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The getRuleAttachment options. - */ -public class GetRuleAttachmentOptions extends GenericModel { - - protected String ruleId; - protected String attachmentId; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private String attachmentId; - private String transactionId; - - private Builder(GetRuleAttachmentOptions getRuleAttachmentOptions) { - this.ruleId = getRuleAttachmentOptions.ruleId; - this.attachmentId = getRuleAttachmentOptions.attachmentId; - this.transactionId = getRuleAttachmentOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - * @param attachmentId the attachmentId - */ - public Builder(String ruleId, String attachmentId) { - this.ruleId = ruleId; - this.attachmentId = attachmentId; - } - - /** - * Builds a GetRuleAttachmentOptions. - * - * @return the new GetRuleAttachmentOptions instance - */ - public GetRuleAttachmentOptions build() { - return new GetRuleAttachmentOptions(this); - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the GetRuleAttachmentOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the attachmentId. - * - * @param attachmentId the attachmentId - * @return the GetRuleAttachmentOptions builder - */ - public Builder attachmentId(String attachmentId) { - this.attachmentId = attachmentId; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the GetRuleAttachmentOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected GetRuleAttachmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, - "attachmentId cannot be empty"); - ruleId = builder.ruleId; - attachmentId = builder.attachmentId; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a GetRuleAttachmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the attachmentId. - * - * The UUID that uniquely identifies the attachment. - * - * @return the attachmentId - */ - public String attachmentId() { - return attachmentId; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptions.java deleted file mode 100644 index a78d2d49..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptions.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The getRule options. - */ -public class GetRuleOptions extends GenericModel { - - protected String ruleId; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private String transactionId; - - private Builder(GetRuleOptions getRuleOptions) { - this.ruleId = getRuleOptions.ruleId; - this.transactionId = getRuleOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - */ - public Builder(String ruleId) { - this.ruleId = ruleId; - } - - /** - * Builds a GetRuleOptions. - * - * @return the new GetRuleOptions instance - */ - public GetRuleOptions build() { - return new GetRuleOptions(this); - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the GetRuleOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the GetRuleOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected GetRuleOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - ruleId = builder.ruleId; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a GetRuleOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Link.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Link.java deleted file mode 100644 index 09c03e0e..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Link.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * A link that is used to paginate through available resources. - */ -public class Link extends GenericModel { - - protected String href; - - /** - * Gets the href. - * - * The URL for the first, previous, next, or last page of resources. - * - * @return the href - */ - public String getHref() { - return href; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptions.java deleted file mode 100644 index 9c1e9ed7..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptions.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The listRuleAttachments options. - */ -public class ListRuleAttachmentsOptions extends GenericModel { - - protected String ruleId; - protected String transactionId; - protected Long limit; - protected Long offset; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private String transactionId; - private Long limit; - private Long offset; - - private Builder(ListRuleAttachmentsOptions listRuleAttachmentsOptions) { - this.ruleId = listRuleAttachmentsOptions.ruleId; - this.transactionId = listRuleAttachmentsOptions.transactionId; - this.limit = listRuleAttachmentsOptions.limit; - this.offset = listRuleAttachmentsOptions.offset; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - */ - public Builder(String ruleId) { - this.ruleId = ruleId; - } - - /** - * Builds a ListRuleAttachmentsOptions. - * - * @return the new ListRuleAttachmentsOptions instance - */ - public ListRuleAttachmentsOptions build() { - return new ListRuleAttachmentsOptions(this); - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the ListRuleAttachmentsOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the ListRuleAttachmentsOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the ListRuleAttachmentsOptions builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - - /** - * Set the offset. - * - * @param offset the offset - * @return the ListRuleAttachmentsOptions builder - */ - public Builder offset(long offset) { - this.offset = offset; - return this; - } - } - - protected ListRuleAttachmentsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - ruleId = builder.ruleId; - transactionId = builder.transactionId; - limit = builder.limit; - offset = builder.offset; - } - - /** - * New builder. - * - * @return a ListRuleAttachmentsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } - - /** - * Gets the limit. - * - * The number of resources to retrieve. By default, list operations return the first 100 items. To retrieve a - * different set of items, use `limit` with `offset` to page through your available resources. - * - * **Usage:** If you have 20 rules, and you want to retrieve only the first 5 rules, use - * `../rules?account_id={account_id}&limit=5`. - * - * @return the limit - */ - public Long limit() { - return limit; - } - - /** - * Gets the offset. - * - * The number of resources to skip. By specifying `offset`, you retrieve a subset of resources that starts with the - * `offset` value. Use `offset` with `limit` to page through your available resources. - * - * **Usage:** If you have 100 rules, and you want to retrieve rules 26 through 50, use - * `../rules?account_id={account_id}&offset=25&limit=5`. - * - * @return the offset - */ - public Long offset() { - return offset; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptions.java deleted file mode 100644 index eee14299..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptions.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The listRules options. - */ -public class ListRulesOptions extends GenericModel { - - protected String accountId; - protected String transactionId; - protected Boolean attached; - protected String labels; - protected String scopes; - protected Long limit; - protected Long offset; - - /** - * Builder. - */ - public static class Builder { - private String accountId; - private String transactionId; - private Boolean attached; - private String labels; - private String scopes; - private Long limit; - private Long offset; - - private Builder(ListRulesOptions listRulesOptions) { - this.accountId = listRulesOptions.accountId; - this.transactionId = listRulesOptions.transactionId; - this.attached = listRulesOptions.attached; - this.labels = listRulesOptions.labels; - this.scopes = listRulesOptions.scopes; - this.limit = listRulesOptions.limit; - this.offset = listRulesOptions.offset; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param accountId the accountId - */ - public Builder(String accountId) { - this.accountId = accountId; - } - - /** - * Builds a ListRulesOptions. - * - * @return the new ListRulesOptions instance - */ - public ListRulesOptions build() { - return new ListRulesOptions(this); - } - - /** - * Set the accountId. - * - * @param accountId the accountId - * @return the ListRulesOptions builder - */ - public Builder accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the ListRulesOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - - /** - * Set the attached. - * - * @param attached the attached - * @return the ListRulesOptions builder - */ - public Builder attached(Boolean attached) { - this.attached = attached; - return this; - } - - /** - * Set the labels. - * - * @param labels the labels - * @return the ListRulesOptions builder - */ - public Builder labels(String labels) { - this.labels = labels; - return this; - } - - /** - * Set the scopes. - * - * @param scopes the scopes - * @return the ListRulesOptions builder - */ - public Builder scopes(String scopes) { - this.scopes = scopes; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the ListRulesOptions builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - - /** - * Set the offset. - * - * @param offset the offset - * @return the ListRulesOptions builder - */ - public Builder offset(long offset) { - this.offset = offset; - return this; - } - } - - protected ListRulesOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.accountId, - "accountId cannot be null"); - accountId = builder.accountId; - transactionId = builder.transactionId; - attached = builder.attached; - labels = builder.labels; - scopes = builder.scopes; - limit = builder.limit; - offset = builder.offset; - } - - /** - * New builder. - * - * @return a ListRulesOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String accountId() { - return accountId; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } - - /** - * Gets the attached. - * - * Retrieves a list of rules that have scope attachments. - * - * @return the attached - */ - public Boolean attached() { - return attached; - } - - /** - * Gets the labels. - * - * Retrieves a list of rules that match the labels that you specify. - * - * @return the labels - */ - public String labels() { - return labels; - } - - /** - * Gets the scopes. - * - * Retrieves a list of rules that match the scope ID that you specify. - * - * @return the scopes - */ - public String scopes() { - return scopes; - } - - /** - * Gets the limit. - * - * The number of resources to retrieve. By default, list operations return the first 100 items. To retrieve a - * different set of items, use `limit` with `offset` to page through your available resources. - * - * **Usage:** If you have 20 rules, and you want to retrieve only the first 5 rules, use - * `../rules?account_id={account_id}&limit=5`. - * - * @return the limit - */ - public Long limit() { - return limit; - } - - /** - * Gets the offset. - * - * The number of resources to skip. By specifying `offset`, you retrieve a subset of resources that starts with the - * `offset` value. Use `offset` with `limit` to page through your available resources. - * - * **Usage:** If you have 100 rules, and you want to retrieve rules 26 through 50, use - * `../rules?account_id={account_id}&offset=25&limit=5`. - * - * @return the offset - */ - public Long offset() { - return offset; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Rule.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Rule.java deleted file mode 100644 index 6e6d278f..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/Rule.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.Date; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * Properties associated with a rule, including both user-defined and server-populated properties. - */ -public class Rule extends GenericModel { - - /** - * The type of rule. Rules that you create are `user_defined`. - */ - public interface RuleType { - /** user_defined. */ - String USER_DEFINED = "user_defined"; - } - - @SerializedName("account_id") - protected String accountId; - protected String name; - protected String description; - @SerializedName("rule_type") - protected String ruleType; - protected TargetResource target; - @SerializedName("required_config") - protected RuleRequiredConfig requiredConfig; - @SerializedName("enforcement_actions") - protected List enforcementActions; - protected List labels; - @SerializedName("rule_id") - protected String ruleId; - @SerializedName("creation_date") - protected Date creationDate; - @SerializedName("created_by") - protected String createdBy; - @SerializedName("modification_date") - protected Date modificationDate; - @SerializedName("modified_by") - protected String modifiedBy; - @SerializedName("number_of_attachments") - protected Long numberOfAttachments; - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String getAccountId() { - return accountId; - } - - /** - * Gets the name. - * - * A human-readable alias to assign to your rule. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the description. - * - * An extended description of your rule. - * - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * Gets the ruleType. - * - * The type of rule. Rules that you create are `user_defined`. - * - * @return the ruleType - */ - public String getRuleType() { - return ruleType; - } - - /** - * Gets the target. - * - * The properties that describe the resource that you want to target - * with the rule or template. - * - * @return the target - */ - public TargetResource getTarget() { - return target; - } - - /** - * Gets the requiredConfig. - * - * @return the requiredConfig - */ - public RuleRequiredConfig getRequiredConfig() { - return requiredConfig; - } - - /** - * Gets the enforcementActions. - * - * The actions that the service must run on your behalf when a request to create or modify the target resource does - * not comply with your conditions. - * - * @return the enforcementActions - */ - public List getEnforcementActions() { - return enforcementActions; - } - - /** - * Gets the labels. - * - * Labels that you can use to group and search for similar rules, such as those that help you to meet a specific - * organization guideline. - * - * @return the labels - */ - public List getLabels() { - return labels; - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String getRuleId() { - return ruleId; - } - - /** - * Gets the creationDate. - * - * The date the resource was created. - * - * @return the creationDate - */ - public Date getCreationDate() { - return creationDate; - } - - /** - * Gets the createdBy. - * - * The unique identifier for the user or application that created the resource. - * - * @return the createdBy - */ - public String getCreatedBy() { - return createdBy; - } - - /** - * Gets the modificationDate. - * - * The date the resource was last modified. - * - * @return the modificationDate - */ - public Date getModificationDate() { - return modificationDate; - } - - /** - * Gets the modifiedBy. - * - * The unique identifier for the user or application that last modified the resource. - * - * @return the modifiedBy - */ - public String getModifiedBy() { - return modifiedBy; - } - - /** - * Gets the numberOfAttachments. - * - * The number of scope attachments that are associated with the rule. - * - * @return the numberOfAttachments - */ - public Long getNumberOfAttachments() { - return numberOfAttachments; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachment.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachment.java deleted file mode 100644 index 21943ea6..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachment.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The scopes to attach to a rule. - */ -public class RuleAttachment extends GenericModel { - - @SerializedName("attachment_id") - protected String attachmentId; - @SerializedName("rule_id") - protected String ruleId; - @SerializedName("account_id") - protected String accountId; - @SerializedName("included_scope") - protected RuleScope includedScope; - @SerializedName("excluded_scopes") - protected List excludedScopes; - - /** - * Gets the attachmentId. - * - * The UUID that uniquely identifies the attachment. - * - * @return the attachmentId - */ - public String getAttachmentId() { - return attachmentId; - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String getRuleId() { - return ruleId; - } - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String getAccountId() { - return accountId; - } - - /** - * Gets the includedScope. - * - * The extent at which the rule can be attached across your accounts. - * - * @return the includedScope - */ - public RuleScope getIncludedScope() { - return includedScope; - } - - /** - * Gets the excludedScopes. - * - * The extent at which the rule can be excluded from the included scope. - * - * @return the excludedScopes - */ - public List getExcludedScopes() { - return excludedScopes; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentList.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentList.java deleted file mode 100644 index c0b00eaf..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentList.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * A list of attachments. - */ -public class RuleAttachmentList extends GenericModel { - - protected Long offset; - protected Long limit; - @SerializedName("total_count") - protected Long totalCount; - protected Link first; - protected Link last; - protected List attachments; - - /** - * Gets the offset. - * - * The requested offset for the returned items. - * - * @return the offset - */ - public Long getOffset() { - return offset; - } - - /** - * Gets the limit. - * - * The requested limit for the returned items. - * - * @return the limit - */ - public Long getLimit() { - return limit; - } - - /** - * Gets the totalCount. - * - * The total number of available items. - * - * @return the totalCount - */ - public Long getTotalCount() { - return totalCount; - } - - /** - * Gets the first. - * - * The first page of available items. - * - * @return the first - */ - public Link getFirst() { - return first; - } - - /** - * Gets the last. - * - * The last page of available items. - * - * @return the last - */ - public Link getLast() { - return last; - } - - /** - * Gets the attachments. - * - * @return the attachments - */ - public List getAttachments() { - return attachments; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequest.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequest.java deleted file mode 100644 index a88a4e1f..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The scopes to attach to a rule. - */ -public class RuleAttachmentRequest extends GenericModel { - - @SerializedName("account_id") - protected String accountId; - @SerializedName("included_scope") - protected RuleScope includedScope; - @SerializedName("excluded_scopes") - protected List excludedScopes; - - /** - * Builder. - */ - public static class Builder { - private String accountId; - private RuleScope includedScope; - private List excludedScopes; - - private Builder(RuleAttachmentRequest ruleAttachmentRequest) { - this.accountId = ruleAttachmentRequest.accountId; - this.includedScope = ruleAttachmentRequest.includedScope; - this.excludedScopes = ruleAttachmentRequest.excludedScopes; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param accountId the accountId - * @param includedScope the includedScope - */ - public Builder(String accountId, RuleScope includedScope) { - this.accountId = accountId; - this.includedScope = includedScope; - } - - /** - * Builds a RuleAttachmentRequest. - * - * @return the new RuleAttachmentRequest instance - */ - public RuleAttachmentRequest build() { - return new RuleAttachmentRequest(this); - } - - /** - * Adds an excludedScope to excludedScopes. - * - * @param excludedScope the new excludedScope - * @return the RuleAttachmentRequest builder - */ - public Builder addExcludedScope(RuleScope excludedScope) { - com.ibm.cloud.sdk.core.util.Validator.notNull(excludedScope, - "excludedScope cannot be null"); - if (this.excludedScopes == null) { - this.excludedScopes = new ArrayList(); - } - this.excludedScopes.add(excludedScope); - return this; - } - - /** - * Set the accountId. - * - * @param accountId the accountId - * @return the RuleAttachmentRequest builder - */ - public Builder accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Set the includedScope. - * - * @param includedScope the includedScope - * @return the RuleAttachmentRequest builder - */ - public Builder includedScope(RuleScope includedScope) { - this.includedScope = includedScope; - return this; - } - - /** - * Set the excludedScopes. - * Existing excludedScopes will be replaced. - * - * @param excludedScopes the excludedScopes - * @return the RuleAttachmentRequest builder - */ - public Builder excludedScopes(List excludedScopes) { - this.excludedScopes = excludedScopes; - return this; - } - } - - protected RuleAttachmentRequest(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.accountId, - "accountId cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.includedScope, - "includedScope cannot be null"); - accountId = builder.accountId; - includedScope = builder.includedScope; - excludedScopes = builder.excludedScopes; - } - - /** - * New builder. - * - * @return a RuleAttachmentRequest builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String accountId() { - return accountId; - } - - /** - * Gets the includedScope. - * - * The extent at which the rule can be attached across your accounts. - * - * @return the includedScope - */ - public RuleScope includedScope() { - return includedScope; - } - - /** - * Gets the excludedScopes. - * - * The extent at which the rule can be excluded from the included scope. - * - * @return the excludedScopes - */ - public List excludedScopes() { - return excludedScopes; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleCondition.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleCondition.java deleted file mode 100644 index 031e64f6..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleCondition.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * RuleCondition. - * - * Classes which extend this class: - * - RuleConditionSingleProperty - * - RuleConditionOrLvl2 - * - RuleConditionAndLvl2 - */ -public class RuleCondition extends GenericModel { - - /** - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - */ - public interface Operator { - /** is_true. */ - String IS_TRUE = "is_true"; - /** is_false. */ - String IS_FALSE = "is_false"; - /** is_empty. */ - String IS_EMPTY = "is_empty"; - /** is_not_empty. */ - String IS_NOT_EMPTY = "is_not_empty"; - /** string_equals. */ - String STRING_EQUALS = "string_equals"; - /** string_not_equals. */ - String STRING_NOT_EQUALS = "string_not_equals"; - /** string_match. */ - String STRING_MATCH = "string_match"; - /** string_not_match. */ - String STRING_NOT_MATCH = "string_not_match"; - /** num_equals. */ - String NUM_EQUALS = "num_equals"; - /** num_not_equals. */ - String NUM_NOT_EQUALS = "num_not_equals"; - /** num_less_than. */ - String NUM_LESS_THAN = "num_less_than"; - /** num_less_than_equals. */ - String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; - /** num_greater_than. */ - String NUM_GREATER_THAN = "num_greater_than"; - /** num_greater_than_equals. */ - String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; - /** ips_in_range. */ - String IPS_IN_RANGE = "ips_in_range"; - /** strings_in_list. */ - String STRINGS_IN_LIST = "strings_in_list"; - } - - protected String description; - protected String property; - protected String operator; - protected String value; - protected List or; - protected List and; - - protected RuleCondition() { - } - - /** - * Gets the description. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the property. - * - * A resource configuration variable that describes the property that you want to apply to the target resource. - * - * Available options depend on the target service and resource. - * - * @return the property - */ - public String property() { - return property; - } - - /** - * Gets the operator. - * - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - * - * @return the operator - */ - public String operator() { - return operator; - } - - /** - * Gets the value. - * - * The way in which you want your property to be applied. - * - * Value options differ depending on the rule that you configure. If you use a boolean operator, you do not need to - * input a value. - * - * @return the value - */ - public String value() { - return value; - } - - /** - * Gets the or. - * - * @return the or - */ - public List or() { - return or; - } - - /** - * Gets the and. - * - * @return the and - */ - public List and() { - return and; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2.java deleted file mode 100644 index a2db558c..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -/** - * A condition with the `and` logical operator. - */ -public class RuleConditionAndLvl2 extends RuleCondition { - - - /** - * Builder. - */ - public static class Builder { - private String description; - private List and; - - public Builder(RuleCondition ruleConditionAndLvl2) { - this.description = ruleConditionAndLvl2.description; - this.and = ruleConditionAndLvl2.and; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param and the and - */ - public Builder(List and) { - this.and = and; - } - - /** - * Builds a RuleConditionAndLvl2. - * - * @return the new RuleConditionAndLvl2 instance - */ - public RuleConditionAndLvl2 build() { - return new RuleConditionAndLvl2(this); - } - - /** - * Adds an operand to and. - * - * @param operand the new operand - * @return the RuleConditionAndLvl2 builder - */ - public Builder addOperand(RuleSingleProperty operand) { - com.ibm.cloud.sdk.core.util.Validator.notNull(operand, - "operand cannot be null"); - if (this.and == null) { - this.and = new ArrayList(); - } - this.and.add(operand); - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleConditionAndLvl2 builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the and. - * Existing and will be replaced. - * - * @param and the and - * @return the RuleConditionAndLvl2 builder - */ - public Builder and(List and) { - this.and = and; - return this; - } - } - - protected RuleConditionAndLvl2(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.and, - "and cannot be null"); - description = builder.description; - and = builder.and; - } - - /** - * New builder. - * - * @return a RuleConditionAndLvl2 builder - */ - public Builder newBuilder() { - return new Builder(this); - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2.java deleted file mode 100644 index 436aacc4..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -/** - * A condition with the `or` logical operator. - */ -public class RuleConditionOrLvl2 extends RuleCondition { - - - /** - * Builder. - */ - public static class Builder { - private String description; - private List or; - - public Builder(RuleCondition ruleConditionOrLvl2) { - this.description = ruleConditionOrLvl2.description; - this.or = ruleConditionOrLvl2.or; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param or the or - */ - public Builder(List or) { - this.or = or; - } - - /** - * Builds a RuleConditionOrLvl2. - * - * @return the new RuleConditionOrLvl2 instance - */ - public RuleConditionOrLvl2 build() { - return new RuleConditionOrLvl2(this); - } - - /** - * Adds an operand to or. - * - * @param operand the new operand - * @return the RuleConditionOrLvl2 builder - */ - public Builder addOperand(RuleSingleProperty operand) { - com.ibm.cloud.sdk.core.util.Validator.notNull(operand, - "operand cannot be null"); - if (this.or == null) { - this.or = new ArrayList(); - } - this.or.add(operand); - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleConditionOrLvl2 builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the or. - * Existing or will be replaced. - * - * @param or the or - * @return the RuleConditionOrLvl2 builder - */ - public Builder or(List or) { - this.or = or; - return this; - } - } - - protected RuleConditionOrLvl2(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.or, - "or cannot be null"); - description = builder.description; - or = builder.or; - } - - /** - * New builder. - * - * @return a RuleConditionOrLvl2 builder - */ - public Builder newBuilder() { - return new Builder(this); - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSingleProperty.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSingleProperty.java deleted file mode 100644 index 4cedfc75..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSingleProperty.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -/** - * The requirement that must be met to determine the resource's level of compliance in accordance with the rule. - * - * To apply a single property check, define a configuration property and the desired value that you want to check - * against. - */ -public class RuleConditionSingleProperty extends RuleCondition { - - /** - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - */ - public interface Operator { - /** is_true. */ - String IS_TRUE = "is_true"; - /** is_false. */ - String IS_FALSE = "is_false"; - /** is_empty. */ - String IS_EMPTY = "is_empty"; - /** is_not_empty. */ - String IS_NOT_EMPTY = "is_not_empty"; - /** string_equals. */ - String STRING_EQUALS = "string_equals"; - /** string_not_equals. */ - String STRING_NOT_EQUALS = "string_not_equals"; - /** string_match. */ - String STRING_MATCH = "string_match"; - /** string_not_match. */ - String STRING_NOT_MATCH = "string_not_match"; - /** num_equals. */ - String NUM_EQUALS = "num_equals"; - /** num_not_equals. */ - String NUM_NOT_EQUALS = "num_not_equals"; - /** num_less_than. */ - String NUM_LESS_THAN = "num_less_than"; - /** num_less_than_equals. */ - String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; - /** num_greater_than. */ - String NUM_GREATER_THAN = "num_greater_than"; - /** num_greater_than_equals. */ - String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; - /** ips_in_range. */ - String IPS_IN_RANGE = "ips_in_range"; - /** strings_in_list. */ - String STRINGS_IN_LIST = "strings_in_list"; - } - - - /** - * Builder. - */ - public static class Builder { - private String description; - private String property; - private String operator; - private String value; - - public Builder(RuleCondition ruleConditionSingleProperty) { - this.description = ruleConditionSingleProperty.description; - this.property = ruleConditionSingleProperty.property; - this.operator = ruleConditionSingleProperty.operator; - this.value = ruleConditionSingleProperty.value; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param property the property - * @param operator the operator - */ - public Builder(String property, String operator) { - this.property = property; - this.operator = operator; - } - - /** - * Builds a RuleConditionSingleProperty. - * - * @return the new RuleConditionSingleProperty instance - */ - public RuleConditionSingleProperty build() { - return new RuleConditionSingleProperty(this); - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleConditionSingleProperty builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the property. - * - * @param property the property - * @return the RuleConditionSingleProperty builder - */ - public Builder property(String property) { - this.property = property; - return this; - } - - /** - * Set the operator. - * - * @param operator the operator - * @return the RuleConditionSingleProperty builder - */ - public Builder operator(String operator) { - this.operator = operator; - return this; - } - - /** - * Set the value. - * - * @param value the value - * @return the RuleConditionSingleProperty builder - */ - public Builder value(String value) { - this.value = value; - return this; - } - } - - protected RuleConditionSingleProperty(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.property, - "property cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operator, - "operator cannot be null"); - description = builder.description; - property = builder.property; - operator = builder.operator; - value = builder.value; - } - - /** - * New builder. - * - * @return a RuleConditionSingleProperty builder - */ - public Builder newBuilder() { - return new Builder(this); - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleList.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleList.java deleted file mode 100644 index 9a4733b9..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleList.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * A list of rules. - */ -public class RuleList extends GenericModel { - - protected Long offset; - protected Long limit; - @SerializedName("total_count") - protected Long totalCount; - protected Link first; - protected Link last; - protected List rules; - - /** - * Gets the offset. - * - * The requested offset for the returned items. - * - * @return the offset - */ - public Long getOffset() { - return offset; - } - - /** - * Gets the limit. - * - * The requested limit for the returned items. - * - * @return the limit - */ - public Long getLimit() { - return limit; - } - - /** - * Gets the totalCount. - * - * The total number of available items. - * - * @return the totalCount - */ - public Long getTotalCount() { - return totalCount; - } - - /** - * Gets the first. - * - * The first page of available items. - * - * @return the first - */ - public Link getFirst() { - return first; - } - - /** - * Gets the last. - * - * The last page of available items. - * - * @return the last - */ - public Link getLast() { - return last; - } - - /** - * Gets the rules. - * - * An array of rules. - * - * @return the rules - */ - public List getRules() { - return rules; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequest.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequest.java deleted file mode 100644 index 77d53df1..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequest.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * Properties that you can associate with a rule. - */ -public class RuleRequest extends GenericModel { - - /** - * The type of rule. Rules that you create are `user_defined`. - */ - public interface RuleType { - /** user_defined. */ - String USER_DEFINED = "user_defined"; - } - - @SerializedName("account_id") - protected String accountId; - protected String name; - protected String description; - @SerializedName("rule_type") - protected String ruleType; - protected TargetResource target; - @SerializedName("required_config") - protected RuleRequiredConfig requiredConfig; - @SerializedName("enforcement_actions") - protected List enforcementActions; - protected List labels; - - /** - * Builder. - */ - public static class Builder { - private String accountId; - private String name; - private String description; - private String ruleType; - private TargetResource target; - private RuleRequiredConfig requiredConfig; - private List enforcementActions; - private List labels; - - private Builder(RuleRequest ruleRequest) { - this.accountId = ruleRequest.accountId; - this.name = ruleRequest.name; - this.description = ruleRequest.description; - this.ruleType = ruleRequest.ruleType; - this.target = ruleRequest.target; - this.requiredConfig = ruleRequest.requiredConfig; - this.enforcementActions = ruleRequest.enforcementActions; - this.labels = ruleRequest.labels; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param name the name - * @param description the description - * @param target the target - * @param requiredConfig the requiredConfig - * @param enforcementActions the enforcementActions - */ - public Builder(String name, String description, TargetResource target, RuleRequiredConfig requiredConfig, List enforcementActions) { - this.name = name; - this.description = description; - this.target = target; - this.requiredConfig = requiredConfig; - this.enforcementActions = enforcementActions; - } - - /** - * Builds a RuleRequest. - * - * @return the new RuleRequest instance - */ - public RuleRequest build() { - return new RuleRequest(this); - } - - /** - * Adds an enforcementAction to enforcementActions. - * - * @param enforcementAction the new enforcementAction - * @return the RuleRequest builder - */ - public Builder addEnforcementAction(EnforcementAction enforcementAction) { - com.ibm.cloud.sdk.core.util.Validator.notNull(enforcementAction, - "enforcementAction cannot be null"); - if (this.enforcementActions == null) { - this.enforcementActions = new ArrayList(); - } - this.enforcementActions.add(enforcementAction); - return this; - } - - /** - * Adds an label to labels. - * - * @param label the new label - * @return the RuleRequest builder - */ - public Builder addLabel(String label) { - com.ibm.cloud.sdk.core.util.Validator.notNull(label, - "label cannot be null"); - if (this.labels == null) { - this.labels = new ArrayList(); - } - this.labels.add(label); - return this; - } - - /** - * Set the accountId. - * - * @param accountId the accountId - * @return the RuleRequest builder - */ - public Builder accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the RuleRequest builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleRequest builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the ruleType. - * - * @param ruleType the ruleType - * @return the RuleRequest builder - */ - public Builder ruleType(String ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Set the target. - * - * @param target the target - * @return the RuleRequest builder - */ - public Builder target(TargetResource target) { - this.target = target; - return this; - } - - /** - * Set the requiredConfig. - * - * @param requiredConfig the requiredConfig - * @return the RuleRequest builder - */ - public Builder requiredConfig(RuleRequiredConfig requiredConfig) { - this.requiredConfig = requiredConfig; - return this; - } - - /** - * Set the enforcementActions. - * Existing enforcementActions will be replaced. - * - * @param enforcementActions the enforcementActions - * @return the RuleRequest builder - */ - public Builder enforcementActions(List enforcementActions) { - this.enforcementActions = enforcementActions; - return this; - } - - /** - * Set the labels. - * Existing labels will be replaced. - * - * @param labels the labels - * @return the RuleRequest builder - */ - public Builder labels(List labels) { - this.labels = labels; - return this; - } - } - - protected RuleRequest(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, - "name cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.description, - "description cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, - "target cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.requiredConfig, - "requiredConfig cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.enforcementActions, - "enforcementActions cannot be null"); - accountId = builder.accountId; - name = builder.name; - description = builder.description; - ruleType = builder.ruleType; - target = builder.target; - requiredConfig = builder.requiredConfig; - enforcementActions = builder.enforcementActions; - labels = builder.labels; - } - - /** - * New builder. - * - * @return a RuleRequest builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String accountId() { - return accountId; - } - - /** - * Gets the name. - * - * A human-readable alias to assign to your rule. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - * An extended description of your rule. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the ruleType. - * - * The type of rule. Rules that you create are `user_defined`. - * - * @return the ruleType - */ - public String ruleType() { - return ruleType; - } - - /** - * Gets the target. - * - * The properties that describe the resource that you want to target - * with the rule or template. - * - * @return the target - */ - public TargetResource target() { - return target; - } - - /** - * Gets the requiredConfig. - * - * @return the requiredConfig - */ - public RuleRequiredConfig requiredConfig() { - return requiredConfig; - } - - /** - * Gets the enforcementActions. - * - * The actions that the service must run on your behalf when a request to create or modify the target resource does - * not comply with your conditions. - * - * @return the enforcementActions - */ - public List enforcementActions() { - return enforcementActions; - } - - /** - * Gets the labels. - * - * Labels that you can use to group and search for similar rules, such as those that help you to meet a specific - * organization guideline. - * - * @return the labels - */ - public List labels() { - return labels; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfig.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfig.java deleted file mode 100644 index fed95de6..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfig.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * RuleRequiredConfig. - * - * Classes which extend this class: - * - RuleRequiredConfigSingleProperty - * - RuleRequiredConfigMultipleProperties - */ -public class RuleRequiredConfig extends GenericModel { - - /** - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - */ - public interface Operator { - /** is_true. */ - String IS_TRUE = "is_true"; - /** is_false. */ - String IS_FALSE = "is_false"; - /** is_empty. */ - String IS_EMPTY = "is_empty"; - /** is_not_empty. */ - String IS_NOT_EMPTY = "is_not_empty"; - /** string_equals. */ - String STRING_EQUALS = "string_equals"; - /** string_not_equals. */ - String STRING_NOT_EQUALS = "string_not_equals"; - /** string_match. */ - String STRING_MATCH = "string_match"; - /** string_not_match. */ - String STRING_NOT_MATCH = "string_not_match"; - /** num_equals. */ - String NUM_EQUALS = "num_equals"; - /** num_not_equals. */ - String NUM_NOT_EQUALS = "num_not_equals"; - /** num_less_than. */ - String NUM_LESS_THAN = "num_less_than"; - /** num_less_than_equals. */ - String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; - /** num_greater_than. */ - String NUM_GREATER_THAN = "num_greater_than"; - /** num_greater_than_equals. */ - String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; - /** ips_in_range. */ - String IPS_IN_RANGE = "ips_in_range"; - /** strings_in_list. */ - String STRINGS_IN_LIST = "strings_in_list"; - } - - protected String description; - protected String property; - protected String operator; - protected String value; - protected List or; - protected List and; - - protected RuleRequiredConfig() { - } - - /** - * Gets the description. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the property. - * - * A resource configuration variable that describes the property that you want to apply to the target resource. - * - * Available options depend on the target service and resource. - * - * @return the property - */ - public String property() { - return property; - } - - /** - * Gets the operator. - * - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - * - * @return the operator - */ - public String operator() { - return operator; - } - - /** - * Gets the value. - * - * The way in which you want your property to be applied. - * - * Value options differ depending on the rule that you configure. If you use a boolean operator, you do not need to - * input a value. - * - * @return the value - */ - public String value() { - return value; - } - - /** - * Gets the or. - * - * @return the or - */ - public List or() { - return or; - } - - /** - * Gets the and. - * - * @return the and - */ - public List and() { - return and; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultipleProperties.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultipleProperties.java deleted file mode 100644 index 52402247..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultipleProperties.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -/** - * The requirements that must be met to determine the resource's level of compliance in accordance with the rule. - * - * Use logical operators (`and`/`or`) to define multiple property checks and conditions. To define requirements for a - * rule, list one or more property check objects in the `and` array. To add conditions to a property check, use `or`. - * - * Classes which extend this class: - * - RuleRequiredConfigMultiplePropertiesConditionOr - * - RuleRequiredConfigMultiplePropertiesConditionAnd - */ -public class RuleRequiredConfigMultipleProperties extends RuleRequiredConfig { - - - protected RuleRequiredConfigMultipleProperties() { - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAnd.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAnd.java deleted file mode 100644 index b6d4a560..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAnd.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -/** - * A condition with the `and` logical operator. - */ -public class RuleRequiredConfigMultiplePropertiesConditionAnd extends RuleRequiredConfigMultipleProperties { - - - /** - * Builder. - */ - public static class Builder { - private String description; - private List and; - - public Builder(RuleRequiredConfigMultipleProperties ruleRequiredConfigMultiplePropertiesConditionAnd) { - this.description = ruleRequiredConfigMultiplePropertiesConditionAnd.description; - this.and = ruleRequiredConfigMultiplePropertiesConditionAnd.and; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param and the and - */ - public Builder(List and) { - this.and = and; - } - - /** - * Builds a RuleRequiredConfigMultiplePropertiesConditionAnd. - * - * @return the new RuleRequiredConfigMultiplePropertiesConditionAnd instance - */ - public RuleRequiredConfigMultiplePropertiesConditionAnd build() { - return new RuleRequiredConfigMultiplePropertiesConditionAnd(this); - } - - /** - * Adds an operand to and. - * - * @param operand the new operand - * @return the RuleRequiredConfigMultiplePropertiesConditionAnd builder - */ - public Builder addOperand(RuleCondition operand) { - com.ibm.cloud.sdk.core.util.Validator.notNull(operand, - "operand cannot be null"); - if (this.and == null) { - this.and = new ArrayList(); - } - this.and.add(operand); - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleRequiredConfigMultiplePropertiesConditionAnd builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the and. - * Existing and will be replaced. - * - * @param and the and - * @return the RuleRequiredConfigMultiplePropertiesConditionAnd builder - */ - public Builder and(List and) { - this.and = and; - return this; - } - } - - protected RuleRequiredConfigMultiplePropertiesConditionAnd(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.and, - "and cannot be null"); - description = builder.description; - and = builder.and; - } - - /** - * New builder. - * - * @return a RuleRequiredConfigMultiplePropertiesConditionAnd builder - */ - public Builder newBuilder() { - return new Builder(this); - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOr.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOr.java deleted file mode 100644 index 4fdb7502..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOr.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -/** - * A condition with the `or` logical operator. - */ -public class RuleRequiredConfigMultiplePropertiesConditionOr extends RuleRequiredConfigMultipleProperties { - - - /** - * Builder. - */ - public static class Builder { - private String description; - private List or; - - public Builder(RuleRequiredConfigMultipleProperties ruleRequiredConfigMultiplePropertiesConditionOr) { - this.description = ruleRequiredConfigMultiplePropertiesConditionOr.description; - this.or = ruleRequiredConfigMultiplePropertiesConditionOr.or; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param or the or - */ - public Builder(List or) { - this.or = or; - } - - /** - * Builds a RuleRequiredConfigMultiplePropertiesConditionOr. - * - * @return the new RuleRequiredConfigMultiplePropertiesConditionOr instance - */ - public RuleRequiredConfigMultiplePropertiesConditionOr build() { - return new RuleRequiredConfigMultiplePropertiesConditionOr(this); - } - - /** - * Adds an operand to or. - * - * @param operand the new operand - * @return the RuleRequiredConfigMultiplePropertiesConditionOr builder - */ - public Builder addOperand(RuleCondition operand) { - com.ibm.cloud.sdk.core.util.Validator.notNull(operand, - "operand cannot be null"); - if (this.or == null) { - this.or = new ArrayList(); - } - this.or.add(operand); - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleRequiredConfigMultiplePropertiesConditionOr builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the or. - * Existing or will be replaced. - * - * @param or the or - * @return the RuleRequiredConfigMultiplePropertiesConditionOr builder - */ - public Builder or(List or) { - this.or = or; - return this; - } - } - - protected RuleRequiredConfigMultiplePropertiesConditionOr(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.or, - "or cannot be null"); - description = builder.description; - or = builder.or; - } - - /** - * New builder. - * - * @return a RuleRequiredConfigMultiplePropertiesConditionOr builder - */ - public Builder newBuilder() { - return new Builder(this); - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSingleProperty.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSingleProperty.java deleted file mode 100644 index c86186f5..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSingleProperty.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -/** - * The requirement that must be met to determine the resource's level of compliance in accordance with the rule. - * - * To apply a single property check, define a configuration property and the desired value that you want to check - * against. - */ -public class RuleRequiredConfigSingleProperty extends RuleRequiredConfig { - - /** - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - */ - public interface Operator { - /** is_true. */ - String IS_TRUE = "is_true"; - /** is_false. */ - String IS_FALSE = "is_false"; - /** is_empty. */ - String IS_EMPTY = "is_empty"; - /** is_not_empty. */ - String IS_NOT_EMPTY = "is_not_empty"; - /** string_equals. */ - String STRING_EQUALS = "string_equals"; - /** string_not_equals. */ - String STRING_NOT_EQUALS = "string_not_equals"; - /** string_match. */ - String STRING_MATCH = "string_match"; - /** string_not_match. */ - String STRING_NOT_MATCH = "string_not_match"; - /** num_equals. */ - String NUM_EQUALS = "num_equals"; - /** num_not_equals. */ - String NUM_NOT_EQUALS = "num_not_equals"; - /** num_less_than. */ - String NUM_LESS_THAN = "num_less_than"; - /** num_less_than_equals. */ - String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; - /** num_greater_than. */ - String NUM_GREATER_THAN = "num_greater_than"; - /** num_greater_than_equals. */ - String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; - /** ips_in_range. */ - String IPS_IN_RANGE = "ips_in_range"; - /** strings_in_list. */ - String STRINGS_IN_LIST = "strings_in_list"; - } - - - /** - * Builder. - */ - public static class Builder { - private String description; - private String property; - private String operator; - private String value; - - public Builder(RuleRequiredConfig ruleRequiredConfigSingleProperty) { - this.description = ruleRequiredConfigSingleProperty.description; - this.property = ruleRequiredConfigSingleProperty.property; - this.operator = ruleRequiredConfigSingleProperty.operator; - this.value = ruleRequiredConfigSingleProperty.value; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param property the property - * @param operator the operator - */ - public Builder(String property, String operator) { - this.property = property; - this.operator = operator; - } - - /** - * Builds a RuleRequiredConfigSingleProperty. - * - * @return the new RuleRequiredConfigSingleProperty instance - */ - public RuleRequiredConfigSingleProperty build() { - return new RuleRequiredConfigSingleProperty(this); - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleRequiredConfigSingleProperty builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the property. - * - * @param property the property - * @return the RuleRequiredConfigSingleProperty builder - */ - public Builder property(String property) { - this.property = property; - return this; - } - - /** - * Set the operator. - * - * @param operator the operator - * @return the RuleRequiredConfigSingleProperty builder - */ - public Builder operator(String operator) { - this.operator = operator; - return this; - } - - /** - * Set the value. - * - * @param value the value - * @return the RuleRequiredConfigSingleProperty builder - */ - public Builder value(String value) { - this.value = value; - return this; - } - } - - protected RuleRequiredConfigSingleProperty(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.property, - "property cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operator, - "operator cannot be null"); - description = builder.description; - property = builder.property; - operator = builder.operator; - value = builder.value; - } - - /** - * New builder. - * - * @return a RuleRequiredConfigSingleProperty builder - */ - public Builder newBuilder() { - return new Builder(this); - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseError.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseError.java deleted file mode 100644 index 9ae31ca2..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseError.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * RuleResponseError. - */ -public class RuleResponseError extends GenericModel { - - protected String code; - protected String message; - - /** - * Gets the code. - * - * Specifies the problem that caused the error. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Gets the message. - * - * Describes the problem. - * - * @return the message - */ - public String getMessage() { - return message; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScope.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScope.java deleted file mode 100644 index 926d4e47..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScope.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The extent at which the rule can be attached across your accounts. - */ -public class RuleScope extends GenericModel { - - /** - * The type of scope that you want to evaluate. - */ - public interface ScopeType { - /** enterprise. */ - String ENTERPRISE = "enterprise"; - /** enterprise.account_group. */ - String ENTERPRISE_ACCOUNT_GROUP = "enterprise.account_group"; - /** enterprise.account. */ - String ENTERPRISE_ACCOUNT = "enterprise.account"; - /** account. */ - String ACCOUNT = "account"; - /** account.resource_group. */ - String ACCOUNT_RESOURCE_GROUP = "account.resource_group"; - } - - protected String note; - @SerializedName("scope_id") - protected String scopeId; - @SerializedName("scope_type") - protected String scopeType; - - /** - * Builder. - */ - public static class Builder { - private String note; - private String scopeId; - private String scopeType; - - private Builder(RuleScope ruleScope) { - this.note = ruleScope.note; - this.scopeId = ruleScope.scopeId; - this.scopeType = ruleScope.scopeType; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param scopeId the scopeId - * @param scopeType the scopeType - */ - public Builder(String scopeId, String scopeType) { - this.scopeId = scopeId; - this.scopeType = scopeType; - } - - /** - * Builds a RuleScope. - * - * @return the new RuleScope instance - */ - public RuleScope build() { - return new RuleScope(this); - } - - /** - * Set the note. - * - * @param note the note - * @return the RuleScope builder - */ - public Builder note(String note) { - this.note = note; - return this; - } - - /** - * Set the scopeId. - * - * @param scopeId the scopeId - * @return the RuleScope builder - */ - public Builder scopeId(String scopeId) { - this.scopeId = scopeId; - return this; - } - - /** - * Set the scopeType. - * - * @param scopeType the scopeType - * @return the RuleScope builder - */ - public Builder scopeType(String scopeType) { - this.scopeType = scopeType; - return this; - } - } - - protected RuleScope(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.scopeId, - "scopeId cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.scopeType, - "scopeType cannot be null"); - note = builder.note; - scopeId = builder.scopeId; - scopeType = builder.scopeType; - } - - /** - * New builder. - * - * @return a RuleScope builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the note. - * - * A short description or alias to assign to the scope. - * - * @return the note - */ - public String note() { - return note; - } - - /** - * Gets the scopeId. - * - * The ID of the scope, such as an enterprise, account, or account group, that you want to evaluate. - * - * @return the scopeId - */ - public String scopeId() { - return scopeId; - } - - /** - * Gets the scopeType. - * - * The type of scope that you want to evaluate. - * - * @return the scopeType - */ - public String scopeType() { - return scopeType; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSingleProperty.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSingleProperty.java deleted file mode 100644 index aa28a325..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSingleProperty.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The requirement that must be met to determine the resource's level of compliance in accordance with the rule. - * - * To apply a single property check, define a configuration property and the desired value that you want to check - * against. - */ -public class RuleSingleProperty extends GenericModel { - - /** - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - */ - public interface Operator { - /** is_true. */ - String IS_TRUE = "is_true"; - /** is_false. */ - String IS_FALSE = "is_false"; - /** is_empty. */ - String IS_EMPTY = "is_empty"; - /** is_not_empty. */ - String IS_NOT_EMPTY = "is_not_empty"; - /** string_equals. */ - String STRING_EQUALS = "string_equals"; - /** string_not_equals. */ - String STRING_NOT_EQUALS = "string_not_equals"; - /** string_match. */ - String STRING_MATCH = "string_match"; - /** string_not_match. */ - String STRING_NOT_MATCH = "string_not_match"; - /** num_equals. */ - String NUM_EQUALS = "num_equals"; - /** num_not_equals. */ - String NUM_NOT_EQUALS = "num_not_equals"; - /** num_less_than. */ - String NUM_LESS_THAN = "num_less_than"; - /** num_less_than_equals. */ - String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; - /** num_greater_than. */ - String NUM_GREATER_THAN = "num_greater_than"; - /** num_greater_than_equals. */ - String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; - /** ips_in_range. */ - String IPS_IN_RANGE = "ips_in_range"; - /** strings_in_list. */ - String STRINGS_IN_LIST = "strings_in_list"; - } - - protected String description; - protected String property; - protected String operator; - protected String value; - - /** - * Builder. - */ - public static class Builder { - private String description; - private String property; - private String operator; - private String value; - - private Builder(RuleSingleProperty ruleSingleProperty) { - this.description = ruleSingleProperty.description; - this.property = ruleSingleProperty.property; - this.operator = ruleSingleProperty.operator; - this.value = ruleSingleProperty.value; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param property the property - * @param operator the operator - */ - public Builder(String property, String operator) { - this.property = property; - this.operator = operator; - } - - /** - * Builds a RuleSingleProperty. - * - * @return the new RuleSingleProperty instance - */ - public RuleSingleProperty build() { - return new RuleSingleProperty(this); - } - - /** - * Set the description. - * - * @param description the description - * @return the RuleSingleProperty builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the property. - * - * @param property the property - * @return the RuleSingleProperty builder - */ - public Builder property(String property) { - this.property = property; - return this; - } - - /** - * Set the operator. - * - * @param operator the operator - * @return the RuleSingleProperty builder - */ - public Builder operator(String operator) { - this.operator = operator; - return this; - } - - /** - * Set the value. - * - * @param value the value - * @return the RuleSingleProperty builder - */ - public Builder value(String value) { - this.value = value; - return this; - } - } - - protected RuleSingleProperty(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.property, - "property cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operator, - "operator cannot be null"); - description = builder.description; - property = builder.property; - operator = builder.operator; - value = builder.value; - } - - /** - * New builder. - * - * @return a RuleSingleProperty builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the description. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the property. - * - * A resource configuration variable that describes the property that you want to apply to the target resource. - * - * Available options depend on the target service and resource. - * - * @return the property - */ - public String property() { - return property; - } - - /** - * Gets the operator. - * - * The way in which the `property` field is compared to its value. - * - * To learn more, see the [docs](/docs/security-compliance?topic=security-compliance-what-is-rule#rule-operators). - * - * @return the operator - */ - public String operator() { - return operator; - } - - /** - * Gets the value. - * - * The way in which you want your property to be applied. - * - * Value options differ depending on the rule that you configure. If you use a boolean operator, you do not need to - * input a value. - * - * @return the value - */ - public String value() { - return value; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResource.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResource.java deleted file mode 100644 index e9cab793..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResource.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The properties that describe the resource that you want to target with the rule or template. - */ -public class TargetResource extends GenericModel { - - @SerializedName("service_name") - protected String serviceName; - @SerializedName("resource_kind") - protected String resourceKind; - @SerializedName("additional_target_attributes") - protected List additionalTargetAttributes; - - /** - * Builder. - */ - public static class Builder { - private String serviceName; - private String resourceKind; - private List additionalTargetAttributes; - - private Builder(TargetResource targetResource) { - this.serviceName = targetResource.serviceName; - this.resourceKind = targetResource.resourceKind; - this.additionalTargetAttributes = targetResource.additionalTargetAttributes; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param serviceName the serviceName - * @param resourceKind the resourceKind - */ - public Builder(String serviceName, String resourceKind) { - this.serviceName = serviceName; - this.resourceKind = resourceKind; - } - - /** - * Builds a TargetResource. - * - * @return the new TargetResource instance - */ - public TargetResource build() { - return new TargetResource(this); - } - - /** - * Adds an additionalTargetAttribute to additionalTargetAttributes. - * - * @param additionalTargetAttribute the new additionalTargetAttribute - * @return the TargetResource builder - */ - public Builder addAdditionalTargetAttribute(TargetResourceAdditionalTargetAttributesItem additionalTargetAttribute) { - com.ibm.cloud.sdk.core.util.Validator.notNull(additionalTargetAttribute, - "additionalTargetAttribute cannot be null"); - if (this.additionalTargetAttributes == null) { - this.additionalTargetAttributes = new ArrayList(); - } - this.additionalTargetAttributes.add(additionalTargetAttribute); - return this; - } - - /** - * Set the serviceName. - * - * @param serviceName the serviceName - * @return the TargetResource builder - */ - public Builder serviceName(String serviceName) { - this.serviceName = serviceName; - return this; - } - - /** - * Set the resourceKind. - * - * @param resourceKind the resourceKind - * @return the TargetResource builder - */ - public Builder resourceKind(String resourceKind) { - this.resourceKind = resourceKind; - return this; - } - - /** - * Set the additionalTargetAttributes. - * Existing additionalTargetAttributes will be replaced. - * - * @param additionalTargetAttributes the additionalTargetAttributes - * @return the TargetResource builder - */ - public Builder additionalTargetAttributes(List additionalTargetAttributes) { - this.additionalTargetAttributes = additionalTargetAttributes; - return this; - } - } - - protected TargetResource(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.serviceName, - "serviceName cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resourceKind, - "resourceKind cannot be null"); - serviceName = builder.serviceName; - resourceKind = builder.resourceKind; - additionalTargetAttributes = builder.additionalTargetAttributes; - } - - /** - * New builder. - * - * @return a TargetResource builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the serviceName. - * - * The programmatic name of the IBM Cloud service that you want to target with the rule or template. - * - * @return the serviceName - */ - public String serviceName() { - return serviceName; - } - - /** - * Gets the resourceKind. - * - * The type of resource that you want to target. - * - * @return the resourceKind - */ - public String resourceKind() { - return resourceKind; - } - - /** - * Gets the additionalTargetAttributes. - * - * An extra qualifier for the resource kind. When you include additional attributes, only the resources that match the - * definition are included in the rule or template. - * - * @return the additionalTargetAttributes - */ - public List additionalTargetAttributes() { - return additionalTargetAttributes; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItem.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItem.java deleted file mode 100644 index 8343af08..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItem.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The attributes that are associated with a rule or template target. - */ -public class TargetResourceAdditionalTargetAttributesItem extends GenericModel { - - /** - * The way in which the `name` field is compared to its value. - * - * There are three types of operators: string, numeric, and boolean. - */ - public interface Operator { - /** string_equals. */ - String STRING_EQUALS = "string_equals"; - /** string_not_equals. */ - String STRING_NOT_EQUALS = "string_not_equals"; - /** string_match. */ - String STRING_MATCH = "string_match"; - /** string_not_match. */ - String STRING_NOT_MATCH = "string_not_match"; - /** strings_in_list. */ - String STRINGS_IN_LIST = "strings_in_list"; - /** ips_in_range. */ - String IPS_IN_RANGE = "ips_in_range"; - /** num_equals. */ - String NUM_EQUALS = "num_equals"; - /** num_not_equals. */ - String NUM_NOT_EQUALS = "num_not_equals"; - /** num_less_than. */ - String NUM_LESS_THAN = "num_less_than"; - /** num_less_than_equals. */ - String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; - /** num_greater_than. */ - String NUM_GREATER_THAN = "num_greater_than"; - /** num_greater_than_equals. */ - String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; - /** is_empty. */ - String IS_EMPTY = "is_empty"; - /** is_not_empty. */ - String IS_NOT_EMPTY = "is_not_empty"; - /** is_true. */ - String IS_TRUE = "is_true"; - /** is_false. */ - String IS_FALSE = "is_false"; - } - - protected String name; - protected String value; - protected String operator; - - /** - * Builder. - */ - public static class Builder { - private String name; - private String value; - private String operator; - - private Builder(TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItem) { - this.name = targetResourceAdditionalTargetAttributesItem.name; - this.value = targetResourceAdditionalTargetAttributesItem.value; - this.operator = targetResourceAdditionalTargetAttributesItem.operator; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param name the name - * @param value the value - * @param operator the operator - */ - public Builder(String name, String value, String operator) { - this.name = name; - this.value = value; - this.operator = operator; - } - - /** - * Builds a TargetResourceAdditionalTargetAttributesItem. - * - * @return the new TargetResourceAdditionalTargetAttributesItem instance - */ - public TargetResourceAdditionalTargetAttributesItem build() { - return new TargetResourceAdditionalTargetAttributesItem(this); - } - - /** - * Set the name. - * - * @param name the name - * @return the TargetResourceAdditionalTargetAttributesItem builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the value. - * - * @param value the value - * @return the TargetResourceAdditionalTargetAttributesItem builder - */ - public Builder value(String value) { - this.value = value; - return this; - } - - /** - * Set the operator. - * - * @param operator the operator - * @return the TargetResourceAdditionalTargetAttributesItem builder - */ - public Builder operator(String operator) { - this.operator = operator; - return this; - } - } - - protected TargetResourceAdditionalTargetAttributesItem(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, - "name cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.value, - "value cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operator, - "operator cannot be null"); - name = builder.name; - value = builder.value; - operator = builder.operator; - } - - /** - * New builder. - * - * @return a TargetResourceAdditionalTargetAttributesItem builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the name. - * - * The name of the additional attribute that you want to use to further qualify the target. - * - * Options differ depending on the service or resource that you are targeting with a rule or template. For more - * information, refer to the service documentation. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the value. - * - * The value that you want to apply to `name` field. - * - * Options differ depending on the rule or template that you configure. For more information, refer to the service - * documentation. - * - * @return the value - */ - public String value() { - return value; - } - - /** - * Gets the operator. - * - * The way in which the `name` field is compared to its value. - * - * There are three types of operators: string, numeric, and boolean. - * - * @return the operator - */ - public String operator() { - return operator; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachment.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachment.java deleted file mode 100644 index 48aab276..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachment.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The scopes to attach to a template. - */ -public class TemplateAttachment extends GenericModel { - - @SerializedName("attachment_id") - protected String attachmentId; - @SerializedName("template_id") - protected String templateId; - @SerializedName("account_id") - protected String accountId; - @SerializedName("included_scope") - protected TemplateScope includedScope; - @SerializedName("excluded_scopes") - protected List excludedScopes; - - /** - * Gets the attachmentId. - * - * The UUID that uniquely identifies the attachment. - * - * @return the attachmentId - */ - public String getAttachmentId() { - return attachmentId; - } - - /** - * Gets the templateId. - * - * The UUID that uniquely identifies the template. - * - * @return the templateId - */ - public String getTemplateId() { - return templateId; - } - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String getAccountId() { - return accountId; - } - - /** - * Gets the includedScope. - * - * The extent at which the template can be attached across your accounts. - * - * @return the includedScope - */ - public TemplateScope getIncludedScope() { - return includedScope; - } - - /** - * Gets the excludedScopes. - * - * @return the excludedScopes - */ - public List getExcludedScopes() { - return excludedScopes; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScope.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScope.java deleted file mode 100644 index 86cb3bb8..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScope.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The extent at which the template can be attached across your accounts. - */ -public class TemplateScope extends GenericModel { - - /** - * The type of scope. - */ - public interface ScopeType { - /** enterprise. */ - String ENTERPRISE = "enterprise"; - /** enterprise.account_group. */ - String ENTERPRISE_ACCOUNT_GROUP = "enterprise.account_group"; - /** enterprise.account. */ - String ENTERPRISE_ACCOUNT = "enterprise.account"; - /** account. */ - String ACCOUNT = "account"; - /** account.resource_group. */ - String ACCOUNT_RESOURCE_GROUP = "account.resource_group"; - } - - protected String note; - @SerializedName("scope_id") - protected String scopeId; - @SerializedName("scope_type") - protected String scopeType; - - /** - * Gets the note. - * - * A short description or alias to assign to the scope. - * - * @return the note - */ - public String getNote() { - return note; - } - - /** - * Gets the scopeId. - * - * The ID of the scope, such as an enterprise, account, or account group, where you want to apply the customized - * defaults that are associated with a template. - * - * @return the scopeId - */ - public String getScopeId() { - return scopeId; - } - - /** - * Gets the scopeType. - * - * The type of scope. - * - * @return the scopeType - */ - public String getScopeType() { - return scopeType; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptions.java deleted file mode 100644 index 970d1750..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptions.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The updateRuleAttachment options. - */ -public class UpdateRuleAttachmentOptions extends GenericModel { - - protected String ruleId; - protected String attachmentId; - protected String ifMatch; - protected String accountId; - protected RuleScope includedScope; - protected List excludedScopes; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private String attachmentId; - private String ifMatch; - private String accountId; - private RuleScope includedScope; - private List excludedScopes; - private String transactionId; - - private Builder(UpdateRuleAttachmentOptions updateRuleAttachmentOptions) { - this.ruleId = updateRuleAttachmentOptions.ruleId; - this.attachmentId = updateRuleAttachmentOptions.attachmentId; - this.ifMatch = updateRuleAttachmentOptions.ifMatch; - this.accountId = updateRuleAttachmentOptions.accountId; - this.includedScope = updateRuleAttachmentOptions.includedScope; - this.excludedScopes = updateRuleAttachmentOptions.excludedScopes; - this.transactionId = updateRuleAttachmentOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - * @param attachmentId the attachmentId - * @param ifMatch the ifMatch - * @param accountId the accountId - * @param includedScope the includedScope - */ - public Builder(String ruleId, String attachmentId, String ifMatch, String accountId, RuleScope includedScope) { - this.ruleId = ruleId; - this.attachmentId = attachmentId; - this.ifMatch = ifMatch; - this.accountId = accountId; - this.includedScope = includedScope; - } - - /** - * Builds a UpdateRuleAttachmentOptions. - * - * @return the new UpdateRuleAttachmentOptions instance - */ - public UpdateRuleAttachmentOptions build() { - return new UpdateRuleAttachmentOptions(this); - } - - /** - * Adds an excludedScope to excludedScopes. - * - * @param excludedScope the new excludedScope - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder addExcludedScope(RuleScope excludedScope) { - com.ibm.cloud.sdk.core.util.Validator.notNull(excludedScope, - "excludedScope cannot be null"); - if (this.excludedScopes == null) { - this.excludedScopes = new ArrayList(); - } - this.excludedScopes.add(excludedScope); - return this; - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the attachmentId. - * - * @param attachmentId the attachmentId - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder attachmentId(String attachmentId) { - this.attachmentId = attachmentId; - return this; - } - - /** - * Set the ifMatch. - * - * @param ifMatch the ifMatch - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder ifMatch(String ifMatch) { - this.ifMatch = ifMatch; - return this; - } - - /** - * Set the accountId. - * - * @param accountId the accountId - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Set the includedScope. - * - * @param includedScope the includedScope - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder includedScope(RuleScope includedScope) { - this.includedScope = includedScope; - return this; - } - - /** - * Set the excludedScopes. - * Existing excludedScopes will be replaced. - * - * @param excludedScopes the excludedScopes - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder excludedScopes(List excludedScopes) { - this.excludedScopes = excludedScopes; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the UpdateRuleAttachmentOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected UpdateRuleAttachmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, - "attachmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.ifMatch, - "ifMatch cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.accountId, - "accountId cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.includedScope, - "includedScope cannot be null"); - ruleId = builder.ruleId; - attachmentId = builder.attachmentId; - ifMatch = builder.ifMatch; - accountId = builder.accountId; - includedScope = builder.includedScope; - excludedScopes = builder.excludedScopes; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a UpdateRuleAttachmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the attachmentId. - * - * The UUID that uniquely identifies the attachment. - * - * @return the attachmentId - */ - public String attachmentId() { - return attachmentId; - } - - /** - * Gets the ifMatch. - * - * Compares a supplied `Etag` value with the version that is stored for the requested resource. If the values match, - * the server allows the request method to continue. - * - * To find the `Etag` value, run a GET request on the resource that you want to modify, and check the response - * headers. - * - * @return the ifMatch - */ - public String ifMatch() { - return ifMatch; - } - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String accountId() { - return accountId; - } - - /** - * Gets the includedScope. - * - * The extent at which the rule can be attached across your accounts. - * - * @return the includedScope - */ - public RuleScope includedScope() { - return includedScope; - } - - /** - * Gets the excludedScopes. - * - * The extent at which the rule can be excluded from the included scope. - * - * @return the excludedScopes - */ - public List excludedScopes() { - return excludedScopes; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptions.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptions.java deleted file mode 100644 index b9d6400f..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptions.java +++ /dev/null @@ -1,435 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import java.util.ArrayList; -import java.util.List; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * The updateRule options. - */ -public class UpdateRuleOptions extends GenericModel { - - /** - * The type of rule. Rules that you create are `user_defined`. - */ - public interface RuleType { - /** user_defined. */ - String USER_DEFINED = "user_defined"; - } - - protected String ruleId; - protected String ifMatch; - protected String name; - protected String description; - protected TargetResource target; - protected RuleRequiredConfig requiredConfig; - protected List enforcementActions; - protected String accountId; - protected String ruleType; - protected List labels; - protected String transactionId; - - /** - * Builder. - */ - public static class Builder { - private String ruleId; - private String ifMatch; - private String name; - private String description; - private TargetResource target; - private RuleRequiredConfig requiredConfig; - private List enforcementActions; - private String accountId; - private String ruleType; - private List labels; - private String transactionId; - - private Builder(UpdateRuleOptions updateRuleOptions) { - this.ruleId = updateRuleOptions.ruleId; - this.ifMatch = updateRuleOptions.ifMatch; - this.name = updateRuleOptions.name; - this.description = updateRuleOptions.description; - this.target = updateRuleOptions.target; - this.requiredConfig = updateRuleOptions.requiredConfig; - this.enforcementActions = updateRuleOptions.enforcementActions; - this.accountId = updateRuleOptions.accountId; - this.ruleType = updateRuleOptions.ruleType; - this.labels = updateRuleOptions.labels; - this.transactionId = updateRuleOptions.transactionId; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param ruleId the ruleId - * @param ifMatch the ifMatch - * @param name the name - * @param description the description - * @param target the target - * @param requiredConfig the requiredConfig - * @param enforcementActions the enforcementActions - */ - public Builder(String ruleId, String ifMatch, String name, String description, TargetResource target, RuleRequiredConfig requiredConfig, List enforcementActions) { - this.ruleId = ruleId; - this.ifMatch = ifMatch; - this.name = name; - this.description = description; - this.target = target; - this.requiredConfig = requiredConfig; - this.enforcementActions = enforcementActions; - } - - /** - * Builds a UpdateRuleOptions. - * - * @return the new UpdateRuleOptions instance - */ - public UpdateRuleOptions build() { - return new UpdateRuleOptions(this); - } - - /** - * Adds an enforcementAction to enforcementActions. - * - * @param enforcementAction the new enforcementAction - * @return the UpdateRuleOptions builder - */ - public Builder addEnforcementAction(EnforcementAction enforcementAction) { - com.ibm.cloud.sdk.core.util.Validator.notNull(enforcementAction, - "enforcementAction cannot be null"); - if (this.enforcementActions == null) { - this.enforcementActions = new ArrayList(); - } - this.enforcementActions.add(enforcementAction); - return this; - } - - /** - * Adds an label to labels. - * - * @param label the new label - * @return the UpdateRuleOptions builder - */ - public Builder addLabel(String label) { - com.ibm.cloud.sdk.core.util.Validator.notNull(label, - "label cannot be null"); - if (this.labels == null) { - this.labels = new ArrayList(); - } - this.labels.add(label); - return this; - } - - /** - * Set the ruleId. - * - * @param ruleId the ruleId - * @return the UpdateRuleOptions builder - */ - public Builder ruleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Set the ifMatch. - * - * @param ifMatch the ifMatch - * @return the UpdateRuleOptions builder - */ - public Builder ifMatch(String ifMatch) { - this.ifMatch = ifMatch; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the UpdateRuleOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the UpdateRuleOptions builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the target. - * - * @param target the target - * @return the UpdateRuleOptions builder - */ - public Builder target(TargetResource target) { - this.target = target; - return this; - } - - /** - * Set the requiredConfig. - * - * @param requiredConfig the requiredConfig - * @return the UpdateRuleOptions builder - */ - public Builder requiredConfig(RuleRequiredConfig requiredConfig) { - this.requiredConfig = requiredConfig; - return this; - } - - /** - * Set the enforcementActions. - * Existing enforcementActions will be replaced. - * - * @param enforcementActions the enforcementActions - * @return the UpdateRuleOptions builder - */ - public Builder enforcementActions(List enforcementActions) { - this.enforcementActions = enforcementActions; - return this; - } - - /** - * Set the accountId. - * - * @param accountId the accountId - * @return the UpdateRuleOptions builder - */ - public Builder accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Set the ruleType. - * - * @param ruleType the ruleType - * @return the UpdateRuleOptions builder - */ - public Builder ruleType(String ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Set the labels. - * Existing labels will be replaced. - * - * @param labels the labels - * @return the UpdateRuleOptions builder - */ - public Builder labels(List labels) { - this.labels = labels; - return this; - } - - /** - * Set the transactionId. - * - * @param transactionId the transactionId - * @return the UpdateRuleOptions builder - */ - public Builder transactionId(String transactionId) { - this.transactionId = transactionId; - return this; - } - } - - protected UpdateRuleOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, - "ruleId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.ifMatch, - "ifMatch cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, - "name cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.description, - "description cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, - "target cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.requiredConfig, - "requiredConfig cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.enforcementActions, - "enforcementActions cannot be null"); - ruleId = builder.ruleId; - ifMatch = builder.ifMatch; - name = builder.name; - description = builder.description; - target = builder.target; - requiredConfig = builder.requiredConfig; - enforcementActions = builder.enforcementActions; - accountId = builder.accountId; - ruleType = builder.ruleType; - labels = builder.labels; - transactionId = builder.transactionId; - } - - /** - * New builder. - * - * @return a UpdateRuleOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ruleId. - * - * The UUID that uniquely identifies the rule. - * - * @return the ruleId - */ - public String ruleId() { - return ruleId; - } - - /** - * Gets the ifMatch. - * - * Compares a supplied `Etag` value with the version that is stored for the requested resource. If the values match, - * the server allows the request method to continue. - * - * To find the `Etag` value, run a GET request on the resource that you want to modify, and check the response - * headers. - * - * @return the ifMatch - */ - public String ifMatch() { - return ifMatch; - } - - /** - * Gets the name. - * - * A human-readable alias to assign to your rule. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - * An extended description of your rule. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the target. - * - * The properties that describe the resource that you want to target - * with the rule or template. - * - * @return the target - */ - public TargetResource target() { - return target; - } - - /** - * Gets the requiredConfig. - * - * @return the requiredConfig - */ - public RuleRequiredConfig requiredConfig() { - return requiredConfig; - } - - /** - * Gets the enforcementActions. - * - * The actions that the service must run on your behalf when a request to create or modify the target resource does - * not comply with your conditions. - * - * @return the enforcementActions - */ - public List enforcementActions() { - return enforcementActions; - } - - /** - * Gets the accountId. - * - * Your IBM Cloud account ID. - * - * @return the accountId - */ - public String accountId() { - return accountId; - } - - /** - * Gets the ruleType. - * - * The type of rule. Rules that you create are `user_defined`. - * - * @return the ruleType - */ - public String ruleType() { - return ruleType; - } - - /** - * Gets the labels. - * - * Labels that you can use to group and search for similar rules, such as those that help you to meet a specific - * organization guideline. - * - * @return the labels - */ - public List labels() { - return labels; - } - - /** - * Gets the transactionId. - * - * The unique identifier that is used to trace an entire request. If you omit this field, the service generates and - * sends a transaction ID as a response header of the request. In the case of an error, the transaction ID is set in - * the `trace` field of the response body. - * - * **Note:** To help with debugging logs, it is strongly recommended that you generate and supply a `Transaction-Id` - * with each request. - * - * @return the transactionId - */ - public String transactionId() { - return transactionId; - } -} - diff --git a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/package-info.java b/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/package-info.java deleted file mode 100644 index 95f33e7a..00000000 --- a/modules/configuration-governance/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -/** - * Configuration Governance API v1. - */ -package com.ibm.cloud.scc.configuration_governance.v1; diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceIT.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceIT.java deleted file mode 100644 index c335aa31..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceIT.java +++ /dev/null @@ -1,496 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.Link; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleCondition; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionAndLvl2; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionOrLvl2; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfig; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultipleProperties; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultiplePropertiesConditionAnd; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultiplePropertiesConditionOr; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleResponseError; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateScope; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.scc.test.SdkIntegrationTestBase; -import com.ibm.cloud.sdk.core.http.Response; -import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.CredentialUtils; -import com.ibm.cloud.sdk.core.util.DateUtils; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Integration test class for the ConfigurationGovernance service. - */ -public class ConfigurationGovernanceIT extends SdkIntegrationTestBase { - public ConfigurationGovernance service = null; - public static Map config = null; - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - // Globlal variables to hold link values - String ruleAttachmentIdLink = null; - String ruleIdLink = null; - String ruleAttachmentEtag = null; - String ruleEtag = null; - - /** - * This method provides our config filename to the base class. - */ - - final String accountID = System.getenv("ACCOUNT_ID"); - String ruleLabel = System.getenv("RULE_LABEL"); - final String testString = "testString"; - String resourceGroupID = System.getenv("RESOURCE_GROUP_ID"); - String identifier = "jv-"+(System.currentTimeMillis()/1000); - - public String getConfigFilename() { - return "../../configuration_governance_v1.env"; - } - - @BeforeClass - public void constructService() { - - if (ruleLabel==null){ - ruleLabel = "sdk-it"; - } - - // Ask super if we should skip the tests. - if (skipTests()) { - return; - } - - service = ConfigurationGovernance.newInstance(); - assertNotNull(service); - assertNotNull(service.getServiceUrl()); - - // Load up our test-specific config properties. - config = CredentialUtils.getServiceProperties(ConfigurationGovernance.DEFAULT_SERVICE_NAME); - assertNotNull(config); - assertFalse(config.isEmpty()); - assertEquals(service.getServiceUrl(), config.get("URL")); - - System.out.println("Setup complete."); - } - - @Test - public void testCreateRules() throws Exception { - try { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .build(); - - RuleConditionSingleProperty ruleConditionModel = new RuleConditionSingleProperty.Builder() - .description(testString) - .property("location") - .operator("string_equals") - .value("us-south") - .build(); - - RuleRequiredConfigMultiplePropertiesConditionAnd ruleRequiredConfigModel = new RuleRequiredConfigMultiplePropertiesConditionAnd.Builder() - .description("Public access check") - .and(new java.util.ArrayList(java.util.Arrays.asList(ruleConditionModel))) - .build(); - - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - - RuleRequest ruleRequestModel = new RuleRequest.Builder() - .accountId(accountID) - .name("Disable public access") - .description("Ensure that public access to account resources is disabled.") - .ruleType("user_defined") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .labels(new java.util.ArrayList(java.util.Arrays.asList(ruleLabel+"-"+identifier))) - .build(); - - CreateRuleRequest createRuleRequestModel = new CreateRuleRequest.Builder() - .requestId("3cebc877-58e7-44a5-a292-32114fa73558") - .rule(ruleRequestModel) - .build(); - - CreateRulesOptions createRulesOptions = new CreateRulesOptions.Builder() - .rules(new java.util.ArrayList(java.util.Arrays.asList(createRuleRequestModel))) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.createRules(createRulesOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - CreateRulesResponse createRulesResponseResult = response.getResult(); - - assertNotNull(createRulesResponseResult); - ruleIdLink = createRulesResponseResult.getRules().get(0).getRule().getRuleId(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateRules" }) - public void testCreateRuleAttachments() throws Exception { - try { - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("My account") - .scopeId(accountID) - .scopeType("account") - .build(); - - RuleScope excludedRuleScope = new RuleScope.Builder() - .note("My account resource group") - .scopeId(resourceGroupID) - .scopeType("account.resource_group") - .build(); - - RuleAttachmentRequest ruleAttachmentRequestModel = new RuleAttachmentRequest.Builder() - .accountId(accountID) - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(excludedRuleScope))) - .build(); - - CreateRuleAttachmentsOptions createRuleAttachmentsOptions = new CreateRuleAttachmentsOptions.Builder() - .ruleId(ruleIdLink) - .attachments(new java.util.ArrayList(java.util.Arrays.asList(ruleAttachmentRequestModel))) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.createRuleAttachments(createRuleAttachmentsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - CreateRuleAttachmentsResponse createRuleAttachmentsResponseResult = response.getResult(); - - assertNotNull(createRuleAttachmentsResponseResult); - ruleAttachmentIdLink = createRuleAttachmentsResponseResult.getAttachments().get(0).getAttachmentId(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test - public void testListRules() throws Exception { - try { - ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() - .accountId(accountID) - .transactionId(testString) - .attached(true) - .labels(ruleLabel+"-"+identifier) - .scopes("scope_id") - .limit(Long.valueOf("1000")) - .offset(Long.valueOf("26")) - .build(); - - // Invoke operation - Response response = service.listRules(listRulesOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - RuleList ruleListResult = response.getResult(); - - assertNotNull(ruleListResult); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateRules" }) - public void testGetRule() throws Exception { - try { - GetRuleOptions getRuleOptions = new GetRuleOptions.Builder() - .ruleId(ruleIdLink) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.getRule(getRuleOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - Rule ruleResult = response.getResult(); - - assertNotNull(ruleResult); - - ruleEtag = response.getHeaders().values("etag").get(0); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateRules" }) - public void testUpdateRule() throws Exception { - try { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - - RuleRequiredConfigSingleProperty ruleRequiredConfigModel = new RuleRequiredConfigSingleProperty.Builder() - .description(testString) - .property("location") - .operator("string_equals") - .value("eu-gb") - .build(); - - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - - UpdateRuleOptions updateRuleOptions = new UpdateRuleOptions.Builder() - .ruleId(ruleIdLink) - .ifMatch(ruleEtag) - .name("Disable public access") - .description("Ensure that public access to account resources is disabled.") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .accountId(accountID) - .ruleType("user_defined") - .labels(new java.util.ArrayList(java.util.Arrays.asList(ruleLabel+"-"+identifier))) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.updateRule(updateRuleOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - Rule ruleResult = response.getResult(); - - assertNotNull(ruleResult); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateRules" }) - public void testListRuleAttachments() throws Exception { - try { - ListRuleAttachmentsOptions listRuleAttachmentsOptions = new ListRuleAttachmentsOptions.Builder() - .ruleId(ruleIdLink) - .transactionId(testString) - .limit(Long.valueOf("1000")) - .offset(Long.valueOf("26")) - .build(); - - // Invoke operation - Response response = service.listRuleAttachments(listRuleAttachmentsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - RuleAttachmentList ruleAttachmentListResult = response.getResult(); - - assertNotNull(ruleAttachmentListResult); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateRuleAttachments", "testCreateRules" }) - public void testGetRuleAttachment() throws Exception { - try { - GetRuleAttachmentOptions getRuleAttachmentOptions = new GetRuleAttachmentOptions.Builder() - .ruleId(ruleIdLink) - .attachmentId(ruleAttachmentIdLink) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.getRuleAttachment(getRuleAttachmentOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - RuleAttachment ruleAttachmentResult = response.getResult(); - - assertNotNull(ruleAttachmentResult); - - ruleAttachmentEtag = response.getHeaders().values("etag").get(0); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateRuleAttachments", "testCreateRules" }) - public void testUpdateRuleAttachment() throws Exception { - try { - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("My account") - .scopeId(accountID) - .scopeType("account") - .build(); - - RuleScope excludedRuleScopeModel = new RuleScope.Builder() - .note("My account resource group") - .scopeId(resourceGroupID) - .scopeType("account.resource_group") - .build(); - - UpdateRuleAttachmentOptions updateRuleAttachmentOptions = new UpdateRuleAttachmentOptions.Builder() - .ruleId(ruleIdLink) - .attachmentId(ruleAttachmentIdLink) - .ifMatch(ruleAttachmentEtag) - .accountId(accountID) - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(excludedRuleScopeModel))) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.updateRuleAttachment(updateRuleAttachmentOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - TemplateAttachment templateAttachmentResult = response.getResult(); - - assertNotNull(templateAttachmentResult); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateRuleAttachments", "testCreateRules", "testGetRuleAttachment", "testListRuleAttachments", "testGetRule", "testListRules" }) - public void testDeleteRuleAttachment() throws Exception { - try { - DeleteRuleAttachmentOptions deleteRuleAttachmentOptions = new DeleteRuleAttachmentOptions.Builder() - .ruleId(ruleIdLink) - .attachmentId(ruleAttachmentIdLink) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.deleteRuleAttachment(deleteRuleAttachmentOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testDeleteRuleAttachment", "testCreateRules", "testGetRule", "testListRules" }) - public void testDeleteRule() throws Exception { - try { - DeleteRuleOptions deleteRuleOptions = new DeleteRuleOptions.Builder() - .ruleId(ruleIdLink) - .transactionId(testString) - .build(); - - // Invoke operation - Response response = service.deleteRule(deleteRuleOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @AfterClass - public void tearDown() { - service = ConfigurationGovernance.newInstance(); - config = CredentialUtils.getServiceProperties(ConfigurationGovernance.DEFAULT_SERVICE_NAME); - System.out.println("Setup up complete."); - - System.out.println(String.format("cleaning up account: %s with rules labelled %s", accountID, ruleLabel)); - - ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() - .accountId(accountID) - .labels(ruleLabel+"-"+identifier) - .build(); - - Response rules = service.listRules(listRulesOptions).execute(); - for(Rule rule: rules.getResult().getRules()) { - DeleteRuleOptions deleteRuleOptions = new DeleteRuleOptions.Builder() - .ruleId(rule.getRuleId()) - .build(); - - service.deleteRule(deleteRuleOptions); - } - System.out.println("cleanup was successful"); - } - } diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceTest.java deleted file mode 100644 index 653f65f3..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceTest.java +++ /dev/null @@ -1,781 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1; - -import com.ibm.cloud.scc.configuration_governance.v1.ConfigurationGovernance; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.Link; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleCondition; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionAndLvl2; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionOrLvl2; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfig; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultipleProperties; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultiplePropertiesConditionAnd; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultiplePropertiesConditionOr; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleResponseError; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateScope; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.http.Response; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.cloud.sdk.core.util.EnvironmentUtils; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.testng.PowerMockTestCase; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the ConfigurationGovernance service. - */ -@PrepareForTest({ EnvironmentUtils.class }) -@PowerMockIgnore({"javax.net.ssl.*", "org.mockito.*"}) -public class ConfigurationGovernanceTest extends PowerMockTestCase { - - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - protected MockWebServer server; - protected ConfigurationGovernance configurationGovernanceService; - - // Creates a mock set of environment variables that are returned by EnvironmentUtils.getenv(). - private Map getTestProcessEnvironment() { - Map env = new HashMap<>(); - env.put("TESTSERVICE_AUTH_TYPE", "noAuth"); - return env; - } - - public void constructClientService() throws Throwable { - PowerMockito.spy(EnvironmentUtils.class); - PowerMockito.when(EnvironmentUtils.getenv()).thenReturn(getTestProcessEnvironment()); - final String serviceName = "testService"; - - configurationGovernanceService = ConfigurationGovernance.newInstance(serviceName); - String url = server.url("/").toString(); - configurationGovernanceService.setServiceUrl(url); - } - - /** - * Negative Test - construct the service with a null authenticator. - */ - @Test(expectedExceptions = IllegalArgumentException.class) - public void testConstructorWithNullAuthenticator() throws Throwable { - final String serviceName = "testService"; - - new ConfigurationGovernance(serviceName, null); - } - - @Test - public void testCreateRulesWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"rules\": [{\"request_id\": \"3cebc877-58e7-44a5-a292-32114fa73558\", \"status_code\": 201, \"rule\": {\"account_id\": \"accountId\", \"name\": \"name\", \"description\": \"description\", \"rule_type\": \"user_defined\", \"target\": {\"service_name\": \"cloud-object-storage\", \"resource_kind\": \"bucket\", \"additional_target_attributes\": [{\"name\": \"name\", \"value\": \"value\", \"operator\": \"string_equals\"}]}, \"required_config\": {\"description\": \"description\", \"property\": \"public_access_enabled\", \"operator\": \"is_true\", \"value\": \"value\"}, \"enforcement_actions\": [{\"action\": \"audit_log\"}], \"labels\": [\"label\"], \"rule_id\": \"rule-81f3db5e-f9db-4c46-9de3-a4a76e66adbf\", \"creation_date\": \"2020-01-10T05:23:19.000Z\", \"created_by\": \"createdBy\", \"modification_date\": \"2020-01-10T05:23:19.000Z\", \"modified_by\": \"modifiedBy\", \"number_of_attachments\": 3}, \"errors\": [{\"code\": \"bad_request\", \"message\": \"The rule is missing an account ID\"}], \"trace\": \"861263b4-cee3-4514-8d8c-05d17308e6eb\"}]}"; - String createRulesPath = "/config/v1/rules"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the TargetResourceAdditionalTargetAttributesItem model - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - - // Construct an instance of the TargetResource model - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("iam-groups") - .resourceKind("service") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - - // Construct an instance of the RuleConditionSingleProperty model - RuleConditionSingleProperty ruleConditionModel = new RuleConditionSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_false") - .value("testString") - .build(); - - // Construct an instance of the RuleRequiredConfigMultiplePropertiesConditionAnd model - RuleRequiredConfigMultiplePropertiesConditionAnd ruleRequiredConfigModel = new RuleRequiredConfigMultiplePropertiesConditionAnd.Builder() - .description("Public access check") - .and(new java.util.ArrayList(java.util.Arrays.asList(ruleConditionModel))) - .build(); - - // Construct an instance of the EnforcementAction model - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - - // Construct an instance of the RuleRequest model - RuleRequest ruleRequestModel = new RuleRequest.Builder() - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .name("Disable public access") - .description("Ensure that public access to account resources is disabled.") - .ruleType("user_defined") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .labels(new java.util.ArrayList(java.util.Arrays.asList("Access", "IAM"))) - .build(); - - // Construct an instance of the CreateRuleRequest model - CreateRuleRequest createRuleRequestModel = new CreateRuleRequest.Builder() - .requestId("3cebc877-58e7-44a5-a292-32114fa73558") - .rule(ruleRequestModel) - .build(); - - // Construct an instance of the CreateRulesOptions model - CreateRulesOptions createRulesOptionsModel = new CreateRulesOptions.Builder() - .rules(new java.util.ArrayList(java.util.Arrays.asList(createRuleRequestModel))) - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.createRules(createRulesOptionsModel).execute(); - assertNotNull(response); - CreateRulesResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createRulesPath); - } - - // Test the createRules operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateRulesNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.createRules(null).execute(); - } - - @Test - public void testListRulesWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"offset\": 6, \"limit\": 1000, \"total_count\": 10, \"first\": {\"href\": \"href\"}, \"last\": {\"href\": \"href\"}, \"rules\": [{\"account_id\": \"accountId\", \"name\": \"name\", \"description\": \"description\", \"rule_type\": \"user_defined\", \"target\": {\"service_name\": \"cloud-object-storage\", \"resource_kind\": \"bucket\", \"additional_target_attributes\": [{\"name\": \"name\", \"value\": \"value\", \"operator\": \"string_equals\"}]}, \"required_config\": {\"description\": \"description\", \"property\": \"public_access_enabled\", \"operator\": \"is_true\", \"value\": \"value\"}, \"enforcement_actions\": [{\"action\": \"audit_log\"}], \"labels\": [\"label\"], \"rule_id\": \"rule-81f3db5e-f9db-4c46-9de3-a4a76e66adbf\", \"creation_date\": \"2020-01-10T05:23:19.000Z\", \"created_by\": \"createdBy\", \"modification_date\": \"2020-01-10T05:23:19.000Z\", \"modified_by\": \"modifiedBy\", \"number_of_attachments\": 3}]}"; - String listRulesPath = "/config/v1/rules"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the ListRulesOptions model - ListRulesOptions listRulesOptionsModel = new ListRulesOptions.Builder() - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .transactionId("testString") - .attached(true) - .labels("SOC2,ITCS300") - .scopes("scope_id") - .limit(Long.valueOf("1000")) - .offset(Long.valueOf("26")) - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.listRules(listRulesOptionsModel).execute(); - assertNotNull(response); - RuleList responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - // Get query params - assertEquals(query.get("account_id"), "531fc3e28bfc43c5a2cea07786d93f5c"); - assertEquals(Boolean.valueOf(query.get("attached")), Boolean.valueOf(true)); - assertEquals(query.get("labels"), "SOC2,ITCS300"); - assertEquals(query.get("scopes"), "scope_id"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1000")); - assertEquals(Long.valueOf(query.get("offset")), Long.valueOf("26")); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listRulesPath); - } - - // Test the listRules operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListRulesNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.listRules(null).execute(); - } - - @Test - public void testGetRuleWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"account_id\": \"accountId\", \"name\": \"name\", \"description\": \"description\", \"rule_type\": \"user_defined\", \"target\": {\"service_name\": \"cloud-object-storage\", \"resource_kind\": \"bucket\", \"additional_target_attributes\": [{\"name\": \"name\", \"value\": \"value\", \"operator\": \"string_equals\"}]}, \"required_config\": {\"description\": \"description\", \"property\": \"public_access_enabled\", \"operator\": \"is_true\", \"value\": \"value\"}, \"enforcement_actions\": [{\"action\": \"audit_log\"}], \"labels\": [\"label\"], \"rule_id\": \"rule-81f3db5e-f9db-4c46-9de3-a4a76e66adbf\", \"creation_date\": \"2020-01-10T05:23:19.000Z\", \"created_by\": \"createdBy\", \"modification_date\": \"2020-01-10T05:23:19.000Z\", \"modified_by\": \"modifiedBy\", \"number_of_attachments\": 3}"; - String getRulePath = "/config/v1/rules/testString"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the GetRuleOptions model - GetRuleOptions getRuleOptionsModel = new GetRuleOptions.Builder() - .ruleId("testString") - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.getRule(getRuleOptionsModel).execute(); - assertNotNull(response); - Rule responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getRulePath); - } - - // Test the getRule operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetRuleNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.getRule(null).execute(); - } - - @Test - public void testUpdateRuleWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"account_id\": \"accountId\", \"name\": \"name\", \"description\": \"description\", \"rule_type\": \"user_defined\", \"target\": {\"service_name\": \"cloud-object-storage\", \"resource_kind\": \"bucket\", \"additional_target_attributes\": [{\"name\": \"name\", \"value\": \"value\", \"operator\": \"string_equals\"}]}, \"required_config\": {\"description\": \"description\", \"property\": \"public_access_enabled\", \"operator\": \"is_true\", \"value\": \"value\"}, \"enforcement_actions\": [{\"action\": \"audit_log\"}], \"labels\": [\"label\"], \"rule_id\": \"rule-81f3db5e-f9db-4c46-9de3-a4a76e66adbf\", \"creation_date\": \"2020-01-10T05:23:19.000Z\", \"created_by\": \"createdBy\", \"modification_date\": \"2020-01-10T05:23:19.000Z\", \"modified_by\": \"modifiedBy\", \"number_of_attachments\": 3}"; - String updateRulePath = "/config/v1/rules/testString"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the TargetResourceAdditionalTargetAttributesItem model - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("testString") - .value("testString") - .operator("string_equals") - .build(); - - // Construct an instance of the TargetResource model - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("iam-groups") - .resourceKind("service") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - - // Construct an instance of the RuleRequiredConfigSingleProperty model - RuleRequiredConfigSingleProperty ruleRequiredConfigModel = new RuleRequiredConfigSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_false") - .value("testString") - .build(); - - // Construct an instance of the EnforcementAction model - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("audit_log") - .build(); - - // Construct an instance of the UpdateRuleOptions model - UpdateRuleOptions updateRuleOptionsModel = new UpdateRuleOptions.Builder() - .ruleId("testString") - .ifMatch("testString") - .name("Disable public access") - .description("Ensure that public access to account resources is disabled.") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .ruleType("user_defined") - .labels(new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))) - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.updateRule(updateRuleOptionsModel).execute(); - assertNotNull(response); - Rule responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - assertEquals(request.getHeader("If-Match"), "testString"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateRulePath); - } - - // Test the updateRule operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateRuleNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.updateRule(null).execute(); - } - - @Test - public void testDeleteRuleWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = ""; - String deleteRulePath = "/config/v1/rules/testString"; - - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the DeleteRuleOptions model - DeleteRuleOptions deleteRuleOptionsModel = new DeleteRuleOptions.Builder() - .ruleId("testString") - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.deleteRule(deleteRuleOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - // Response does not have a return type. Check that the result is null. - assertNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteRulePath); - } - - // Test the deleteRule operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteRuleNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.deleteRule(null).execute(); - } - - @Test - public void testCreateRuleAttachmentsWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"attachments\": [{\"attachment_id\": \"attachment-fc7b9a77-1c85-406c-b346-f3f5bb9aa7e2\", \"rule_id\": \"rule-81f3db5e-f9db-4c46-9de3-a4a76e66adbf\", \"account_id\": \"accountId\", \"included_scope\": {\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}, \"excluded_scopes\": [{\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}]}]}"; - String createRuleAttachmentsPath = "/config/v1/rules/testString/attachments"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the RuleScope model - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("My enterprise") - .scopeId("282cf433ac91493ba860480d92519990") - .scopeType("enterprise") - .build(); - - // Construct an instance of the RuleAttachmentRequest model - RuleAttachmentRequest ruleAttachmentRequestModel = new RuleAttachmentRequest.Builder() - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))) - .build(); - - // Construct an instance of the CreateRuleAttachmentsOptions model - CreateRuleAttachmentsOptions createRuleAttachmentsOptionsModel = new CreateRuleAttachmentsOptions.Builder() - .ruleId("testString") - .attachments(new java.util.ArrayList(java.util.Arrays.asList(ruleAttachmentRequestModel))) - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.createRuleAttachments(createRuleAttachmentsOptionsModel).execute(); - assertNotNull(response); - CreateRuleAttachmentsResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createRuleAttachmentsPath); - } - - // Test the createRuleAttachments operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateRuleAttachmentsNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.createRuleAttachments(null).execute(); - } - - @Test - public void testListRuleAttachmentsWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"offset\": 6, \"limit\": 1000, \"total_count\": 10, \"first\": {\"href\": \"href\"}, \"last\": {\"href\": \"href\"}, \"attachments\": [{\"attachment_id\": \"attachment-fc7b9a77-1c85-406c-b346-f3f5bb9aa7e2\", \"rule_id\": \"rule-81f3db5e-f9db-4c46-9de3-a4a76e66adbf\", \"account_id\": \"accountId\", \"included_scope\": {\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}, \"excluded_scopes\": [{\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}]}]}"; - String listRuleAttachmentsPath = "/config/v1/rules/testString/attachments"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the ListRuleAttachmentsOptions model - ListRuleAttachmentsOptions listRuleAttachmentsOptionsModel = new ListRuleAttachmentsOptions.Builder() - .ruleId("testString") - .transactionId("testString") - .limit(Long.valueOf("1000")) - .offset(Long.valueOf("26")) - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.listRuleAttachments(listRuleAttachmentsOptionsModel).execute(); - assertNotNull(response); - RuleAttachmentList responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - // Get query params - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("1000")); - assertEquals(Long.valueOf(query.get("offset")), Long.valueOf("26")); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listRuleAttachmentsPath); - } - - // Test the listRuleAttachments operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListRuleAttachmentsNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.listRuleAttachments(null).execute(); - } - - @Test - public void testGetRuleAttachmentWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"attachment_id\": \"attachment-fc7b9a77-1c85-406c-b346-f3f5bb9aa7e2\", \"rule_id\": \"rule-81f3db5e-f9db-4c46-9de3-a4a76e66adbf\", \"account_id\": \"accountId\", \"included_scope\": {\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}, \"excluded_scopes\": [{\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}]}"; - String getRuleAttachmentPath = "/config/v1/rules/testString/attachments/testString"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the GetRuleAttachmentOptions model - GetRuleAttachmentOptions getRuleAttachmentOptionsModel = new GetRuleAttachmentOptions.Builder() - .ruleId("testString") - .attachmentId("testString") - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.getRuleAttachment(getRuleAttachmentOptionsModel).execute(); - assertNotNull(response); - RuleAttachment responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getRuleAttachmentPath); - } - - // Test the getRuleAttachment operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetRuleAttachmentNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.getRuleAttachment(null).execute(); - } - - @Test - public void testUpdateRuleAttachmentWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"attachment_id\": \"attachmentId\", \"template_id\": \"templateId\", \"account_id\": \"accountId\", \"included_scope\": {\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}, \"excluded_scopes\": [{\"note\": \"note\", \"scope_id\": \"scopeId\", \"scope_type\": \"enterprise\"}]}"; - String updateRuleAttachmentPath = "/config/v1/rules/testString/attachments/testString"; - - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the RuleScope model - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("My enterprise") - .scopeId("282cf433ac91493ba860480d92519990") - .scopeType("enterprise") - .build(); - - // Construct an instance of the UpdateRuleAttachmentOptions model - UpdateRuleAttachmentOptions updateRuleAttachmentOptionsModel = new UpdateRuleAttachmentOptions.Builder() - .ruleId("testString") - .attachmentId("testString") - .ifMatch("testString") - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))) - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.updateRuleAttachment(updateRuleAttachmentOptionsModel).execute(); - assertNotNull(response); - TemplateAttachment responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - assertEquals(request.getHeader("If-Match"), "testString"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateRuleAttachmentPath); - } - - // Test the updateRuleAttachment operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateRuleAttachmentNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.updateRuleAttachment(null).execute(); - } - - @Test - public void testDeleteRuleAttachmentWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = ""; - String deleteRuleAttachmentPath = "/config/v1/rules/testString/attachments/testString"; - - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); - - constructClientService(); - - // Construct an instance of the DeleteRuleAttachmentOptions model - DeleteRuleAttachmentOptions deleteRuleAttachmentOptionsModel = new DeleteRuleAttachmentOptions.Builder() - .ruleId("testString") - .attachmentId("testString") - .transactionId("testString") - .build(); - - // Invoke operation with valid options model (positive test) - Response response = configurationGovernanceService.deleteRuleAttachment(deleteRuleAttachmentOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - // Response does not have a return type. Check that the result is null. - assertNull(responseObj); - - // Verify the contents of the request - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - - // Check query - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteRuleAttachmentPath); - } - - // Test the deleteRuleAttachment operation with null options model parameter - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteRuleAttachmentNoOptions() throws Throwable { - // construct the service - constructClientService(); - - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) - configurationGovernanceService.deleteRuleAttachment(null).execute(); - } - - /** Initialize the server */ - @BeforeMethod - public void setUpMockServer() { - try { - server = new MockWebServer(); - // register handler - server.start(); - } - catch (IOException err) { - fail("Failed to instantiate mock web server"); - } - } - - @AfterMethod - public void tearDownMockServer() throws IOException { - server.shutdown(); - configurationGovernanceService = null; - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptionsTest.java deleted file mode 100644 index 77257e01..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsOptionsTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the CreateRuleAttachmentsOptions model. - */ -public class CreateRuleAttachmentsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateRuleAttachmentsOptions() throws Throwable { - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("testString") - .scopeId("testString") - .scopeType("enterprise") - .build(); - assertEquals(ruleScopeModel.note(), "testString"); - assertEquals(ruleScopeModel.scopeId(), "testString"); - assertEquals(ruleScopeModel.scopeType(), "enterprise"); - - RuleAttachmentRequest ruleAttachmentRequestModel = new RuleAttachmentRequest.Builder() - .accountId("testString") - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))) - .build(); - assertEquals(ruleAttachmentRequestModel.accountId(), "testString"); - assertEquals(ruleAttachmentRequestModel.includedScope(), ruleScopeModel); - assertEquals(ruleAttachmentRequestModel.excludedScopes(), new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))); - - CreateRuleAttachmentsOptions createRuleAttachmentsOptionsModel = new CreateRuleAttachmentsOptions.Builder() - .ruleId("testString") - .attachments(new java.util.ArrayList(java.util.Arrays.asList(ruleAttachmentRequestModel))) - .transactionId("testString") - .build(); - assertEquals(createRuleAttachmentsOptionsModel.ruleId(), "testString"); - assertEquals(createRuleAttachmentsOptionsModel.attachments(), new java.util.ArrayList(java.util.Arrays.asList(ruleAttachmentRequestModel))); - assertEquals(createRuleAttachmentsOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateRuleAttachmentsOptionsError() throws Throwable { - new CreateRuleAttachmentsOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponseTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponseTest.java deleted file mode 100644 index 83fc5118..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleAttachmentsResponseTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the CreateRuleAttachmentsResponse model. - */ -public class CreateRuleAttachmentsResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateRuleAttachmentsResponse() throws Throwable { - CreateRuleAttachmentsResponse createRuleAttachmentsResponseModel = new CreateRuleAttachmentsResponse(); - assertNull(createRuleAttachmentsResponseModel.getAttachments()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequestTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequestTest.java deleted file mode 100644 index 38b083c7..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleRequestTest.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the CreateRuleRequest model. - */ -public class CreateRuleRequestTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateRuleRequest() throws Throwable { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.name(), "resource_id"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.value(), "81f3db5e-f9db-4c46-9de3-a4a76e66adbf"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.operator(), "string_equals"); - - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - assertEquals(targetResourceModel.serviceName(), "cloud-object-storage"); - assertEquals(targetResourceModel.resourceKind(), "bucket"); - assertEquals(targetResourceModel.additionalTargetAttributes(), new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))); - - RuleRequiredConfigSingleProperty ruleRequiredConfigModel = new RuleRequiredConfigSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleRequiredConfigModel.description(), "testString"); - assertEquals(ruleRequiredConfigModel.property(), "public_access_enabled"); - assertEquals(ruleRequiredConfigModel.operator(), "is_true"); - assertEquals(ruleRequiredConfigModel.value(), "testString"); - - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - assertEquals(enforcementActionModel.action(), "disallow"); - - RuleRequest ruleRequestModel = new RuleRequest.Builder() - .accountId("testString") - .name("testString") - .description("testString") - .ruleType("user_defined") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .labels(new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))) - .build(); - assertEquals(ruleRequestModel.accountId(), "testString"); - assertEquals(ruleRequestModel.name(), "testString"); - assertEquals(ruleRequestModel.description(), "testString"); - assertEquals(ruleRequestModel.ruleType(), "user_defined"); - assertEquals(ruleRequestModel.target(), targetResourceModel); - assertEquals(ruleRequestModel.requiredConfig(), ruleRequiredConfigModel); - assertEquals(ruleRequestModel.enforcementActions(), new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))); - assertEquals(ruleRequestModel.labels(), new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))); - - CreateRuleRequest createRuleRequestModel = new CreateRuleRequest.Builder() - .requestId("3cebc877-58e7-44a5-a292-32114fa73558") - .rule(ruleRequestModel) - .build(); - assertEquals(createRuleRequestModel.requestId(), "3cebc877-58e7-44a5-a292-32114fa73558"); - assertEquals(createRuleRequestModel.rule(), ruleRequestModel); - - String json = TestUtilities.serialize(createRuleRequestModel); - - CreateRuleRequest createRuleRequestModelNew = TestUtilities.deserialize(json, CreateRuleRequest.class); - assertTrue(createRuleRequestModelNew instanceof CreateRuleRequest); - assertEquals(createRuleRequestModelNew.requestId(), "3cebc877-58e7-44a5-a292-32114fa73558"); - assertEquals(createRuleRequestModelNew.rule().toString(), ruleRequestModel.toString()); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateRuleRequestError() throws Throwable { - new CreateRuleRequest.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponseTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponseTest.java deleted file mode 100644 index 148a88e9..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRuleResponseTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleResponseError; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the CreateRuleResponse model. - */ -public class CreateRuleResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateRuleResponse() throws Throwable { - CreateRuleResponse createRuleResponseModel = new CreateRuleResponse(); - assertNull(createRuleResponseModel.getRequestId()); - assertNull(createRuleResponseModel.getStatusCode()); - assertNull(createRuleResponseModel.getRule()); - assertNull(createRuleResponseModel.getErrors()); - assertNull(createRuleResponseModel.getTrace()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptionsTest.java deleted file mode 100644 index 35a1e771..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesOptionsTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the CreateRulesOptions model. - */ -public class CreateRulesOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateRulesOptions() throws Throwable { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.name(), "resource_id"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.value(), "81f3db5e-f9db-4c46-9de3-a4a76e66adbf"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.operator(), "string_equals"); - - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - assertEquals(targetResourceModel.serviceName(), "cloud-object-storage"); - assertEquals(targetResourceModel.resourceKind(), "bucket"); - assertEquals(targetResourceModel.additionalTargetAttributes(), new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))); - - RuleRequiredConfigSingleProperty ruleRequiredConfigModel = new RuleRequiredConfigSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleRequiredConfigModel.description(), "testString"); - assertEquals(ruleRequiredConfigModel.property(), "public_access_enabled"); - assertEquals(ruleRequiredConfigModel.operator(), "is_true"); - assertEquals(ruleRequiredConfigModel.value(), "testString"); - - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - assertEquals(enforcementActionModel.action(), "disallow"); - - RuleRequest ruleRequestModel = new RuleRequest.Builder() - .accountId("testString") - .name("testString") - .description("testString") - .ruleType("user_defined") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .labels(new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))) - .build(); - assertEquals(ruleRequestModel.accountId(), "testString"); - assertEquals(ruleRequestModel.name(), "testString"); - assertEquals(ruleRequestModel.description(), "testString"); - assertEquals(ruleRequestModel.ruleType(), "user_defined"); - assertEquals(ruleRequestModel.target(), targetResourceModel); - assertEquals(ruleRequestModel.requiredConfig(), ruleRequiredConfigModel); - assertEquals(ruleRequestModel.enforcementActions(), new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))); - assertEquals(ruleRequestModel.labels(), new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))); - - CreateRuleRequest createRuleRequestModel = new CreateRuleRequest.Builder() - .requestId("3cebc877-58e7-44a5-a292-32114fa73558") - .rule(ruleRequestModel) - .build(); - assertEquals(createRuleRequestModel.requestId(), "3cebc877-58e7-44a5-a292-32114fa73558"); - assertEquals(createRuleRequestModel.rule(), ruleRequestModel); - - CreateRulesOptions createRulesOptionsModel = new CreateRulesOptions.Builder() - .rules(new java.util.ArrayList(java.util.Arrays.asList(createRuleRequestModel))) - .transactionId("testString") - .build(); - assertEquals(createRulesOptionsModel.rules(), new java.util.ArrayList(java.util.Arrays.asList(createRuleRequestModel))); - assertEquals(createRulesOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateRulesOptionsError() throws Throwable { - new CreateRulesOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponseTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponseTest.java deleted file mode 100644 index 26489eb6..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/CreateRulesResponseTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleResponseError; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the CreateRulesResponse model. - */ -public class CreateRulesResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateRulesResponse() throws Throwable { - CreateRulesResponse createRulesResponseModel = new CreateRulesResponse(); - assertNull(createRulesResponseModel.getRules()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptionsTest.java deleted file mode 100644 index d353ea8e..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleAttachmentOptionsTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the DeleteRuleAttachmentOptions model. - */ -public class DeleteRuleAttachmentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteRuleAttachmentOptions() throws Throwable { - DeleteRuleAttachmentOptions deleteRuleAttachmentOptionsModel = new DeleteRuleAttachmentOptions.Builder() - .ruleId("testString") - .attachmentId("testString") - .transactionId("testString") - .build(); - assertEquals(deleteRuleAttachmentOptionsModel.ruleId(), "testString"); - assertEquals(deleteRuleAttachmentOptionsModel.attachmentId(), "testString"); - assertEquals(deleteRuleAttachmentOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteRuleAttachmentOptionsError() throws Throwable { - new DeleteRuleAttachmentOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptionsTest.java deleted file mode 100644 index 979a0c39..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/DeleteRuleOptionsTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the DeleteRuleOptions model. - */ -public class DeleteRuleOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteRuleOptions() throws Throwable { - DeleteRuleOptions deleteRuleOptionsModel = new DeleteRuleOptions.Builder() - .ruleId("testString") - .transactionId("testString") - .build(); - assertEquals(deleteRuleOptionsModel.ruleId(), "testString"); - assertEquals(deleteRuleOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteRuleOptionsError() throws Throwable { - new DeleteRuleOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementActionTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementActionTest.java deleted file mode 100644 index 7136bea5..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/EnforcementActionTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the EnforcementAction model. - */ -public class EnforcementActionTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testEnforcementAction() throws Throwable { - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("audit_log") - .build(); - assertEquals(enforcementActionModel.action(), "audit_log"); - - String json = TestUtilities.serialize(enforcementActionModel); - - EnforcementAction enforcementActionModelNew = TestUtilities.deserialize(json, EnforcementAction.class); - assertTrue(enforcementActionModelNew instanceof EnforcementAction); - assertEquals(enforcementActionModelNew.action(), "audit_log"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testEnforcementActionError() throws Throwable { - new EnforcementAction.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptionsTest.java deleted file mode 100644 index f09ff05b..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleAttachmentOptionsTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the GetRuleAttachmentOptions model. - */ -public class GetRuleAttachmentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetRuleAttachmentOptions() throws Throwable { - GetRuleAttachmentOptions getRuleAttachmentOptionsModel = new GetRuleAttachmentOptions.Builder() - .ruleId("testString") - .attachmentId("testString") - .transactionId("testString") - .build(); - assertEquals(getRuleAttachmentOptionsModel.ruleId(), "testString"); - assertEquals(getRuleAttachmentOptionsModel.attachmentId(), "testString"); - assertEquals(getRuleAttachmentOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetRuleAttachmentOptionsError() throws Throwable { - new GetRuleAttachmentOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptionsTest.java deleted file mode 100644 index c9a179d9..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/GetRuleOptionsTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the GetRuleOptions model. - */ -public class GetRuleOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetRuleOptions() throws Throwable { - GetRuleOptions getRuleOptionsModel = new GetRuleOptions.Builder() - .ruleId("testString") - .transactionId("testString") - .build(); - assertEquals(getRuleOptionsModel.ruleId(), "testString"); - assertEquals(getRuleOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetRuleOptionsError() throws Throwable { - new GetRuleOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/LinkTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/LinkTest.java deleted file mode 100644 index e236ee3c..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/LinkTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.Link; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the Link model. - */ -public class LinkTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testLink() throws Throwable { - Link linkModel = new Link(); - assertNull(linkModel.getHref()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptionsTest.java deleted file mode 100644 index 0622d44d..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRuleAttachmentsOptionsTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the ListRuleAttachmentsOptions model. - */ -public class ListRuleAttachmentsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListRuleAttachmentsOptions() throws Throwable { - ListRuleAttachmentsOptions listRuleAttachmentsOptionsModel = new ListRuleAttachmentsOptions.Builder() - .ruleId("testString") - .transactionId("testString") - .limit(Long.valueOf("1000")) - .offset(Long.valueOf("26")) - .build(); - assertEquals(listRuleAttachmentsOptionsModel.ruleId(), "testString"); - assertEquals(listRuleAttachmentsOptionsModel.transactionId(), "testString"); - assertEquals(listRuleAttachmentsOptionsModel.limit(), Long.valueOf("1000")); - assertEquals(listRuleAttachmentsOptionsModel.offset(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListRuleAttachmentsOptionsError() throws Throwable { - new ListRuleAttachmentsOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptionsTest.java deleted file mode 100644 index 31d28790..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/ListRulesOptionsTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the ListRulesOptions model. - */ -public class ListRulesOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListRulesOptions() throws Throwable { - ListRulesOptions listRulesOptionsModel = new ListRulesOptions.Builder() - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .transactionId("testString") - .attached(true) - .labels("SOC2,ITCS300") - .scopes("scope_id") - .limit(Long.valueOf("1000")) - .offset(Long.valueOf("26")) - .build(); - assertEquals(listRulesOptionsModel.accountId(), "531fc3e28bfc43c5a2cea07786d93f5c"); - assertEquals(listRulesOptionsModel.transactionId(), "testString"); - assertEquals(listRulesOptionsModel.attached(), Boolean.valueOf(true)); - assertEquals(listRulesOptionsModel.labels(), "SOC2,ITCS300"); - assertEquals(listRulesOptionsModel.scopes(), "scope_id"); - assertEquals(listRulesOptionsModel.limit(), Long.valueOf("1000")); - assertEquals(listRulesOptionsModel.offset(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListRulesOptionsError() throws Throwable { - new ListRulesOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentListTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentListTest.java deleted file mode 100644 index 5bc68b9e..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentListTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.Link; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleAttachmentList model. - */ -public class RuleAttachmentListTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleAttachmentList() throws Throwable { - RuleAttachmentList ruleAttachmentListModel = new RuleAttachmentList(); - assertNull(ruleAttachmentListModel.getOffset()); - assertNull(ruleAttachmentListModel.getLimit()); - assertNull(ruleAttachmentListModel.getTotalCount()); - assertNull(ruleAttachmentListModel.getFirst()); - assertNull(ruleAttachmentListModel.getLast()); - assertNull(ruleAttachmentListModel.getAttachments()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequestTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequestTest.java deleted file mode 100644 index f73709d4..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentRequestTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleAttachmentRequest model. - */ -public class RuleAttachmentRequestTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleAttachmentRequest() throws Throwable { - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("testString") - .scopeId("testString") - .scopeType("enterprise") - .build(); - assertEquals(ruleScopeModel.note(), "testString"); - assertEquals(ruleScopeModel.scopeId(), "testString"); - assertEquals(ruleScopeModel.scopeType(), "enterprise"); - - RuleAttachmentRequest ruleAttachmentRequestModel = new RuleAttachmentRequest.Builder() - .accountId("testString") - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))) - .build(); - assertEquals(ruleAttachmentRequestModel.accountId(), "testString"); - assertEquals(ruleAttachmentRequestModel.includedScope(), ruleScopeModel); - assertEquals(ruleAttachmentRequestModel.excludedScopes(), new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))); - - String json = TestUtilities.serialize(ruleAttachmentRequestModel); - - RuleAttachmentRequest ruleAttachmentRequestModelNew = TestUtilities.deserialize(json, RuleAttachmentRequest.class); - assertTrue(ruleAttachmentRequestModelNew instanceof RuleAttachmentRequest); - assertEquals(ruleAttachmentRequestModelNew.accountId(), "testString"); - assertEquals(ruleAttachmentRequestModelNew.includedScope().toString(), ruleScopeModel.toString()); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleAttachmentRequestError() throws Throwable { - new RuleAttachmentRequest.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentTest.java deleted file mode 100644 index f6194141..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleAttachmentTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleAttachment model. - */ -public class RuleAttachmentTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleAttachment() throws Throwable { - RuleAttachment ruleAttachmentModel = new RuleAttachment(); - assertNull(ruleAttachmentModel.getAttachmentId()); - assertNull(ruleAttachmentModel.getRuleId()); - assertNull(ruleAttachmentModel.getAccountId()); - assertNull(ruleAttachmentModel.getIncludedScope()); - assertNull(ruleAttachmentModel.getExcludedScopes()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2Test.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2Test.java deleted file mode 100644 index d6834825..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionAndLvl2Test.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionAndLvl2; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleConditionAndLvl2 model. - */ -public class RuleConditionAndLvl2Test { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleConditionAndLvl2() throws Throwable { - RuleSingleProperty ruleSinglePropertyModel = new RuleSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleSinglePropertyModel.description(), "testString"); - assertEquals(ruleSinglePropertyModel.property(), "public_access_enabled"); - assertEquals(ruleSinglePropertyModel.operator(), "is_true"); - assertEquals(ruleSinglePropertyModel.value(), "testString"); - - RuleConditionAndLvl2 ruleConditionAndLvl2Model = new RuleConditionAndLvl2.Builder() - .description("testString") - .and(new java.util.ArrayList(java.util.Arrays.asList(ruleSinglePropertyModel))) - .build(); - assertEquals(ruleConditionAndLvl2Model.description(), "testString"); - assertEquals(ruleConditionAndLvl2Model.and(), new java.util.ArrayList(java.util.Arrays.asList(ruleSinglePropertyModel))); - - String json = TestUtilities.serialize(ruleConditionAndLvl2Model); - - RuleConditionAndLvl2 ruleConditionAndLvl2ModelNew = TestUtilities.deserialize(json, RuleConditionAndLvl2.class); - assertTrue(ruleConditionAndLvl2ModelNew instanceof RuleConditionAndLvl2); - assertEquals(ruleConditionAndLvl2ModelNew.description(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleConditionAndLvl2Error() throws Throwable { - new RuleConditionAndLvl2.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2Test.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2Test.java deleted file mode 100644 index 5020efdf..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionOrLvl2Test.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionOrLvl2; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleConditionOrLvl2 model. - */ -public class RuleConditionOrLvl2Test { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleConditionOrLvl2() throws Throwable { - RuleSingleProperty ruleSinglePropertyModel = new RuleSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleSinglePropertyModel.description(), "testString"); - assertEquals(ruleSinglePropertyModel.property(), "public_access_enabled"); - assertEquals(ruleSinglePropertyModel.operator(), "is_true"); - assertEquals(ruleSinglePropertyModel.value(), "testString"); - - RuleConditionOrLvl2 ruleConditionOrLvl2Model = new RuleConditionOrLvl2.Builder() - .description("testString") - .or(new java.util.ArrayList(java.util.Arrays.asList(ruleSinglePropertyModel))) - .build(); - assertEquals(ruleConditionOrLvl2Model.description(), "testString"); - assertEquals(ruleConditionOrLvl2Model.or(), new java.util.ArrayList(java.util.Arrays.asList(ruleSinglePropertyModel))); - - String json = TestUtilities.serialize(ruleConditionOrLvl2Model); - - RuleConditionOrLvl2 ruleConditionOrLvl2ModelNew = TestUtilities.deserialize(json, RuleConditionOrLvl2.class); - assertTrue(ruleConditionOrLvl2ModelNew instanceof RuleConditionOrLvl2); - assertEquals(ruleConditionOrLvl2ModelNew.description(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleConditionOrLvl2Error() throws Throwable { - new RuleConditionOrLvl2.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSinglePropertyTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSinglePropertyTest.java deleted file mode 100644 index e3f4bd14..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionSinglePropertyTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleConditionSingleProperty model. - */ -public class RuleConditionSinglePropertyTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleConditionSingleProperty() throws Throwable { - RuleConditionSingleProperty ruleConditionSinglePropertyModel = new RuleConditionSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleConditionSinglePropertyModel.description(), "testString"); - assertEquals(ruleConditionSinglePropertyModel.property(), "public_access_enabled"); - assertEquals(ruleConditionSinglePropertyModel.operator(), "is_true"); - assertEquals(ruleConditionSinglePropertyModel.value(), "testString"); - - String json = TestUtilities.serialize(ruleConditionSinglePropertyModel); - - RuleConditionSingleProperty ruleConditionSinglePropertyModelNew = TestUtilities.deserialize(json, RuleConditionSingleProperty.class); - assertTrue(ruleConditionSinglePropertyModelNew instanceof RuleConditionSingleProperty); - assertEquals(ruleConditionSinglePropertyModelNew.description(), "testString"); - assertEquals(ruleConditionSinglePropertyModelNew.property(), "public_access_enabled"); - assertEquals(ruleConditionSinglePropertyModelNew.operator(), "is_true"); - assertEquals(ruleConditionSinglePropertyModelNew.value(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleConditionSinglePropertyError() throws Throwable { - new RuleConditionSingleProperty.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionTest.java deleted file mode 100644 index 13a8b82e..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleConditionTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleCondition; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleCondition model. - */ -public class RuleConditionTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - // TODO: Add tests for models that are abstract - @Test - public void testRuleCondition() throws Throwable { - RuleCondition ruleConditionModel = new RuleCondition(); - assertNotNull(ruleConditionModel); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleListTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleListTest.java deleted file mode 100644 index 826fde9e..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleListTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.Link; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleList model. - */ -public class RuleListTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleList() throws Throwable { - RuleList ruleListModel = new RuleList(); - assertNull(ruleListModel.getOffset()); - assertNull(ruleListModel.getLimit()); - assertNull(ruleListModel.getTotalCount()); - assertNull(ruleListModel.getFirst()); - assertNull(ruleListModel.getLast()); - assertNull(ruleListModel.getRules()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequestTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequestTest.java deleted file mode 100644 index 2496b2ab..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequestTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleRequest model. - */ -public class RuleRequestTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleRequest() throws Throwable { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.name(), "resource_id"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.value(), "81f3db5e-f9db-4c46-9de3-a4a76e66adbf"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.operator(), "string_equals"); - - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - assertEquals(targetResourceModel.serviceName(), "cloud-object-storage"); - assertEquals(targetResourceModel.resourceKind(), "bucket"); - assertEquals(targetResourceModel.additionalTargetAttributes(), new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))); - - RuleRequiredConfigSingleProperty ruleRequiredConfigModel = new RuleRequiredConfigSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleRequiredConfigModel.description(), "testString"); - assertEquals(ruleRequiredConfigModel.property(), "public_access_enabled"); - assertEquals(ruleRequiredConfigModel.operator(), "is_true"); - assertEquals(ruleRequiredConfigModel.value(), "testString"); - - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - assertEquals(enforcementActionModel.action(), "disallow"); - - RuleRequest ruleRequestModel = new RuleRequest.Builder() - .accountId("testString") - .name("testString") - .description("testString") - .ruleType("user_defined") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .labels(new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))) - .build(); - assertEquals(ruleRequestModel.accountId(), "testString"); - assertEquals(ruleRequestModel.name(), "testString"); - assertEquals(ruleRequestModel.description(), "testString"); - assertEquals(ruleRequestModel.ruleType(), "user_defined"); - assertEquals(ruleRequestModel.target(), targetResourceModel); - assertEquals(ruleRequestModel.requiredConfig(), ruleRequiredConfigModel); - assertEquals(ruleRequestModel.enforcementActions(), new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))); - assertEquals(ruleRequestModel.labels(), new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))); - - String json = TestUtilities.serialize(ruleRequestModel); - - RuleRequest ruleRequestModelNew = TestUtilities.deserialize(json, RuleRequest.class); - assertTrue(ruleRequestModelNew instanceof RuleRequest); - assertEquals(ruleRequestModelNew.accountId(), "testString"); - assertEquals(ruleRequestModelNew.name(), "testString"); - assertEquals(ruleRequestModelNew.description(), "testString"); - assertEquals(ruleRequestModelNew.ruleType(), "user_defined"); - assertEquals(ruleRequestModelNew.target().toString(), targetResourceModel.toString()); - assertEquals(ruleRequestModelNew.requiredConfig().toString(), ruleRequiredConfigModel.toString()); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleRequestError() throws Throwable { - new RuleRequest.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAndTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAndTest.java deleted file mode 100644 index 3b3e186d..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionAndTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultiplePropertiesConditionAnd; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleRequiredConfigMultiplePropertiesConditionAnd model. - */ -public class RuleRequiredConfigMultiplePropertiesConditionAndTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleRequiredConfigMultiplePropertiesConditionAnd() throws Throwable { - RuleConditionSingleProperty ruleConditionModel = new RuleConditionSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleConditionModel.description(), "testString"); - assertEquals(ruleConditionModel.property(), "public_access_enabled"); - assertEquals(ruleConditionModel.operator(), "is_true"); - assertEquals(ruleConditionModel.value(), "testString"); - - RuleRequiredConfigMultiplePropertiesConditionAnd ruleRequiredConfigMultiplePropertiesConditionAndModel = new RuleRequiredConfigMultiplePropertiesConditionAnd.Builder() - .description("testString") - .and(new java.util.ArrayList(java.util.Arrays.asList(ruleConditionModel))) - .build(); - assertEquals(ruleRequiredConfigMultiplePropertiesConditionAndModel.description(), "testString"); - assertEquals(ruleRequiredConfigMultiplePropertiesConditionAndModel.and(), new java.util.ArrayList(java.util.Arrays.asList(ruleConditionModel))); - - String json = TestUtilities.serialize(ruleRequiredConfigMultiplePropertiesConditionAndModel); - - RuleRequiredConfigMultiplePropertiesConditionAnd ruleRequiredConfigMultiplePropertiesConditionAndModelNew = TestUtilities.deserialize(json, RuleRequiredConfigMultiplePropertiesConditionAnd.class); - assertTrue(ruleRequiredConfigMultiplePropertiesConditionAndModelNew instanceof RuleRequiredConfigMultiplePropertiesConditionAnd); - assertEquals(ruleRequiredConfigMultiplePropertiesConditionAndModelNew.description(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleRequiredConfigMultiplePropertiesConditionAndError() throws Throwable { - new RuleRequiredConfigMultiplePropertiesConditionAnd.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOrTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOrTest.java deleted file mode 100644 index 1b29aeae..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesConditionOrTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultiplePropertiesConditionOr; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleRequiredConfigMultiplePropertiesConditionOr model. - */ -public class RuleRequiredConfigMultiplePropertiesConditionOrTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleRequiredConfigMultiplePropertiesConditionOr() throws Throwable { - RuleConditionSingleProperty ruleConditionModel = new RuleConditionSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleConditionModel.description(), "testString"); - assertEquals(ruleConditionModel.property(), "public_access_enabled"); - assertEquals(ruleConditionModel.operator(), "is_true"); - assertEquals(ruleConditionModel.value(), "testString"); - - RuleRequiredConfigMultiplePropertiesConditionOr ruleRequiredConfigMultiplePropertiesConditionOrModel = new RuleRequiredConfigMultiplePropertiesConditionOr.Builder() - .description("testString") - .or(new java.util.ArrayList(java.util.Arrays.asList(ruleConditionModel))) - .build(); - assertEquals(ruleRequiredConfigMultiplePropertiesConditionOrModel.description(), "testString"); - assertEquals(ruleRequiredConfigMultiplePropertiesConditionOrModel.or(), new java.util.ArrayList(java.util.Arrays.asList(ruleConditionModel))); - - String json = TestUtilities.serialize(ruleRequiredConfigMultiplePropertiesConditionOrModel); - - RuleRequiredConfigMultiplePropertiesConditionOr ruleRequiredConfigMultiplePropertiesConditionOrModelNew = TestUtilities.deserialize(json, RuleRequiredConfigMultiplePropertiesConditionOr.class); - assertTrue(ruleRequiredConfigMultiplePropertiesConditionOrModelNew instanceof RuleRequiredConfigMultiplePropertiesConditionOr); - assertEquals(ruleRequiredConfigMultiplePropertiesConditionOrModelNew.description(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleRequiredConfigMultiplePropertiesConditionOrError() throws Throwable { - new RuleRequiredConfigMultiplePropertiesConditionOr.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesTest.java deleted file mode 100644 index 4f857062..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigMultiplePropertiesTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultipleProperties; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleRequiredConfigMultipleProperties model. - */ -public class RuleRequiredConfigMultiplePropertiesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - // TODO: Add tests for models that are abstract - @Test - public void testRuleRequiredConfigMultipleProperties() throws Throwable { - RuleRequiredConfigMultipleProperties ruleRequiredConfigMultiplePropertiesModel = new RuleRequiredConfigMultipleProperties(); - assertNotNull(ruleRequiredConfigMultiplePropertiesModel); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSinglePropertyTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSinglePropertyTest.java deleted file mode 100644 index ac4ae7d4..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigSinglePropertyTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleRequiredConfigSingleProperty model. - */ -public class RuleRequiredConfigSinglePropertyTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleRequiredConfigSingleProperty() throws Throwable { - RuleRequiredConfigSingleProperty ruleRequiredConfigSinglePropertyModel = new RuleRequiredConfigSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleRequiredConfigSinglePropertyModel.description(), "testString"); - assertEquals(ruleRequiredConfigSinglePropertyModel.property(), "public_access_enabled"); - assertEquals(ruleRequiredConfigSinglePropertyModel.operator(), "is_true"); - assertEquals(ruleRequiredConfigSinglePropertyModel.value(), "testString"); - - String json = TestUtilities.serialize(ruleRequiredConfigSinglePropertyModel); - - RuleRequiredConfigSingleProperty ruleRequiredConfigSinglePropertyModelNew = TestUtilities.deserialize(json, RuleRequiredConfigSingleProperty.class); - assertTrue(ruleRequiredConfigSinglePropertyModelNew instanceof RuleRequiredConfigSingleProperty); - assertEquals(ruleRequiredConfigSinglePropertyModelNew.description(), "testString"); - assertEquals(ruleRequiredConfigSinglePropertyModelNew.property(), "public_access_enabled"); - assertEquals(ruleRequiredConfigSinglePropertyModelNew.operator(), "is_true"); - assertEquals(ruleRequiredConfigSinglePropertyModelNew.value(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleRequiredConfigSinglePropertyError() throws Throwable { - new RuleRequiredConfigSingleProperty.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigTest.java deleted file mode 100644 index 3f82862c..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleRequiredConfigTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfig; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleRequiredConfig model. - */ -public class RuleRequiredConfigTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - // TODO: Add tests for models that are abstract - @Test - public void testRuleRequiredConfig() throws Throwable { - RuleRequiredConfig ruleRequiredConfigModel = new RuleRequiredConfig(); - assertNotNull(ruleRequiredConfigModel); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseErrorTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseErrorTest.java deleted file mode 100644 index 01a0151a..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleResponseErrorTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleResponseError; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleResponseError model. - */ -public class RuleResponseErrorTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleResponseError() throws Throwable { - RuleResponseError ruleResponseErrorModel = new RuleResponseError(); - assertNull(ruleResponseErrorModel.getCode()); - assertNull(ruleResponseErrorModel.getMessage()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScopeTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScopeTest.java deleted file mode 100644 index 367095dc..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleScopeTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleScope model. - */ -public class RuleScopeTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleScope() throws Throwable { - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("testString") - .scopeId("testString") - .scopeType("enterprise") - .build(); - assertEquals(ruleScopeModel.note(), "testString"); - assertEquals(ruleScopeModel.scopeId(), "testString"); - assertEquals(ruleScopeModel.scopeType(), "enterprise"); - - String json = TestUtilities.serialize(ruleScopeModel); - - RuleScope ruleScopeModelNew = TestUtilities.deserialize(json, RuleScope.class); - assertTrue(ruleScopeModelNew instanceof RuleScope); - assertEquals(ruleScopeModelNew.note(), "testString"); - assertEquals(ruleScopeModelNew.scopeId(), "testString"); - assertEquals(ruleScopeModelNew.scopeType(), "enterprise"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleScopeError() throws Throwable { - new RuleScope.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSinglePropertyTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSinglePropertyTest.java deleted file mode 100644 index dd7420e6..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleSinglePropertyTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RuleSingleProperty model. - */ -public class RuleSinglePropertyTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRuleSingleProperty() throws Throwable { - RuleSingleProperty ruleSinglePropertyModel = new RuleSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleSinglePropertyModel.description(), "testString"); - assertEquals(ruleSinglePropertyModel.property(), "public_access_enabled"); - assertEquals(ruleSinglePropertyModel.operator(), "is_true"); - assertEquals(ruleSinglePropertyModel.value(), "testString"); - - String json = TestUtilities.serialize(ruleSinglePropertyModel); - - RuleSingleProperty ruleSinglePropertyModelNew = TestUtilities.deserialize(json, RuleSingleProperty.class); - assertTrue(ruleSinglePropertyModelNew instanceof RuleSingleProperty); - assertEquals(ruleSinglePropertyModelNew.description(), "testString"); - assertEquals(ruleSinglePropertyModelNew.property(), "public_access_enabled"); - assertEquals(ruleSinglePropertyModelNew.operator(), "is_true"); - assertEquals(ruleSinglePropertyModelNew.value(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRuleSinglePropertyError() throws Throwable { - new RuleSingleProperty.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleTest.java deleted file mode 100644 index 5830df60..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/RuleTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the Rule model. - */ -public class RuleTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRule() throws Throwable { - Rule ruleModel = new Rule(); - assertNull(ruleModel.getAccountId()); - assertNull(ruleModel.getName()); - assertNull(ruleModel.getDescription()); - assertNull(ruleModel.getRuleType()); - assertNull(ruleModel.getTarget()); - assertNull(ruleModel.getRequiredConfig()); - assertNull(ruleModel.getEnforcementActions()); - assertNull(ruleModel.getLabels()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItemTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItemTest.java deleted file mode 100644 index 751832a9..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceAdditionalTargetAttributesItemTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the TargetResourceAdditionalTargetAttributesItem model. - */ -public class TargetResourceAdditionalTargetAttributesItemTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTargetResourceAdditionalTargetAttributesItem() throws Throwable { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("testString") - .value("testString") - .operator("string_equals") - .build(); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.name(), "testString"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.value(), "testString"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.operator(), "string_equals"); - - String json = TestUtilities.serialize(targetResourceAdditionalTargetAttributesItemModel); - - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModelNew = TestUtilities.deserialize(json, TargetResourceAdditionalTargetAttributesItem.class); - assertTrue(targetResourceAdditionalTargetAttributesItemModelNew instanceof TargetResourceAdditionalTargetAttributesItem); - assertEquals(targetResourceAdditionalTargetAttributesItemModelNew.name(), "testString"); - assertEquals(targetResourceAdditionalTargetAttributesItemModelNew.value(), "testString"); - assertEquals(targetResourceAdditionalTargetAttributesItemModelNew.operator(), "string_equals"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTargetResourceAdditionalTargetAttributesItemError() throws Throwable { - new TargetResourceAdditionalTargetAttributesItem.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceTest.java deleted file mode 100644 index 96ef00b5..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TargetResourceTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the TargetResource model. - */ -public class TargetResourceTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTargetResource() throws Throwable { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.name(), "resource_id"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.value(), "81f3db5e-f9db-4c46-9de3-a4a76e66adbf"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.operator(), "string_equals"); - - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - assertEquals(targetResourceModel.serviceName(), "cloud-object-storage"); - assertEquals(targetResourceModel.resourceKind(), "bucket"); - assertEquals(targetResourceModel.additionalTargetAttributes(), new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))); - - String json = TestUtilities.serialize(targetResourceModel); - - TargetResource targetResourceModelNew = TestUtilities.deserialize(json, TargetResource.class); - assertTrue(targetResourceModelNew instanceof TargetResource); - assertEquals(targetResourceModelNew.serviceName(), "cloud-object-storage"); - assertEquals(targetResourceModelNew.resourceKind(), "bucket"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTargetResourceError() throws Throwable { - new TargetResource.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachmentTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachmentTest.java deleted file mode 100644 index 6bd85f53..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateAttachmentTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the TemplateAttachment model. - */ -public class TemplateAttachmentTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTemplateAttachment() throws Throwable { - TemplateAttachment templateAttachmentModel = new TemplateAttachment(); - assertNull(templateAttachmentModel.getAttachmentId()); - assertNull(templateAttachmentModel.getTemplateId()); - assertNull(templateAttachmentModel.getAccountId()); - assertNull(templateAttachmentModel.getIncludedScope()); - assertNull(templateAttachmentModel.getExcludedScopes()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScopeTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScopeTest.java deleted file mode 100644 index ed44b040..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/TemplateScopeTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateScope; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the TemplateScope model. - */ -public class TemplateScopeTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTemplateScope() throws Throwable { - TemplateScope templateScopeModel = new TemplateScope(); - assertNull(templateScopeModel.getNote()); - assertNull(templateScopeModel.getScopeId()); - assertNull(templateScopeModel.getScopeType()); - } -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptionsTest.java deleted file mode 100644 index f4629971..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleAttachmentOptionsTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the UpdateRuleAttachmentOptions model. - */ -public class UpdateRuleAttachmentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateRuleAttachmentOptions() throws Throwable { - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("testString") - .scopeId("testString") - .scopeType("enterprise") - .build(); - assertEquals(ruleScopeModel.note(), "testString"); - assertEquals(ruleScopeModel.scopeId(), "testString"); - assertEquals(ruleScopeModel.scopeType(), "enterprise"); - - UpdateRuleAttachmentOptions updateRuleAttachmentOptionsModel = new UpdateRuleAttachmentOptions.Builder() - .ruleId("testString") - .attachmentId("testString") - .ifMatch("testString") - .accountId("testString") - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))) - .transactionId("testString") - .build(); - assertEquals(updateRuleAttachmentOptionsModel.ruleId(), "testString"); - assertEquals(updateRuleAttachmentOptionsModel.attachmentId(), "testString"); - assertEquals(updateRuleAttachmentOptionsModel.ifMatch(), "testString"); - assertEquals(updateRuleAttachmentOptionsModel.accountId(), "testString"); - assertEquals(updateRuleAttachmentOptionsModel.includedScope(), ruleScopeModel); - assertEquals(updateRuleAttachmentOptionsModel.excludedScopes(), new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))); - assertEquals(updateRuleAttachmentOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateRuleAttachmentOptionsError() throws Throwable { - new UpdateRuleAttachmentOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptionsTest.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptionsTest.java deleted file mode 100644 index 7acf1838..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/model/UpdateRuleOptionsTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1.model; - -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the UpdateRuleOptions model. - */ -public class UpdateRuleOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateRuleOptions() throws Throwable { - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("resource_id") - .value("81f3db5e-f9db-4c46-9de3-a4a76e66adbf") - .operator("string_equals") - .build(); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.name(), "resource_id"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.value(), "81f3db5e-f9db-4c46-9de3-a4a76e66adbf"); - assertEquals(targetResourceAdditionalTargetAttributesItemModel.operator(), "string_equals"); - - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - assertEquals(targetResourceModel.serviceName(), "cloud-object-storage"); - assertEquals(targetResourceModel.resourceKind(), "bucket"); - assertEquals(targetResourceModel.additionalTargetAttributes(), new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))); - - RuleRequiredConfigSingleProperty ruleRequiredConfigModel = new RuleRequiredConfigSingleProperty.Builder() - .description("testString") - .property("public_access_enabled") - .operator("is_true") - .value("testString") - .build(); - assertEquals(ruleRequiredConfigModel.description(), "testString"); - assertEquals(ruleRequiredConfigModel.property(), "public_access_enabled"); - assertEquals(ruleRequiredConfigModel.operator(), "is_true"); - assertEquals(ruleRequiredConfigModel.value(), "testString"); - - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - assertEquals(enforcementActionModel.action(), "disallow"); - - UpdateRuleOptions updateRuleOptionsModel = new UpdateRuleOptions.Builder() - .ruleId("testString") - .ifMatch("testString") - .name("testString") - .description("testString") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .accountId("testString") - .ruleType("user_defined") - .labels(new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))) - .transactionId("testString") - .build(); - assertEquals(updateRuleOptionsModel.ruleId(), "testString"); - assertEquals(updateRuleOptionsModel.ifMatch(), "testString"); - assertEquals(updateRuleOptionsModel.name(), "testString"); - assertEquals(updateRuleOptionsModel.description(), "testString"); - assertEquals(updateRuleOptionsModel.target(), targetResourceModel); - assertEquals(updateRuleOptionsModel.requiredConfig(), ruleRequiredConfigModel); - assertEquals(updateRuleOptionsModel.enforcementActions(), new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))); - assertEquals(updateRuleOptionsModel.accountId(), "testString"); - assertEquals(updateRuleOptionsModel.ruleType(), "user_defined"); - assertEquals(updateRuleOptionsModel.labels(), new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))); - assertEquals(updateRuleOptionsModel.transactionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateRuleOptionsError() throws Throwable { - new UpdateRuleOptions.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/utils/TestUtilities.java b/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/utils/TestUtilities.java deleted file mode 100644 index ae3c27d5..00000000 --- a/modules/configuration-governance/src/test/java/com/ibm/cloud/scc/configuration_governance/v1/utils/TestUtilities.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ -package com.ibm.cloud.scc.configuration_governance.v1.utils; - -import java.util.Map; -import java.util.Set; -import java.util.List; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.io.InputStream; -import java.io.ByteArrayInputStream; - -import okhttp3.mockwebserver.RecordedRequest; -import okhttp3.HttpUrl; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.cloud.sdk.core.util.GsonSingleton; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; - -/** - * A class used by the unit tests containing utility functions. - */ -public class TestUtilities { - public static Map createMockMap() { - Map mockMap = new HashMap<>(); - mockMap.put("foo", "bar"); - return mockMap; - } - - public static HashMap createMockStreamMap() { - return new HashMap() { - { put("key1", createMockStream("This is a mock file.")); } - }; - } - - public static Map parseQueryString(RecordedRequest req) { - Map queryMap = new HashMap<>(); - - try { - HttpUrl requestUrl = req.getRequestUrl(); - - if (requestUrl != null) { - Set queryParamsNames = requestUrl.queryParameterNames(); - // map the parameter name to its corresponding value - for (String p : queryParamsNames) { - // get the corresponding value for the parameter (p) - List val = requestUrl.queryParameterValues(p); - if (val != null && !val.isEmpty()) { - String joinedQuery = String.join(",", val); - queryMap.put(p, joinedQuery); - } - } - } - if (queryMap.isEmpty()) { - return null; - } - } catch (Exception e) { - return null; - } - - return queryMap; - } - - public static String parseReqPath(RecordedRequest req) { - String parsedPath = null; - - try { - String fullPath = req.getPath(); - if (fullPath != null && !fullPath.isEmpty()) { - // retrieve the path segment before the query parameter - parsedPath = fullPath.split("\\?", 2)[0]; - } - if (parsedPath.isEmpty() || parsedPath == null) { - return null; - } - - } catch (Exception e) { - return null; - } - - return parsedPath; - } - - public static String serialize(Object obj) { - return GsonSingleton.getGson().toJson(obj); - } - - public static T deserialize(String json, Class clazz) { - return GsonSingleton.getGson().fromJson(json, clazz); - } - - public static InputStream createMockStream(String s) { - return new ByteArrayInputStream(s.getBytes()); - } - - public static List creatMockListFileWithMetadata() { - List list = new ArrayList(); - byte[] fileBytes = {(byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef}; - InputStream inputStream = new ByteArrayInputStream(fileBytes); - FileWithMetadata.Builder builder = new FileWithMetadata.Builder(); - builder.data(inputStream); - FileWithMetadata fileWithMetadata = builder.build(); - list.add(fileWithMetadata); - - return list; - } - - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); - } - - public static Date createMockDate(String date) throws Exception { - return DateUtils.parseAsDate(date); - } - - public static Date createMockDateTime(String date) throws Exception { - return DateUtils.parseAsDateTime(date); - } -} \ No newline at end of file diff --git a/modules/examples/pom.xml b/modules/examples/pom.xml deleted file mode 100644 index 70dd034c..00000000 --- a/modules/examples/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - 4.0.0 - - - scc - com.ibm.cloud - 3.0.0 - ../.. - - - examples - jar - IBM Cloud Security & Compliance Center Code Examples - - - - - com.ibm.cloud - configuration_governance - ${project.version} - - - org.slf4j - slf4j-jdk14 - - - - - - - org.apache.maven.plugins - maven-shade-plugin - - true - false - - - - package - - shade - - - - - - - - - - IBM Cloud DevX SDK Development - devxsdk@us.ibm.com - https://www.ibm.com/ - - - \ No newline at end of file diff --git a/modules/examples/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceExamples.java b/modules/examples/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceExamples.java deleted file mode 100644 index 39ad2fa7..00000000 --- a/modules/examples/src/main/java/com/ibm/cloud/scc/configuration_governance/v1/ConfigurationGovernanceExamples.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed 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. - */ - -package com.ibm.cloud.scc.configuration_governance.v1; - -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleAttachmentsResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.CreateRulesResponse; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.DeleteRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.EnforcementAction; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.GetRuleOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRuleAttachmentsOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.ListRulesOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.Rule; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleAttachmentRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleCondition; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleConditionSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleList; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequest; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigMultiplePropertiesConditionAnd; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleRequiredConfigSingleProperty; -import com.ibm.cloud.scc.configuration_governance.v1.model.RuleScope; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResource; -import com.ibm.cloud.scc.configuration_governance.v1.model.TargetResourceAdditionalTargetAttributesItem; -import com.ibm.cloud.scc.configuration_governance.v1.model.TemplateAttachment; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleAttachmentOptions; -import com.ibm.cloud.scc.configuration_governance.v1.model.UpdateRuleOptions; -import com.ibm.cloud.sdk.core.http.Response; -import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException; -import com.ibm.cloud.sdk.core.util.CredentialUtils; -import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -// -// This file provides an example of how to use the Configuration Governance service. -// -// The following configuration properties are assumed to be defined: -// CONFIGURATION_GOVERNANCE_URL= -// CONFIGURATION_GOVERNANCE_AUTH_TYPE=iam -// CONFIGURATION_GOVERNANCE_APIKEY= -// CONFIGURATION_GOVERNANCE_AUTH_URL= -// -// These configuration properties can be exported as environment variables, or stored -// in a configuration file and then: -// export IBM_CREDENTIALS_FILE= -// -public class ConfigurationGovernanceExamples { - private static final Logger logger = LoggerFactory.getLogger(ConfigurationGovernanceExamples.class); - protected ConfigurationGovernanceExamples() { } - - @SuppressWarnings("checkstyle:methodlength") - public static void main(String[] args) throws Exception { - ConfigurationGovernance service = ConfigurationGovernance.newInstance(); - - // Load up our test-specific config properties. - Map config = CredentialUtils.getServiceProperties(ConfigurationGovernance.DEFAULT_SERVICE_NAME); - - // Variables to hold link values - String ruleAttachmentIdLink = null; - String ruleIdLink = null; - - try { - System.out.println("createRules() result:"); - // begin-create_rules - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("iam-groups") - .resourceKind("service") - .build(); - RuleConditionSingleProperty ruleConditionModel = new RuleConditionSingleProperty.Builder() - .property("public_access_enabled") - .operator("is_false") - .build(); - RuleRequiredConfigMultiplePropertiesConditionAnd ruleRequiredConfigModel = new RuleRequiredConfigMultiplePropertiesConditionAnd.Builder() - .description("Public access check") - .and(new java.util.ArrayList(java.util.Arrays.asList(ruleConditionModel))) - .build(); - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("disallow") - .build(); - RuleRequest ruleRequestModel = new RuleRequest.Builder() - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .name("Disable public access") - .description("Ensure that public access to account resources is disabled.") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .labels(new java.util.ArrayList(java.util.Arrays.asList("Access", "IAM"))) - .build(); - CreateRuleRequest createRuleRequestModel = new CreateRuleRequest.Builder() - .requestId("3cebc877-58e7-44a5-a292-32114fa73558") - .rule(ruleRequestModel) - .build(); - CreateRulesOptions createRulesOptions = new CreateRulesOptions.Builder() - .rules(new java.util.ArrayList(java.util.Arrays.asList(createRuleRequestModel))) - .build(); - - Response response = service.createRules(createRulesOptions).execute(); - CreateRulesResponse createRulesResponse = response.getResult(); - - System.out.println(createRulesResponse); - // end-create_rules - - ruleIdLink = createRulesResponse.getRules().get(0).getRule().getRuleId(); - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("createRuleAttachments() result:"); - // begin-create_rule_attachments - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("My enterprise") - .scopeId("282cf433ac91493ba860480d92519990") - .scopeType("enterprise") - .build(); - RuleAttachmentRequest ruleAttachmentRequestModel = new RuleAttachmentRequest.Builder() - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))) - .build(); - CreateRuleAttachmentsOptions createRuleAttachmentsOptions = new CreateRuleAttachmentsOptions.Builder() - .ruleId(ruleIdLink) - .attachments(new java.util.ArrayList(java.util.Arrays.asList(ruleAttachmentRequestModel))) - .build(); - - Response response = service.createRuleAttachments(createRuleAttachmentsOptions).execute(); - CreateRuleAttachmentsResponse createRuleAttachmentsResponse = response.getResult(); - - System.out.println(createRuleAttachmentsResponse); - // end-create_rule_attachments - - ruleAttachmentIdLink = createRuleAttachmentsResponse.getAttachments().get(0).getAttachmentId(); - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("listRules() result:"); - // begin-list_rules - ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .attached(true) - .labels("SOC2,ITCS300") - .scopes("scope_id") - .build(); - - Response response = service.listRules(listRulesOptions).execute(); - RuleList ruleList = response.getResult(); - - System.out.println(ruleList); - // end-list_rules - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("getRule() result:"); - // begin-get_rule - GetRuleOptions getRuleOptions = new GetRuleOptions.Builder() - .ruleId(ruleIdLink) - .build(); - - Response response = service.getRule(getRuleOptions).execute(); - Rule rule = response.getResult(); - - System.out.println(rule); - // end-get_rule - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("updateRule() result:"); - // begin-update_rule - TargetResourceAdditionalTargetAttributesItem targetResourceAdditionalTargetAttributesItemModel = new TargetResourceAdditionalTargetAttributesItem.Builder() - .name("testString") - .value("testString") - .operator("string_equals") - .build(); - TargetResource targetResourceModel = new TargetResource.Builder() - .serviceName("iam-groups") - .resourceKind("service") - .additionalTargetAttributes(new java.util.ArrayList(java.util.Arrays.asList(targetResourceAdditionalTargetAttributesItemModel))) - .build(); - RuleRequiredConfigSingleProperty ruleRequiredConfigModel = new RuleRequiredConfigSingleProperty.Builder() - .property("public_access_enabled") - .operator("is_false") - .build(); - EnforcementAction enforcementActionModel = new EnforcementAction.Builder() - .action("audit_log") - .build(); - UpdateRuleOptions updateRuleOptions = new UpdateRuleOptions.Builder() - .ruleId(ruleIdLink) - .ifMatch("testString") - .name("Disable public access") - .description("Ensure that public access to account resources is disabled.") - .target(targetResourceModel) - .requiredConfig(ruleRequiredConfigModel) - .enforcementActions(new java.util.ArrayList(java.util.Arrays.asList(enforcementActionModel))) - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .ruleType("user_defined") - .labels(new java.util.ArrayList(java.util.Arrays.asList("SOC2", "ITCS300"))) - .build(); - - Response response = service.updateRule(updateRuleOptions).execute(); - Rule rule = response.getResult(); - - System.out.println(rule); - // end-update_rule - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("listRuleAttachments() result:"); - // begin-list_rule_attachments - ListRuleAttachmentsOptions listRuleAttachmentsOptions = new ListRuleAttachmentsOptions.Builder() - .ruleId(ruleIdLink) - .build(); - - Response response = service.listRuleAttachments(listRuleAttachmentsOptions).execute(); - RuleAttachmentList ruleAttachmentList = response.getResult(); - - System.out.println(ruleAttachmentList); - // end-list_rule_attachments - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("getRuleAttachment() result:"); - // begin-get_rule_attachment - GetRuleAttachmentOptions getRuleAttachmentOptions = new GetRuleAttachmentOptions.Builder() - .ruleId(ruleIdLink) - .attachmentId(ruleAttachmentIdLink) - .build(); - - Response response = service.getRuleAttachment(getRuleAttachmentOptions).execute(); - RuleAttachment ruleAttachment = response.getResult(); - - System.out.println(ruleAttachment); - // end-get_rule_attachment - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("updateRuleAttachment() result:"); - // begin-update_rule_attachment - RuleScope ruleScopeModel = new RuleScope.Builder() - .note("My enterprise") - .scopeId("282cf433ac91493ba860480d92519990") - .scopeType("enterprise") - .build(); - UpdateRuleAttachmentOptions updateRuleAttachmentOptions = new UpdateRuleAttachmentOptions.Builder() - .ruleId(ruleIdLink) - .attachmentId(ruleAttachmentIdLink) - .ifMatch("testString") - .accountId("531fc3e28bfc43c5a2cea07786d93f5c") - .includedScope(ruleScopeModel) - .excludedScopes(new java.util.ArrayList(java.util.Arrays.asList(ruleScopeModel))) - .build(); - - Response response = service.updateRuleAttachment(updateRuleAttachmentOptions).execute(); - TemplateAttachment templateAttachment = response.getResult(); - - System.out.println(templateAttachment); - // end-update_rule_attachment - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - // begin-delete_rule_attachment - DeleteRuleAttachmentOptions deleteRuleAttachmentOptions = new DeleteRuleAttachmentOptions.Builder() - .ruleId(ruleIdLink) - .attachmentId(ruleAttachmentIdLink) - .build(); - - Response response = service.deleteRuleAttachment(deleteRuleAttachmentOptions).execute(); - // end-delete_rule_attachment - System.out.printf("deleteRuleAttachment() response status code: %d%n", response.getStatusCode()); - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - // begin-delete_rule - DeleteRuleOptions deleteRuleOptions = new DeleteRuleOptions.Builder() - .ruleId(ruleIdLink) - .build(); - - Response response = service.deleteRule(deleteRuleOptions).execute(); - // end-delete_rule - System.out.printf("deleteRule() response status code: %d%n", response.getStatusCode()); - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - } -} diff --git a/service-pom.xml b/service-pom.xml deleted file mode 100644 index 81795e0e..00000000 --- a/service-pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - 4.0.0 - - - - PARENT-ARTIFACTID - com.ibm.cloud - 0.0.1 - ../.. - - - - MODULE-ARTIFACTID - - - MODULE-DESCRIPTION - jar - - - - com.ibm.cloud - sdk-core - - - - COMMON-ARTIFACTID - ${project.groupId} - - - COMMON-ARTIFACTID - ${project.groupId} - test-jar - tests - test - - - org.testng - testng - test - - - com.squareup.okhttp3 - mockwebserver - test - - - org.powermock - powermock-api-mockito2 - test - - - org.powermock - powermock-module-testng - test - - - - - - IBM Cloud DevX SDK Development - devxsdk@us.ibm.com - https://www.ibm.com/ - - - - From 5ea74ae87fb2586301d82de6a99cf3d476bfed0b Mon Sep 17 00:00:00 2001 From: Pavan K Manda Date: Tue, 29 Aug 2023 10:13:52 +0530 Subject: [PATCH 4/5] fix: commt_2: add the generated code and modify the generated code Signed-off-by: Pavan K Manda --- .gitignore | 5 +- .vscode/settings.json | 3 + ...ecurityAndComplianceCenterApiExamples.java | 1271 +++ modules/common/pom.xml | 24 +- .../common/SdkCommon.java | 29 +- .../src/main/resources/my-services.properties | 4 - ...urity-and-compliance-center-sdk.properties | 4 + .../test/SdkCommonTest.java | 12 +- .../test/SdkIntegrationTestBase.java | 10 +- modules/coverage-reports/pom.xml | 35 +- .../pom.xml | 58 + .../v3/SecurityAndComplianceCenterApi.java | 2054 ++++ .../v3/model/Account.java | 61 + .../v3/model/AdditionalProperty.java | 69 + .../v3/model/AdditionalTargetAttribute.java | 196 + .../v3/model/Assessment.java | 105 + .../v3/model/Attachment.java | 87 + .../v3/model/AttachmentCollection.java | 89 + .../v3/model/AttachmentItem.java | 579 ++ .../model/AttachmentParameterPrototype.java | 249 + .../v3/model/AttachmentPrototype.java | 151 + .../v3/model/AttachmentScope.java | 65 + .../v3/model/AttachmentsAccountPager.java | 107 + .../AttachmentsNotificationsPrototype.java | 133 + .../v3/model/AttachmentsPager.java | 107 + .../v3/model/AttachmentsPrototype.java | 362 + .../v3/model/ComplianceScore.java | 63 + .../v3/model/ComplianceStats.java | 117 + .../v3/model/ControlDocs.java | 121 + .../v3/model/ControlLibrariesPager.java | 107 + .../v3/model/ControlLibrary.java | 527 + .../v3/model/ControlLibraryCollection.java | 90 + .../v3/model/ControlLibraryDelete.java | 37 + .../v3/model/ControlLibraryItem.java | 195 + .../model/ControlSpecificationWithStats.java | 194 + .../v3/model/ControlSpecifications.java | 308 + .../v3/model/ControlWithStats.java | 222 + .../v3/model/ControlsInControlLib.java | 383 + .../v3/model/CreateAttachmentOptions.java | 247 + .../CreateCustomControlLibraryOptions.java | 383 + .../v3/model/CreateProfileOptions.java | 326 + .../CreateProviderTypeInstanceOptions.java | 213 + .../v3/model/CreateRuleOptions.java | 353 + .../v3/model/CreateScanOptions.java | 159 + .../v3/model/DefaultParametersPrototype.java | 249 + .../DeleteCustomControlLibraryOptions.java | 159 + .../v3/model/DeleteCustomProfileOptions.java | 159 + .../model/DeleteProfileAttachmentOptions.java | 189 + .../DeleteProviderTypeInstanceOptions.java | 189 + .../v3/model/DeleteRuleOptions.java | 159 + .../v3/model/EvalDetails.java | 41 + .../v3/model/EvalStats.java | 117 + .../v3/model/Evaluation.java | 165 + .../v3/model/EvaluationPage.java | 127 + .../v3/model/EventNotifications.java | 204 + .../v3/model/FailedControls.java | 141 + .../v3/model/GetControlLibraryOptions.java | 159 + .../v3/model/GetLatestReportsOptions.java | 149 + .../v3/model/GetProfileAttachmentOptions.java | 189 + .../v3/model/GetProfileOptions.java | 159 + .../v3/model/GetProviderTypeByIdOptions.java | 159 + .../model/GetProviderTypeInstanceOptions.java | 189 + .../GetProviderTypesInstancesOptions.java | 122 + .../v3/model/GetReportControlsOptions.java | 343 + .../v3/model/GetReportEvaluationOptions.java | 185 + .../v3/model/GetReportOptions.java | 159 + .../v3/model/GetReportRuleOptions.java | 189 + .../v3/model/GetReportSummaryOptions.java | 159 + .../v3/model/GetReportTagsOptions.java | 159 + .../GetReportViolationsDriftOptions.java | 185 + .../v3/model/GetRuleOptions.java | 159 + .../v3/model/GetSettingsOptions.java | 122 + .../v3/model/Implementation.java | 248 + .../v3/model/Import.java | 112 + .../v3/model/LabelType.java | 49 + .../v3/model/LastScan.java | 156 + .../model/ListAttachmentsAccountOptions.java | 174 + .../v3/model/ListAttachmentsOptions.java | 211 + .../v3/model/ListControlLibrariesOptions.java | 200 + .../v3/model/ListProfilesOptions.java | 200 + .../ListProviderTypeInstancesOptions.java | 159 + .../v3/model/ListProviderTypesOptions.java | 122 + .../model/ListReportEvaluationsOptions.java | 355 + .../v3/model/ListReportResourcesOptions.java | 397 + .../v3/model/ListReportsOptions.java | 315 + .../v3/model/ListRulesOptions.java | 200 + .../v3/model/MultiCloudScope.java | 155 + .../v3/model/ObjectStorage.java | 203 + .../v3/model/PageHRef.java | 37 + .../v3/model/PageHRefFirst.java | 37 + .../v3/model/PageHRefNext.java | 49 + .../v3/model/PaginatedCollectionFirst.java | 37 + .../v3/model/PaginatedCollectionNext.java | 49 + .../v3/model/Parameter.java | 192 + .../v3/model/ParameterInfo.java | 195 + .../v3/model/PostTestEventOptions.java | 122 + .../v3/model/Profile.java | 270 + .../v3/model/ProfileCollection.java | 89 + .../v3/model/ProfileControls.java | 171 + .../v3/model/ProfileControlsPrototype.java | 121 + .../v3/model/ProfileInfo.java | 61 + .../v3/model/ProfileItem.java | 195 + .../v3/model/ProfilesPager.java | 107 + .../v3/model/Property.java | 89 + .../v3/model/PropertyItem.java | 118 + .../v3/model/ProviderTypeInstanceItem.java | 103 + .../model/ProviderTypeInstancesResponse.java | 41 + .../v3/model/ProviderTypeItem.java | 194 + .../v3/model/ProviderTypesCollection.java | 41 + .../model/ProviderTypesInstancesResponse.java | 41 + .../ReplaceCustomControlLibraryOptions.java | 632 ++ .../ReplaceProfileAttachmentOptions.java | 718 ++ .../v3/model/ReplaceProfileOptions.java | 356 + .../v3/model/ReplaceRuleOptions.java | 417 + .../v3/model/Report.java | 151 + .../v3/model/ReportControls.java | 157 + .../v3/model/ReportEvaluationsPager.java | 111 + .../v3/model/ReportLatest.java | 91 + .../v3/model/ReportPage.java | 114 + .../v3/model/ReportResourcesPager.java | 111 + .../v3/model/ReportSummary.java | 112 + .../v3/model/ReportTags.java | 51 + .../v3/model/ReportViolationDataPoint.java | 77 + .../v3/model/ReportViolationsDrift.java | 67 + .../v3/model/ReportsPager.java | 111 + .../v3/model/RequiredConfig.java | 156 + .../v3/model/RequiredConfigItems.java | 156 + .../RequiredConfigItemsRequiredConfigAnd.java | 112 + ...RequiredConfigItemsRequiredConfigBase.java | 187 + .../RequiredConfigItemsRequiredConfigOr.java | 112 + .../RequiredConfigRequiredConfigAnd.java | 112 + .../RequiredConfigRequiredConfigBase.java | 187 + .../model/RequiredConfigRequiredConfigOr.java | 112 + .../v3/model/Resource.java | 192 + .../v3/model/ResourcePage.java | 127 + .../v3/model/ResourceSummary.java | 132 + .../v3/model/ResourceSummaryItem.java | 177 + .../v3/model/Rule.java | 202 + .../v3/model/RuleInfo.java | 153 + .../v3/model/RulesPageBase.java | 90 + .../v3/model/Scan.java | 160 + .../v3/model/ScopeProperty.java | 49 + .../v3/model/Settings.java | 121 + .../v3/model/Tags.java | 63 + .../v3/model/Target.java | 210 + .../v3/model/TargetInfo.java | 90 + .../v3/model/TestEvent.java | 37 + .../UpdateProviderTypeInstanceOptions.java | 243 + .../v3/model/UpdateSettingsOptions.java | 186 + .../v3/package-info.java | 16 + .../v3/SecurityAndComplianceCenterApiIT.java | 1916 ++++ .../SecurityAndComplianceCenterApiTest.java | 3475 +++++++ .../v3/model/AccountTest.java | 39 + .../v3/model/AdditionalPropertyTest.java | 38 + .../model/AdditionalTargetAttributeTest.java | 51 + .../v3/model/AssessmentTest.java | 43 + .../v3/model/AttachmentCollectionTest.java | 51 + .../v3/model/AttachmentItemTest.java | 150 + .../AttachmentParameterPrototypeTest.java | 60 + .../v3/model/AttachmentPrototypeTest.java | 121 + .../v3/model/AttachmentScopeTest.java | 40 + .../v3/model/AttachmentTest.java | 43 + ...AttachmentsNotificationsPrototypeTest.java | 62 + .../v3/model/AttachmentsPrototypeTest.java | 118 + .../v3/model/ComplianceScoreTest.java | 39 + .../v3/model/ComplianceStatsTest.java | 42 + .../v3/model/ControlDocsTest.java | 48 + .../model/ControlLibraryCollectionTest.java | 45 + .../v3/model/ControlLibraryDeleteTest.java | 37 + .../v3/model/ControlLibraryItemTest.java | 49 + .../v3/model/ControlLibraryTest.java | 170 + .../ControlSpecificationWithStatsTest.java | 50 + .../v3/model/ControlSpecificationsTest.java | 93 + .../v3/model/ControlWithStatsTest.java | 53 + .../v3/model/ControlsInControlLibTest.java | 126 + .../v3/model/CreateAttachmentOptionsTest.java | 121 + ...CreateCustomControlLibraryOptionsTest.java | 143 + .../v3/model/CreateProfileOptionsTest.java | 81 + ...CreateProviderTypeInstanceOptionsTest.java | 53 + .../v3/model/CreateRuleOptionsTest.java | 115 + .../v3/model/CreateScanOptionsTest.java | 49 + .../model/DefaultParametersPrototypeTest.java | 60 + ...DeleteCustomControlLibraryOptionsTest.java | 49 + .../model/DeleteCustomProfileOptionsTest.java | 49 + .../DeleteProfileAttachmentOptionsTest.java | 51 + ...DeleteProviderTypeInstanceOptionsTest.java | 51 + .../v3/model/DeleteRuleOptionsTest.java | 49 + .../v3/model/EvalDetailsTest.java | 38 + .../v3/model/EvalStatsTest.java | 42 + .../v3/model/EvaluationPageTest.java | 51 + .../v3/model/EvaluationTest.java | 51 + .../v3/model/EventNotificationsTest.java | 58 + .../v3/model/FailedControlsTest.java | 47 + .../model/GetControlLibraryOptionsTest.java | 49 + .../v3/model/GetLatestReportsOptionsTest.java | 43 + .../GetProfileAttachmentOptionsTest.java | 51 + .../v3/model/GetProfileOptionsTest.java | 49 + .../model/GetProviderTypeByIdOptionsTest.java | 49 + .../GetProviderTypeInstanceOptionsTest.java | 51 + .../GetProviderTypesInstancesOptionsTest.java | 41 + .../model/GetReportControlsOptionsTest.java | 61 + .../model/GetReportEvaluationOptionsTest.java | 51 + .../v3/model/GetReportOptionsTest.java | 49 + .../v3/model/GetReportRuleOptionsTest.java | 51 + .../v3/model/GetReportSummaryOptionsTest.java | 49 + .../v3/model/GetReportTagsOptionsTest.java | 49 + .../GetReportViolationsDriftOptionsTest.java | 51 + .../v3/model/GetRuleOptionsTest.java | 49 + .../v3/model/GetSettingsOptionsTest.java | 41 + .../v3/model/ImplementationTest.java | 71 + .../v3/model/ImportTest.java | 56 + .../v3/model/LabelTypeTest.java | 38 + .../v3/model/LastScanTest.java | 52 + .../ListAttachmentsAccountOptionsTest.java | 45 + .../v3/model/ListAttachmentsOptionsTest.java | 53 + .../ListControlLibrariesOptionsTest.java | 47 + .../v3/model/ListProfilesOptionsTest.java | 47 + .../ListProviderTypeInstancesOptionsTest.java | 49 + .../model/ListProviderTypesOptionsTest.java | 41 + .../ListReportEvaluationsOptionsTest.java | 63 + .../model/ListReportResourcesOptionsTest.java | 65 + .../v3/model/ListReportsOptionsTest.java | 55 + .../v3/model/ListRulesOptionsTest.java | 47 + .../v3/model/MultiCloudScopeTest.java | 61 + .../v3/model/ObjectStorageTest.java | 58 + .../v3/model/PageHRefFirstTest.java | 37 + .../v3/model/PageHRefNextTest.java | 38 + .../v3/model/PageHRefTest.java | 37 + .../model/PaginatedCollectionFirstTest.java | 37 + .../v3/model/PaginatedCollectionNextTest.java | 38 + .../v3/model/ParameterInfoTest.java | 54 + .../v3/model/ParameterTest.java | 54 + .../v3/model/PostTestEventOptionsTest.java | 41 + .../v3/model/ProfileCollectionTest.java | 45 + .../model/ProfileControlsPrototypeTest.java | 48 + .../v3/model/ProfileControlsTest.java | 51 + .../v3/model/ProfileInfoTest.java | 39 + .../v3/model/ProfileItemTest.java | 49 + .../v3/model/ProfileTest.java | 60 + .../v3/model/PropertyItemTest.java | 48 + .../v3/model/PropertyTest.java | 41 + .../model/ProviderTypeInstanceItemTest.java | 42 + .../ProviderTypeInstancesResponseTest.java | 39 + .../v3/model/ProviderTypeItemTest.java | 51 + .../v3/model/ProviderTypesCollectionTest.java | 41 + .../ProviderTypesInstancesResponseTest.java | 39 + ...eplaceCustomControlLibraryOptionsTest.java | 162 + .../ReplaceProfileAttachmentOptionsTest.java | 144 + .../v3/model/ReplaceProfileOptionsTest.java | 83 + .../v3/model/ReplaceRuleOptionsTest.java | 119 + .../v3/model/ReportControlsTest.java | 49 + .../v3/model/ReportLatestTest.java | 50 + .../v3/model/ReportPageTest.java | 50 + .../v3/model/ReportSummaryTest.java | 50 + .../v3/model/ReportTagsTest.java | 39 + .../v3/model/ReportTest.java | 51 + .../model/ReportViolationDataPointTest.java | 41 + .../v3/model/ReportViolationsDriftTest.java | 41 + ...uiredConfigItemsRequiredConfigAndTest.java | 45 + ...iredConfigItemsRequiredConfigBaseTest.java | 60 + ...quiredConfigItemsRequiredConfigOrTest.java | 45 + .../v3/model/RequiredConfigItemsTest.java | 38 + .../RequiredConfigRequiredConfigAndTest.java | 53 + .../RequiredConfigRequiredConfigBaseTest.java | 60 + .../RequiredConfigRequiredConfigOrTest.java | 53 + .../v3/model/RequiredConfigTest.java | 39 + .../v3/model/ResourcePageTest.java | 47 + .../v3/model/ResourceSummaryItemTest.java | 48 + .../v3/model/ResourceSummaryTest.java | 45 + .../v3/model/ResourceTest.java | 49 + .../v3/model/RuleInfoTest.java | 46 + .../v3/model/RuleTest.java | 55 + .../v3/model/RulesPageBaseTest.java | 51 + .../v3/model/ScanTest.java | 45 + .../v3/model/ScopePropertyTest.java | 38 + .../v3/model/SettingsTest.java | 77 + .../v3/model/TagsTest.java | 39 + .../v3/model/TargetInfoTest.java | 41 + .../v3/model/TargetTest.java | 69 + .../v3/model/TestEventTest.java | 37 + ...UpdateProviderTypeInstanceOptionsTest.java | 55 + .../v3/model/UpdateSettingsOptionsTest.java | 74 + .../v3/utils/TestUtilities.java | 129 + package-lock.json | 9040 +++++------------ package.json | 7 +- pom.xml | 145 +- 286 files changed, 42093 insertions(+), 6866 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java rename modules/common/src/main/java/com/ibm/cloud/{scc => security_and_compliance_center_api}/common/SdkCommon.java (88%) delete mode 100644 modules/common/src/main/resources/my-services.properties create mode 100644 modules/common/src/main/resources/security-and-compliance-center-sdk.properties rename modules/common/src/test/java/com/ibm/cloud/{scc => security_and_compliance_center_api}/test/SdkCommonTest.java (85%) rename modules/common/src/test/java/com/ibm/cloud/{scc => security_and_compliance_center_api}/test/SdkIntegrationTestBase.java (96%) create mode 100644 modules/security-and-compliance-center-api/pom.xml create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Account.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalProperty.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttribute.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Assessment.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Attachment.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollection.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItem.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototype.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototype.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScope.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsAccountPager.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototype.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPager.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototype.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScore.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStats.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocs.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrariesPager.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrary.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollection.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDelete.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItem.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStats.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStats.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLib.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototype.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetails.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStats.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Evaluation.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPage.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotifications.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControls.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Implementation.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Import.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelType.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScan.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScope.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorage.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRef.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirst.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNext.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirst.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNext.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Parameter.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfo.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Profile.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControls.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototype.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfo.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItem.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfilesPager.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Property.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItem.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponse.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItem.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollection.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponse.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Report.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControls.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportEvaluationsPager.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatest.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPage.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportResourcesPager.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummary.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTags.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPoint.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDrift.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportsPager.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAnd.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBase.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOr.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAnd.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBase.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOr.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Resource.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePage.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummary.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItem.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Rule.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfo.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBase.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Scan.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopeProperty.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Settings.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Tags.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfo.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEvent.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptions.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/package-info.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AccountTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalPropertyTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttributeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AssessmentTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollectionTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItemTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScopeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScoreTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStatsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollectionTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDeleteTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItemTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStatsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStatsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetailsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStatsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPageTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControlsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImplementationTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImportTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelTypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScanTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScopeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorageTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirstTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNextTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirstTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNextTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfoTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollectionTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfoTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItemTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItemTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItemTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollectionTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControlsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatestTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPageTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummaryTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTagsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPointTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDriftTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBaseTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBaseTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePageTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItemTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfoTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScanTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopePropertyTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TagsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfoTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEventTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/utils/TestUtilities.java diff --git a/.gitignore b/.gitignore index 73008e3e..f96e4fa2 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,7 @@ hs_err_pid* package-lock.json # Examples depedency file -/**/dependency-reduced-pom.xml \ No newline at end of file +/**/dependency-reduced-pom.xml + +*.iml +*.DS_Store \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..c5f3f6b9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java b/examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java new file mode 100644 index 00000000..7f74754d --- /dev/null +++ b/examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java @@ -0,0 +1,1271 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3; + +import com.ibm.cloud.sdk.core.http.Response; +import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException; +import com.ibm.cloud.sdk.core.util.CredentialUtils; +import com.ibm.cloud.sdk.core.util.GsonSingleton; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsAccountPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrariesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryDelete; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlsInControlLib; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateScanOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DefaultParametersPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Evaluation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EventNotifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetLatestReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeByIdOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypesInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportControlsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportEvaluationOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportSummaryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportTagsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportViolationsDriftOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsAccountOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListControlLibrariesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProfilesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypeInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportEvaluationsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportResourcesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListRulesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ObjectStorage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PostTestEventOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Profile; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControlsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfilesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Report; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportEvaluationsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportLatest; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportResourcesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportTags; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RuleInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RulesPageBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Scan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Settings; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class contains examples of how to use the Security and Compliance Center API service. + * + * The following configuration properties are assumed to be defined: + * SECURITY_AND_COMPLIANCE_CENTER_API_URL=<service base url> + * SECURITY_AND_COMPLIANCE_CENTER_API_AUTH_TYPE=iam + * SECURITY_AND_COMPLIANCE_CENTER_API_APIKEY=<IAM apikey> + * SECURITY_AND_COMPLIANCE_CENTER_API_AUTH_URL=<IAM token service base URL - omit this if using the production environment> + * + * These configuration properties can be exported as environment variables, or stored + * in a configuration file and then: + * export IBM_CREDENTIALS_FILE=<name of configuration file> + */ +public class SecurityAndComplianceCenterApiExamples { + private static final Logger logger = LoggerFactory.getLogger(SecurityAndComplianceCenterApiExamples.class); + protected SecurityAndComplianceCenterApiExamples() { } + + static { + System.setProperty("IBM_CREDENTIALS_FILE", "../../security_and_compliance_center_api_v3.env"); + } + + /** + * The main() function invokes operations of the Security and Compliance Center API service. + * @param args command-line arguments + * @throws Exception an error occurred + */ + @SuppressWarnings("checkstyle:methodlength") + public static void main(String[] args) throws Exception { + SecurityAndComplianceCenterApi securityAndComplianceCenterApiService = SecurityAndComplianceCenterApi.newInstance(); + + // Load up our test-specific config properties. + Map testConfigProperties = CredentialUtils.getServiceProperties(SecurityAndComplianceCenterApi.DEFAULT_SERVICE_NAME); + + // Variables to hold link values + String accountIdForReportLink = null; + String attachmentIdForReportLink = null; + String attachmentIdLink = null; + String controlLibraryIdLink = null; + String eTagLink = null; + String eventNotificationsCrnForUpdateSettingsLink = null; + String groupIdForReportLink = null; + String objectStorageBucketForUpdateSettingsLink = null; + String objectStorageCrnForUpdateSettingsLink = null; + String objectStorageLocationForUpdateSettingsLink = null; + String profileIdForReportLink = null; + String profileIdLink = null; + String providerTypeIdLink = null; + String providerTypeInstanceIdLink = null; + String reportIdForReportLink = null; + String ruleIdLink = null; + String typeForReportLink = null; + + try { + System.out.println("getSettings() result:"); + // begin-get_settings + GetSettingsOptions getSettingsOptions = new GetSettingsOptions.Builder() + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .build(); + + Response response = securityAndComplianceCenterApiService.getSettings(getSettingsOptions).execute(); + Settings settings = response.getResult(); + + System.out.println(settings); + // end-get_settings + + eventNotificationsCrnForUpdateSettingsLink = settings.eventNotifications().instanceCrn(); + objectStorageCrnForUpdateSettingsLink = settings.objectStorage().instanceCrn(); + objectStorageBucketForUpdateSettingsLink = settings.objectStorage().bucket(); + objectStorageLocationForUpdateSettingsLink = settings.objectStorage().bucketLocation(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("createRule() result:"); + // begin-create_rule + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("location") + .operator("string_equals") + .value("us-east") + .build(); + Target targetModel = new Target.Builder() + .serviceName("cloud-object-storage") + .resourceKind("bucket") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .property("hard_quota") + .operator("num_equals") + .value("${hard_quota}") + .build(); + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("The Cloud Object Storage rule.") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + Parameter parameterModel = new Parameter.Builder() + .name("hard_quota") + .displayName("The Cloud Object Storage bucket quota.") + .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") + .type("numeric") + .build(); + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + CreateRuleOptions createRuleOptions = new CreateRuleOptions.Builder() + .description("Example rule") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .version("1.0.0") + .xImport(importModel) + .labels(java.util.Arrays.asList()) + .build(); + + Response response = securityAndComplianceCenterApiService.createRule(createRuleOptions).execute(); + Rule rule = response.getResult(); + + System.out.println(rule); + // end-create_rule + + ruleIdLink = rule.getId(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getRule() result:"); + // begin-get_rule + GetRuleOptions getRuleOptions = new GetRuleOptions.Builder() + .ruleId(ruleIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getRule(getRuleOptions).execute(); + Rule rule = response.getResult(); + + System.out.println(rule); + // end-get_rule + + eTagLink = response.getHeaders().values("ETag").get(0); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getLatestReports() result:"); + // begin-get_latest_reports + GetLatestReportsOptions getLatestReportsOptions = new GetLatestReportsOptions.Builder() + .sort("profile_name") + .build(); + + Response response = securityAndComplianceCenterApiService.getLatestReports(getLatestReportsOptions).execute(); + ReportLatest reportLatest = response.getResult(); + + System.out.println(reportLatest); + // end-get_latest_reports + + accountIdForReportLink = reportLatest.getReports().get(0).getAccount().getId(); + reportIdForReportLink = reportLatest.getReports().get(0).getId(); + attachmentIdForReportLink = reportLatest.getReports().get(0).getAttachment().getId(); + groupIdForReportLink = reportLatest.getReports().get(0).getGroupId(); + profileIdForReportLink = reportLatest.getReports().get(0).getProfile().getId(); + typeForReportLink = reportLatest.getReports().get(0).getType(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("updateSettings() result:"); + // begin-update_settings + EventNotifications eventNotificationsModel = new EventNotifications.Builder() + .instanceCrn(eventNotificationsCrnForUpdateSettingsLink) + .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") + .sourceName("compliance") + .build(); + ObjectStorage objectStorageModel = new ObjectStorage.Builder() + .instanceCrn(objectStorageCrnForUpdateSettingsLink) + .bucket(objectStorageBucketForUpdateSettingsLink) + .bucketLocation(objectStorageLocationForUpdateSettingsLink) + .build(); + UpdateSettingsOptions updateSettingsOptions = new UpdateSettingsOptions.Builder() + .eventNotifications(eventNotificationsModel) + .objectStorage(objectStorageModel) + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .build(); + + Response response = securityAndComplianceCenterApiService.updateSettings(updateSettingsOptions).execute(); + Settings settings = response.getResult(); + + System.out.println(settings); + // end-update_settings + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("postTestEvent() result:"); + // begin-post_test_event + PostTestEventOptions postTestEventOptions = new PostTestEventOptions.Builder() + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .build(); + + Response response = securityAndComplianceCenterApiService.postTestEvent(postTestEventOptions).execute(); + TestEvent testEvent = response.getResult(); + + System.out.println(testEvent); + // end-post_test_event + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("createCustomControlLibrary() result:"); + // begin-create_custom_control_library + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("session_invalidation_in_seconds") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .componentId("iam-identity") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") + .build(); + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .build(); + CreateCustomControlLibraryOptions createCustomControlLibraryOptions = new CreateCustomControlLibraryOptions.Builder() + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .versionGroupLabel("33fc7b80-0fa5-4f16-bbba-1f293f660f0d") + .controlLibraryVersion("1.0.0") + .build(); + + Response response = securityAndComplianceCenterApiService.createCustomControlLibrary(createCustomControlLibraryOptions).execute(); + ControlLibrary controlLibrary = response.getResult(); + + System.out.println(controlLibrary); + // end-create_custom_control_library + + controlLibraryIdLink = controlLibrary.id(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listControlLibraries() result:"); + // begin-list_control_libraries + ListControlLibrariesOptions listControlLibrariesOptions = new ListControlLibrariesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .controlLibraryType("custom") + .build(); + + ControlLibrariesPager pager = new ControlLibrariesPager(securityAndComplianceCenterApiService, listControlLibrariesOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } + + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_control_libraries + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getControlLibrary() result:"); + // begin-get_control_library + GetControlLibraryOptions getControlLibraryOptions = new GetControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getControlLibrary(getControlLibraryOptions).execute(); + ControlLibrary controlLibrary = response.getResult(); + + System.out.println(controlLibrary); + // end-get_control_library + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("replaceCustomControlLibrary() result:"); + // begin-replace_custom_control_library + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("session_invalidation_in_seconds") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .responsibility("user") + .componentId("iam-identity") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") + .build(); + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .build(); + ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions = new ReplaceCustomControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .controlLibraryVersion("1.1.0") + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .build(); + + Response response = securityAndComplianceCenterApiService.replaceCustomControlLibrary(replaceCustomControlLibraryOptions).execute(); + ControlLibrary controlLibrary = response.getResult(); + + System.out.println(controlLibrary); + // end-replace_custom_control_library + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("createProfile() result:"); + // begin-create_profile + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId(controlLibraryIdLink) + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .build(); + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + CreateProfileOptions createProfileOptions = new CreateProfileOptions.Builder() + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .build(); + + Response response = securityAndComplianceCenterApiService.createProfile(createProfileOptions).execute(); + Profile profile = response.getResult(); + + System.out.println(profile); + // end-create_profile + + profileIdLink = profile.getId(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listProfiles() result:"); + // begin-list_profiles + ListProfilesOptions listProfilesOptions = new ListProfilesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .profileType("custom") + .build(); + + ProfilesPager pager = new ProfilesPager(securityAndComplianceCenterApiService, listProfilesOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } + + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_profiles + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getProfile() result:"); + // begin-get_profile + GetProfileOptions getProfileOptions = new GetProfileOptions.Builder() + .profilesId(profileIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getProfile(getProfileOptions).execute(); + Profile profile = response.getResult(); + + System.out.println(profile); + // end-get_profile + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("replaceProfile() result:"); + // begin-replace_profile + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId(controlLibraryIdLink) + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .build(); + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + ReplaceProfileOptions replaceProfileOptions = new ReplaceProfileOptions.Builder() + .profilesId(profileIdLink) + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .build(); + + Response response = securityAndComplianceCenterApiService.replaceProfile(replaceProfileOptions).execute(); + Profile profile = response.getResult(); + + System.out.println(profile); + // end-replace_profile + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listRules() result:"); + // begin-list_rules + ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() + .type("system_defined") + .build(); + + Response response = securityAndComplianceCenterApiService.listRules(listRulesOptions).execute(); + RulesPageBase rulesPageBase = response.getResult(); + + System.out.println(rulesPageBase); + // end-list_rules + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("replaceRule() result:"); + // begin-replace_rule + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("location") + .operator("string_equals") + .value("us-south") + .build(); + Target targetModel = new Target.Builder() + .serviceName("cloud-object-storage") + .serviceDisplayName("Cloud Object Storage") + .resourceKind("bucket") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .property("hard_quota") + .operator("num_equals") + .value("${hard_quota}") + .build(); + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("The Cloud Object Storage rule.") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + Parameter parameterModel = new Parameter.Builder() + .name("hard_quota") + .displayName("The Cloud Object Storage bucket quota.") + .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") + .type("numeric") + .build(); + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + ReplaceRuleOptions replaceRuleOptions = new ReplaceRuleOptions.Builder() + .ruleId(ruleIdLink) + .ifMatch(eTagLink) + .description("Example rule") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .type("user_defined") + .version("1.0.1") + .xImport(importModel) + .labels(java.util.Arrays.asList()) + .build(); + + Response response = securityAndComplianceCenterApiService.replaceRule(replaceRuleOptions).execute(); + Rule rule = response.getResult(); + + System.out.println(rule); + // end-replace_rule + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("createAttachment() result:"); + // begin-create_attachment + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("scope_id") + .value("cg3335893hh1428692d6747cf300yeb5") + .build(); + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .build(); + CreateAttachmentOptions createAttachmentOptions = new CreateAttachmentOptions.Builder() + .profilesId(profileIdLink) + .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) + .build(); + + Response response = securityAndComplianceCenterApiService.createAttachment(createAttachmentOptions).execute(); + AttachmentPrototype attachmentPrototype = response.getResult(); + + System.out.println(attachmentPrototype); + // end-create_attachment + + attachmentIdLink = attachmentPrototype.attachments().get(0).id(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listAttachments() result:"); + // begin-list_attachments + ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() + .profilesId(profileIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .build(); + + AttachmentsPager pager = new AttachmentsPager(securityAndComplianceCenterApiService, listAttachmentsOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } + + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_attachments + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getProfileAttachment() result:"); + // begin-get_profile_attachment + GetProfileAttachmentOptions getProfileAttachmentOptions = new GetProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profilesId(profileIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getProfileAttachment(getProfileAttachmentOptions).execute(); + AttachmentItem attachmentItem = response.getResult(); + + System.out.println(attachmentItem); + // end-get_profile_attachment + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("replaceProfileAttachment() result:"); + // begin-replace_profile_attachment + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("scope_id") + .value("cg3335893hh1428692d6747cf300yeb5") + .build(); + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions = new ReplaceProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profilesId(profileIdLink) + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") + .build(); + + Response response = securityAndComplianceCenterApiService.replaceProfileAttachment(replaceProfileAttachmentOptions).execute(); + AttachmentItem attachmentItem = response.getResult(); + + System.out.println(attachmentItem); + // end-replace_profile_attachment + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("createScan() result:"); + // begin-create_scan + CreateScanOptions createScanOptions = new CreateScanOptions.Builder() + .attachmentId(attachmentIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.createScan(createScanOptions).execute(); + Scan scan = response.getResult(); + + System.out.println(scan); + // end-create_scan + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listAttachmentsAccount() result:"); + // begin-list_attachments_account + ListAttachmentsAccountOptions listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .build(); + + AttachmentsAccountPager pager = new AttachmentsAccountPager(securityAndComplianceCenterApiService, listAttachmentsAccountOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } + + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_attachments_account + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listReports() result:"); + // begin-list_reports + ListReportsOptions listReportsOptions = new ListReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .attachmentId(attachmentIdForReportLink) + .groupId(groupIdForReportLink) + .profileId(profileIdForReportLink) + .type(typeForReportLink) + .limit(Long.valueOf("10")) + .sort("profile_name") + .build(); + + ReportsPager pager = new ReportsPager(securityAndComplianceCenterApiService, listReportsOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } + + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_reports + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getReport() result:"); + // begin-get_report + GetReportOptions getReportOptions = new GetReportOptions.Builder() + .reportId(reportIdForReportLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getReport(getReportOptions).execute(); + Report report = response.getResult(); + + System.out.println(report); + // end-get_report + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getReportSummary() result:"); + // begin-get_report_summary + GetReportSummaryOptions getReportSummaryOptions = new GetReportSummaryOptions.Builder() + .reportId(reportIdForReportLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getReportSummary(getReportSummaryOptions).execute(); + ReportSummary reportSummary = response.getResult(); + + System.out.println(reportSummary); + // end-get_report_summary + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getReportEvaluation() result:"); + // begin-get_report_evaluation + GetReportEvaluationOptions getReportEvaluationOptions = new GetReportEvaluationOptions.Builder() + .reportId(reportIdForReportLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getReportEvaluation(getReportEvaluationOptions).execute(); + InputStream inputStream = response.getResult(); + + System.out.println(inputStream); + // end-get_report_evaluation + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getReportControls() result:"); + // begin-get_report_controls + GetReportControlsOptions getReportControlsOptions = new GetReportControlsOptions.Builder() + .reportId(reportIdForReportLink) + .status("compliant") + .build(); + + Response response = securityAndComplianceCenterApiService.getReportControls(getReportControlsOptions).execute(); + ReportControls reportControls = response.getResult(); + + System.out.println(reportControls); + // end-get_report_controls + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getReportRule() result:"); + // begin-get_report_rule + GetReportRuleOptions getReportRuleOptions = new GetReportRuleOptions.Builder() + .reportId(reportIdForReportLink) + .ruleId("rule-8d444f8c-fd1d-48de-bcaa-f43732568761") + .build(); + + Response response = securityAndComplianceCenterApiService.getReportRule(getReportRuleOptions).execute(); + RuleInfo ruleInfo = response.getResult(); + + System.out.println(ruleInfo); + // end-get_report_rule + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listReportEvaluations() result:"); + // begin-list_report_evaluations + ListReportEvaluationsOptions listReportEvaluationsOptions = new ListReportEvaluationsOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .assessmentId("testString") + .componentId("testString") + .targetId("testString") + .targetName("testString") + .status("failure") + .limit(Long.valueOf("10")) + .build(); + + ReportEvaluationsPager pager = new ReportEvaluationsPager(securityAndComplianceCenterApiService, listReportEvaluationsOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } + + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_report_evaluations + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listReportResources() result:"); + // begin-list_report_resources + ListReportResourcesOptions listReportResourcesOptions = new ListReportResourcesOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .id("testString") + .resourceName("testString") + .accountId(accountIdForReportLink) + .componentId("testString") + .status("compliant") + .sort("account_id") + .limit(Long.valueOf("10")) + .build(); + + ReportResourcesPager pager = new ReportResourcesPager(securityAndComplianceCenterApiService, listReportResourcesOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } + + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_report_resources + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getReportTags() result:"); + // begin-get_report_tags + GetReportTagsOptions getReportTagsOptions = new GetReportTagsOptions.Builder() + .reportId(reportIdForReportLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getReportTags(getReportTagsOptions).execute(); + ReportTags reportTags = response.getResult(); + + System.out.println(reportTags); + // end-get_report_tags + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getReportViolationsDrift() result:"); + // begin-get_report_violations_drift + GetReportViolationsDriftOptions getReportViolationsDriftOptions = new GetReportViolationsDriftOptions.Builder() + .reportId(reportIdForReportLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getReportViolationsDrift(getReportViolationsDriftOptions).execute(); + ReportViolationsDrift reportViolationsDrift = response.getResult(); + + System.out.println(reportViolationsDrift); + // end-get_report_violations_drift + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listProviderTypes() result:"); + // begin-list_provider_types + ListProviderTypesOptions listProviderTypesOptions = new ListProviderTypesOptions.Builder() + .build(); + + Response response = securityAndComplianceCenterApiService.listProviderTypes(listProviderTypesOptions).execute(); + ProviderTypesCollection providerTypesCollection = response.getResult(); + + System.out.println(providerTypesCollection); + // end-list_provider_types + + providerTypeIdLink = providerTypesCollection.getProviderTypes().get(0).getId(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getProviderTypeById() result:"); + // begin-get_provider_type_by_id + GetProviderTypeByIdOptions getProviderTypeByIdOptions = new GetProviderTypeByIdOptions.Builder() + .providerTypeId(providerTypeIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getProviderTypeById(getProviderTypeByIdOptions).execute(); + ProviderTypeItem providerTypeItem = response.getResult(); + + System.out.println(providerTypeItem); + // end-get_provider_type_by_id + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listProviderTypeInstances() result:"); + // begin-list_provider_type_instances + ListProviderTypeInstancesOptions listProviderTypeInstancesOptions = new ListProviderTypeInstancesOptions.Builder() + .providerTypeId(providerTypeIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.listProviderTypeInstances(listProviderTypeInstancesOptions).execute(); + ProviderTypeInstancesResponse providerTypeInstancesResponse = response.getResult(); + + System.out.println(providerTypeInstancesResponse); + // end-list_provider_type_instances + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("createProviderTypeInstance() result:"); + // begin-create_provider_type_instance + CreateProviderTypeInstanceOptions createProviderTypeInstanceOptions = new CreateProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.createProviderTypeInstance(createProviderTypeInstanceOptions).execute(); + ProviderTypeInstanceItem providerTypeInstanceItem = response.getResult(); + + System.out.println(providerTypeInstanceItem); + // end-create_provider_type_instance + + providerTypeInstanceIdLink = providerTypeInstanceItem.getId(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getProviderTypeInstance() result:"); + // begin-get_provider_type_instance + GetProviderTypeInstanceOptions getProviderTypeInstanceOptions = new GetProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .providerTypeInstanceId(providerTypeInstanceIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getProviderTypeInstance(getProviderTypeInstanceOptions).execute(); + ProviderTypeInstanceItem providerTypeInstanceItem = response.getResult(); + + System.out.println(providerTypeInstanceItem); + // end-get_provider_type_instance + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("updateProviderTypeInstance() result:"); + // begin-update_provider_type_instance + UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptions = new UpdateProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .providerTypeInstanceId(providerTypeInstanceIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.updateProviderTypeInstance(updateProviderTypeInstanceOptions).execute(); + ProviderTypeInstanceItem providerTypeInstanceItem = response.getResult(); + + System.out.println(providerTypeInstanceItem); + // end-update_provider_type_instance + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getProviderTypesInstances() result:"); + // begin-get_provider_types_instances + GetProviderTypesInstancesOptions getProviderTypesInstancesOptions = new GetProviderTypesInstancesOptions.Builder() + .build(); + + Response response = securityAndComplianceCenterApiService.getProviderTypesInstances(getProviderTypesInstancesOptions).execute(); + ProviderTypesInstancesResponse providerTypesInstancesResponse = response.getResult(); + + System.out.println(providerTypesInstancesResponse); + // end-get_provider_types_instances + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("deleteCustomProfile() result:"); + // begin-delete_custom_profile + DeleteCustomProfileOptions deleteCustomProfileOptions = new DeleteCustomProfileOptions.Builder() + .profilesId(profileIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.deleteCustomProfile(deleteCustomProfileOptions).execute(); + Profile profile = response.getResult(); + + System.out.println(profile); + // end-delete_custom_profile + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("deleteCustomControlLibrary() result:"); + // begin-delete_custom_control_library + DeleteCustomControlLibraryOptions deleteCustomControlLibraryOptions = new DeleteCustomControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.deleteCustomControlLibrary(deleteCustomControlLibraryOptions).execute(); + ControlLibraryDelete controlLibraryDelete = response.getResult(); + + System.out.println(controlLibraryDelete); + // end-delete_custom_control_library + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + // begin-delete_rule + DeleteRuleOptions deleteRuleOptions = new DeleteRuleOptions.Builder() + .ruleId(ruleIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.deleteRule(deleteRuleOptions).execute(); + // end-delete_rule + System.out.printf("deleteRule() response status code: %d%n", response.getStatusCode()); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("deleteProfileAttachment() result:"); + // begin-delete_profile_attachment + DeleteProfileAttachmentOptions deleteProfileAttachmentOptions = new DeleteProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profilesId(profileIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.deleteProfileAttachment(deleteProfileAttachmentOptions).execute(); + AttachmentItem attachmentItem = response.getResult(); + + System.out.println(attachmentItem); + // end-delete_profile_attachment + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + // begin-delete_provider_type_instance + DeleteProviderTypeInstanceOptions deleteProviderTypeInstanceOptions = new DeleteProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .providerTypeInstanceId(providerTypeInstanceIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.deleteProviderTypeInstance(deleteProviderTypeInstanceOptions).execute(); + // end-delete_provider_type_instance + System.out.printf("deleteProviderTypeInstance() response status code: %d%n", response.getStatusCode()); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + } +} diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 48c9206b..ef988b58 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -1,21 +1,18 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - - scc + security-and-compliance-center-sdk com.ibm.cloud - 3.0.0 + 2.0.0 ../.. - - common + security-and-compliance-center-sdk-common - - IBM Cloud Security & Compliance Center Common Library + Security and Compliance Center SDK Common Library jar @@ -29,13 +26,8 @@ test - org.powermock - powermock-api-mockito2 - test - - - org.powermock - powermock-module-testng + org.slf4j + slf4j-jdk14 test diff --git a/modules/common/src/main/java/com/ibm/cloud/scc/common/SdkCommon.java b/modules/common/src/main/java/com/ibm/cloud/security_and_compliance_center_api/common/SdkCommon.java similarity index 88% rename from modules/common/src/main/java/com/ibm/cloud/scc/common/SdkCommon.java rename to modules/common/src/main/java/com/ibm/cloud/security_and_compliance_center_api/common/SdkCommon.java index 8eb30d04..5bb6228a 100644 --- a/modules/common/src/main/java/com/ibm/cloud/scc/common/SdkCommon.java +++ b/modules/common/src/main/java/com/ibm/cloud/security_and_compliance_center_api/common/SdkCommon.java @@ -1,18 +1,17 @@ /** * Copyright 2019 IBM Corp. All Rights Reserved. - * + *

* Licensed 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. */ -// >>> Replace "my_services" with the correct value for your project -package com.ibm.cloud.scc.common; +package com.ibm.cloud.security_and_compliance_center_api.common; import java.io.InputStream; import java.util.HashMap; @@ -36,8 +35,7 @@ public class SdkCommon { private static String projectName; private static String version; - // >>> Replace "my-services" with the parent project's artifactId (e.g. platform-services) - private static String parentArtifactId = "security-and-compliance-center"; + private static String parentArtifactId = "security-and-compliance-center-sdk"; static { readBuildProperties(); @@ -60,7 +58,7 @@ protected static void readBuildProperties() { buildProps.load(is); version = buildProps.getProperty("version", "unknown"); projectName = buildProps.getProperty("title", "unknown"); - } catch (Throwable t) { + } catch (Throwable t) { version = "unknown"; projectName = "unknown"; } @@ -70,6 +68,7 @@ protected static void readBuildProperties() { * This function uses lazy initialization to build the SDK's "user agent" value. * This will consist of the SDK name and version, followed by * a set of properties provided by the Java Core's RequestUtils class. + * * @return the SDK-specific user agent value */ private static synchronized String getUserAgent() { @@ -91,27 +90,23 @@ private static synchronized String getUserAgent() { * function, it is recommended that you initialize the returned map just once (perhaps by using * lazy initialization) and simply return it each time the function is invoked, instead of building it each time * as in the example below. - * + *

* If you plan to gather metrics for your SDK, the User-Agent header value must * be a string similar to the following: * my-java-sdk/0.0.1 (lang=java; java.vendor=AdoptOpenJDK; java.version=1.8.0_232; os.arch=x86_64; os.name=Linux; os.version=5.1) - * In the example above, the analytics tool will parse the user-agent header and * use the following properties: * "my-java-sdk" - the name of your sdk * "0.0.1"- the version of your sdk * "lang=java" - the language of the current sdk * "java.vendor=AdoptOpenJDK; java.version=1.8.0_232; os.arch=x86_64; os.name=Linux; os.version=5.1" - system information - * + *

* Note: It is very important that the sdk name ends with the string `-sdk`, * as the analytics data collector uses this to gather usage data. * - * @param serviceName - * the name of the service as defined in the API definition (e.g. "MyService1") - * @param serviceVersion - * the version of the service as defined in the API definition (e.g. "V1") - * @param operationId - * the operationId as defined in the API definition (e.g. getContext) + * @param serviceName the name of the service as defined in the API definition (e.g. "MyService1") + * @param serviceVersion the version of the service as defined in the API definition (e.g. "V1") + * @param operationId the operationId as defined in the API definition (e.g. getContext) * @return a Map which contains the set of headers to be included in the REST API request */ public static Map getSdkHeaders(String serviceName, String serviceVersion, String operationId) { diff --git a/modules/common/src/main/resources/my-services.properties b/modules/common/src/main/resources/my-services.properties deleted file mode 100644 index 9e28fec3..00000000 --- a/modules/common/src/main/resources/my-services.properties +++ /dev/null @@ -1,4 +0,0 @@ -title = ${git-repository-name} -gitCommit = ${buildNumber} -buildTimestamp = ${timestamp} -version = ${project.version} diff --git a/modules/common/src/main/resources/security-and-compliance-center-sdk.properties b/modules/common/src/main/resources/security-and-compliance-center-sdk.properties new file mode 100644 index 00000000..3492ea56 --- /dev/null +++ b/modules/common/src/main/resources/security-and-compliance-center-sdk.properties @@ -0,0 +1,4 @@ +title=${git-repository-name} +gitCommit=${buildNumber} +buildTimestamp=${timestamp} +version=${project.version} diff --git a/modules/common/src/test/java/com/ibm/cloud/scc/test/SdkCommonTest.java b/modules/common/src/test/java/com/ibm/cloud/security_and_compliance_center_api/test/SdkCommonTest.java similarity index 85% rename from modules/common/src/test/java/com/ibm/cloud/scc/test/SdkCommonTest.java rename to modules/common/src/test/java/com/ibm/cloud/security_and_compliance_center_api/test/SdkCommonTest.java index 7da9bb12..70a46f1e 100644 --- a/modules/common/src/test/java/com/ibm/cloud/scc/test/SdkCommonTest.java +++ b/modules/common/src/test/java/com/ibm/cloud/security_and_compliance_center_api/test/SdkCommonTest.java @@ -1,18 +1,17 @@ /** * Copyright 2019 IBM Corp. All Rights Reserved. - * + *

* Licensed 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. */ -// >>> Replace "my_services" with the correct value for your project (e.g. "scc") -package com.ibm.cloud.scc.test; +package com.ibm.cloud.security_and_compliance_center_api.test; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotNull; @@ -22,8 +21,7 @@ import org.testng.annotations.Test; -// >>> Replace "my_services" with the correct value for your project (e.g. "scc") -import com.ibm.cloud.scc.common.SdkCommon; +import com.ibm.cloud.security_and_compliance_center_api.common.SdkCommon; /** * This class contains tests for the SdkCommon class. diff --git a/modules/common/src/test/java/com/ibm/cloud/scc/test/SdkIntegrationTestBase.java b/modules/common/src/test/java/com/ibm/cloud/security_and_compliance_center_api/test/SdkIntegrationTestBase.java similarity index 96% rename from modules/common/src/test/java/com/ibm/cloud/scc/test/SdkIntegrationTestBase.java rename to modules/common/src/test/java/com/ibm/cloud/security_and_compliance_center_api/test/SdkIntegrationTestBase.java index 21ad36d1..943708ad 100644 --- a/modules/common/src/test/java/com/ibm/cloud/scc/test/SdkIntegrationTestBase.java +++ b/modules/common/src/test/java/com/ibm/cloud/security_and_compliance_center_api/test/SdkIntegrationTestBase.java @@ -1,17 +1,17 @@ /** * (C) Copyright IBM Corp. 2020. All Rights Reserved. - * + *

* Licensed 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. */ -package com.ibm.cloud.scc.test; +package com.ibm.cloud.security_and_compliance_center_api.test; import java.io.File; @@ -32,6 +32,7 @@ public abstract class SdkIntegrationTestBase { /** * Returns true if and only if test methods within the subclass should be skipped due to * lack of an external configuration file. + * * @return */ protected boolean skipTests() { @@ -42,6 +43,7 @@ protected boolean skipTests() { /** * Each subclass must implement this method in order to provide the name of the * testcase's config file. + * * @return the name of the config file associated with the testcase */ public abstract String getConfigFilename(); diff --git a/modules/coverage-reports/pom.xml b/modules/coverage-reports/pom.xml index 1ba67d0b..7f2e30d1 100644 --- a/modules/coverage-reports/pom.xml +++ b/modules/coverage-reports/pom.xml @@ -1,47 +1,32 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - scc + security-and-compliance-center-sdk com.ibm.cloud - 3.0.0 + 2.0.0 ../.. 4.0.0 - - coverage-reports + security-and-compliance-center-coverage-reports - - IBM Cloud Security & Compliance Center Coverage Reports + Security and Compliance Center SDK Coverage Reports - - true - true + + + - - - common + security-and-compliance-center-sdk-common ${project.groupId} ${project.version} - - - ${project.groupId} - configuration_governance + security-and-compliance-center ${project.version} diff --git a/modules/security-and-compliance-center-api/pom.xml b/modules/security-and-compliance-center-api/pom.xml new file mode 100644 index 00000000..447e9568 --- /dev/null +++ b/modules/security-and-compliance-center-api/pom.xml @@ -0,0 +1,58 @@ + + 4.0.0 + + + security-and-compliance-center-sdk + com.ibm.cloud + 2.0.0 + ../.. + + + security-and-compliance-center + + Security and Compliance Center + jar + + + + com.ibm.cloud + sdk-core + + + security-and-compliance-center-sdk-common + ${project.groupId} + + + security-and-compliance-center-sdk-common + ${project.groupId} + test-jar + tests + test + + + org.testng + testng + test + + + com.squareup.okhttp3 + mockwebserver + test + + + org.slf4j + slf4j-jdk14 + test + + + + + + IBM Cloud DevX SDK Development + devxsdk@us.ibm.com + https://www.ibm.com/ + + + + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java new file mode 100644 index 00000000..7935bb49 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java @@ -0,0 +1,2054 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +/* + * IBM OpenAPI SDK Code Generator Version: 3.76.0-ad3e6f96-20230724-172814 + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3; + +import com.google.gson.JsonObject; +import com.ibm.cloud.security_and_compliance_center_api.common.SdkCommon; +import com.ibm.cloud.sdk.core.http.RequestBuilder; +import com.ibm.cloud.sdk.core.http.ResponseConverter; +import com.ibm.cloud.sdk.core.http.ServiceCall; +import com.ibm.cloud.sdk.core.security.Authenticator; +import com.ibm.cloud.sdk.core.security.ConfigBasedAuthenticatorFactory; +import com.ibm.cloud.sdk.core.service.BaseService; +import com.ibm.cloud.sdk.core.util.ResponseConverterUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryDelete; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateScanOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvaluationPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetLatestReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeByIdOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypesInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportControlsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportEvaluationOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportSummaryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportTagsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportViolationsDriftOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsAccountOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListControlLibrariesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProfilesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypeInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportEvaluationsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportResourcesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListRulesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PostTestEventOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Profile; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Report; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportLatest; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportTags; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourcePage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RuleInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RulesPageBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Scan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Settings; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +/** + * Security and Compliance Center API + * . + * + * API Version: 3.0.0 + */ +public class SecurityAndComplianceCenterApi extends BaseService { + + /** + * Default service name used when configuring the `SecurityAndComplianceCenterApi` client. + */ + public static final String DEFAULT_SERVICE_NAME = "security_and_compliance_center_api"; + + /** + * Default service endpoint URL. + */ + public static final String DEFAULT_SERVICE_URL = "https://us-south.compliance.cloud.ibm.com/instances/instance_id/v3"; + + /** + * The parameterized service endpoint URL. + */ + public static final String PARAMETERIZED_SERVICE_URL = "https://{region}.cloud.ibm.com/instances/{instance_id}/v3"; + + private static final Map defaultUrlVariables = createDefaultUrlVariables(); + + private static Map createDefaultUrlVariables() { + Map map = new HashMap<>(); + map.put("region", "us-south.compliance"); + map.put("instance_id", "instance_id"); + return map; + } + + /** + * Class method which constructs an instance of the `SecurityAndComplianceCenterApi` client. + * The default service name is used to configure the client instance. + * + * @return an instance of the `SecurityAndComplianceCenterApi` client using external configuration + */ + public static SecurityAndComplianceCenterApi newInstance() { + return newInstance(DEFAULT_SERVICE_NAME); + } + + /** + * Class method which constructs an instance of the `SecurityAndComplianceCenterApi` client. + * The specified service name is used to configure the client instance. + * + * @param serviceName the service name to be used when configuring the client instance + * @return an instance of the `SecurityAndComplianceCenterApi` client using external configuration + */ + public static SecurityAndComplianceCenterApi newInstance(String serviceName) { + Authenticator authenticator = ConfigBasedAuthenticatorFactory.getAuthenticator(serviceName); + SecurityAndComplianceCenterApi service = new SecurityAndComplianceCenterApi(serviceName, authenticator); + service.configureService(serviceName); + return service; + } + + /** + * Constructs an instance of the `SecurityAndComplianceCenterApi` client. + * The specified service name and authenticator are used to configure the client instance. + * + * @param serviceName the service name to be used when configuring the client instance + * @param authenticator the {@link Authenticator} instance to be configured for this client + */ + public SecurityAndComplianceCenterApi(String serviceName, Authenticator authenticator) { + super(serviceName, authenticator); + setServiceUrl(DEFAULT_SERVICE_URL); + } + + /** + * Constructs a service URL by formatting the parameterized service URL. + * + * The parameterized service URL is: + * 'https://{region}.cloud.ibm.com/instances/{instance_id}/v3' + * + * The default variable values are: + * - 'region': 'us-south.compliance' + * - 'instance_id': 'instance_id' + * + * @param providedUrlVariables map from variable names to desired values. + * If a variable is not provided in this map, + * the default variable value will be used instead. + * @return the formatted URL with all variable placeholders replaced by values. + */ + public static String constructServiceUrl(Map providedUrlVariables) { + return BaseService.constructServiceUrl(PARAMETERIZED_SERVICE_URL, defaultUrlVariables, providedUrlVariables); + } + + /** + * Get settings. + * + * Retrieve the settings of your service instance. + * + * @param getSettingsOptions the {@link GetSettingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Settings} + */ + public ServiceCall getSettings(GetSettingsOptions getSettingsOptions) { + if (getSettingsOptions == null) { + getSettingsOptions = new GetSettingsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/settings")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getSettings"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getSettingsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", getSettingsOptions.xCorrelationId()); + } + if (getSettingsOptions.xRequestId() != null) { + builder.header("X-Request-Id", getSettingsOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get settings. + * + * Retrieve the settings of your service instance. + * + * @return a {@link ServiceCall} with a result of type {@link Settings} + */ + public ServiceCall getSettings() { + return getSettings(null); + } + + /** + * Update settings. + * + * Update the settings of your service instance. + * + * @param updateSettingsOptions the {@link UpdateSettingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Settings} + */ + public ServiceCall updateSettings(UpdateSettingsOptions updateSettingsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateSettingsOptions, + "updateSettingsOptions cannot be null"); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/settings")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "updateSettings"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (updateSettingsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", updateSettingsOptions.xCorrelationId()); + } + if (updateSettingsOptions.xRequestId() != null) { + builder.header("X-Request-Id", updateSettingsOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + if (updateSettingsOptions.eventNotifications() != null) { + contentJson.add("event_notifications", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateSettingsOptions.eventNotifications())); + } + if (updateSettingsOptions.objectStorage() != null) { + contentJson.add("object_storage", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateSettingsOptions.objectStorage())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update settings. + * + * Update the settings of your service instance. + * + * @return a {@link ServiceCall} with a result of type {@link Settings} + */ + public ServiceCall updateSettings() { + return updateSettings(null); + } + + /** + * Create a test event. + * + * Send a test event to your Event Notifications instance to ensure that the events that are generated by Security + * and Compliance Center are being forwarded to Event Notifications. For more information, see [Enabling event + * notifications](/docs/security-compliance?topic=security-compliance-event-notifications#event-notifications-test-api). + * + * @param postTestEventOptions the {@link PostTestEventOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link TestEvent} + */ + public ServiceCall postTestEvent(PostTestEventOptions postTestEventOptions) { + if (postTestEventOptions == null) { + postTestEventOptions = new PostTestEventOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/test_event")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "postTestEvent"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (postTestEventOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", postTestEventOptions.xCorrelationId()); + } + if (postTestEventOptions.xRequestId() != null) { + builder.header("X-Request-Id", postTestEventOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create a test event. + * + * Send a test event to your Event Notifications instance to ensure that the events that are generated by Security + * and Compliance Center are being forwarded to Event Notifications. For more information, see [Enabling event + * notifications](/docs/security-compliance?topic=security-compliance-event-notifications#event-notifications-test-api). + * + * @return a {@link ServiceCall} with a result of type {@link TestEvent} + */ + public ServiceCall postTestEvent() { + return postTestEvent(null); + } + + /** + * Get control libraries. + * + * Retrieve all of the control libraries that are available in your account, including predefined, and custom + * libraries. + * + * With Security and Compliance Center, you can create a custom control library that is specific to your + * organization's needs. You define the controls and specifications before you map previously created assessments. + * Each control has several specifications and assessments that are mapped to it. A specification is a defined + * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a + * detailed evaluation that is done to check whether the specification is compliant. For more information, see + * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * + * @param listControlLibrariesOptions the {@link ListControlLibrariesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ControlLibraryCollection} + */ + public ServiceCall listControlLibraries(ListControlLibrariesOptions listControlLibrariesOptions) { + if (listControlLibrariesOptions == null) { + listControlLibrariesOptions = new ListControlLibrariesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listControlLibraries"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listControlLibrariesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listControlLibrariesOptions.xCorrelationId()); + } + if (listControlLibrariesOptions.xRequestId() != null) { + builder.header("X-Request-ID", listControlLibrariesOptions.xRequestId()); + } + if (listControlLibrariesOptions.limit() != null) { + builder.query("limit", String.valueOf(listControlLibrariesOptions.limit())); + } + if (listControlLibrariesOptions.controlLibraryType() != null) { + builder.query("control_library_type", String.valueOf(listControlLibrariesOptions.controlLibraryType())); + } + if (listControlLibrariesOptions.start() != null) { + builder.query("start", String.valueOf(listControlLibrariesOptions.start())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get control libraries. + * + * Retrieve all of the control libraries that are available in your account, including predefined, and custom + * libraries. + * + * With Security and Compliance Center, you can create a custom control library that is specific to your + * organization's needs. You define the controls and specifications before you map previously created assessments. + * Each control has several specifications and assessments that are mapped to it. A specification is a defined + * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a + * detailed evaluation that is done to check whether the specification is compliant. For more information, see + * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * + * @return a {@link ServiceCall} with a result of type {@link ControlLibraryCollection} + */ + public ServiceCall listControlLibraries() { + return listControlLibraries(null); + } + + /** + * Create a custom control library. + * + * Create a custom control library that is specific to your organization's needs. + * + * With Security and Compliance Center, you can create a custom control library that is specific to your + * organization's needs. You define the controls and specifications before you map previously created assessments. + * Each control has several specifications and assessments that are mapped to it. A specification is a defined + * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a + * detailed evaluation that is done to check whether the specification is compliant. For more information, see + * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * + * @param createCustomControlLibraryOptions the {@link CreateCustomControlLibraryOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ControlLibrary} + */ + public ServiceCall createCustomControlLibrary(CreateCustomControlLibraryOptions createCustomControlLibraryOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createCustomControlLibraryOptions, + "createCustomControlLibraryOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createCustomControlLibrary"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (createCustomControlLibraryOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", createCustomControlLibraryOptions.xCorrelationId()); + } + if (createCustomControlLibraryOptions.xRequestId() != null) { + builder.header("X-Request-ID", createCustomControlLibraryOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("control_library_name", createCustomControlLibraryOptions.controlLibraryName()); + contentJson.addProperty("control_library_description", createCustomControlLibraryOptions.controlLibraryDescription()); + contentJson.addProperty("control_library_type", createCustomControlLibraryOptions.controlLibraryType()); + contentJson.add("controls", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createCustomControlLibraryOptions.controls())); + if (createCustomControlLibraryOptions.versionGroupLabel() != null) { + contentJson.addProperty("version_group_label", createCustomControlLibraryOptions.versionGroupLabel()); + } + if (createCustomControlLibraryOptions.controlLibraryVersion() != null) { + contentJson.addProperty("control_library_version", createCustomControlLibraryOptions.controlLibraryVersion()); + } + if (createCustomControlLibraryOptions.latest() != null) { + contentJson.addProperty("latest", createCustomControlLibraryOptions.latest()); + } + if (createCustomControlLibraryOptions.controlsCount() != null) { + contentJson.addProperty("controls_count", createCustomControlLibraryOptions.controlsCount()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete a control library. + * + * Delete a custom control library by providing the control library ID. You can find this ID by looking in the + * Security and Compliance Center UI. + * + * With Security and Compliance Center, you can manage a custom control library that is specific to your + * organization's needs. Each control has several specifications and assessments that are mapped to it. For more + * information, see [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * + * @param deleteCustomControlLibraryOptions the {@link DeleteCustomControlLibraryOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ControlLibraryDelete} + */ + public ServiceCall deleteCustomControlLibrary(DeleteCustomControlLibraryOptions deleteCustomControlLibraryOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteCustomControlLibraryOptions, + "deleteCustomControlLibraryOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("control_libraries_id", deleteCustomControlLibraryOptions.controlLibrariesId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries/{control_libraries_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "deleteCustomControlLibrary"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (deleteCustomControlLibraryOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", deleteCustomControlLibraryOptions.xCorrelationId()); + } + if (deleteCustomControlLibraryOptions.xRequestId() != null) { + builder.header("X-Request-ID", deleteCustomControlLibraryOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get a control library. + * + * View the details of a control library by specifying its ID. + * + * With Security and Compliance Center, you can create a custom control library that is specific to your + * organization's needs. You define the controls and specifications before you map previously created assessments. + * Each control has several specifications and assessments that are mapped to it. A specification is a defined + * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a + * detailed evaluation that is done to check whether the specification is compliant. For more information, see + * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * + * @param getControlLibraryOptions the {@link GetControlLibraryOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ControlLibrary} + */ + public ServiceCall getControlLibrary(GetControlLibraryOptions getControlLibraryOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getControlLibraryOptions, + "getControlLibraryOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("control_libraries_id", getControlLibraryOptions.controlLibrariesId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries/{control_libraries_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getControlLibrary"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getControlLibraryOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getControlLibraryOptions.xCorrelationId()); + } + if (getControlLibraryOptions.xRequestId() != null) { + builder.header("X-Request-ID", getControlLibraryOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update a control library. + * + * Update a custom control library by providing the control library ID. You can find this ID in the Security and + * Compliance Center UI. + * + * With Security and Compliance Center, you can create and update a custom control library that is specific to your + * organization's needs. You define the controls and specifications before you map previously created assessments. + * Each control has several specifications and assessments that are mapped to it. For more information, see [Creating + * custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * + * @param replaceCustomControlLibraryOptions the {@link ReplaceCustomControlLibraryOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ControlLibrary} + */ + public ServiceCall replaceCustomControlLibrary(ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceCustomControlLibraryOptions, + "replaceCustomControlLibraryOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("control_libraries_id", replaceCustomControlLibraryOptions.controlLibrariesId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries/{control_libraries_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "replaceCustomControlLibrary"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (replaceCustomControlLibraryOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", replaceCustomControlLibraryOptions.xCorrelationId()); + } + if (replaceCustomControlLibraryOptions.xRequestId() != null) { + builder.header("X-Request-ID", replaceCustomControlLibraryOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + if (replaceCustomControlLibraryOptions.id() != null) { + contentJson.addProperty("id", replaceCustomControlLibraryOptions.id()); + } + if (replaceCustomControlLibraryOptions.accountId() != null) { + contentJson.addProperty("account_id", replaceCustomControlLibraryOptions.accountId()); + } + if (replaceCustomControlLibraryOptions.controlLibraryName() != null) { + contentJson.addProperty("control_library_name", replaceCustomControlLibraryOptions.controlLibraryName()); + } + if (replaceCustomControlLibraryOptions.controlLibraryDescription() != null) { + contentJson.addProperty("control_library_description", replaceCustomControlLibraryOptions.controlLibraryDescription()); + } + if (replaceCustomControlLibraryOptions.controlLibraryType() != null) { + contentJson.addProperty("control_library_type", replaceCustomControlLibraryOptions.controlLibraryType()); + } + if (replaceCustomControlLibraryOptions.versionGroupLabel() != null) { + contentJson.addProperty("version_group_label", replaceCustomControlLibraryOptions.versionGroupLabel()); + } + if (replaceCustomControlLibraryOptions.controlLibraryVersion() != null) { + contentJson.addProperty("control_library_version", replaceCustomControlLibraryOptions.controlLibraryVersion()); + } + if (replaceCustomControlLibraryOptions.createdOn() != null) { + contentJson.add("created_on", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceCustomControlLibraryOptions.createdOn())); + } + if (replaceCustomControlLibraryOptions.createdBy() != null) { + contentJson.addProperty("created_by", replaceCustomControlLibraryOptions.createdBy()); + } + if (replaceCustomControlLibraryOptions.updatedOn() != null) { + contentJson.add("updated_on", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceCustomControlLibraryOptions.updatedOn())); + } + if (replaceCustomControlLibraryOptions.updatedBy() != null) { + contentJson.addProperty("updated_by", replaceCustomControlLibraryOptions.updatedBy()); + } + if (replaceCustomControlLibraryOptions.latest() != null) { + contentJson.addProperty("latest", replaceCustomControlLibraryOptions.latest()); + } + if (replaceCustomControlLibraryOptions.hierarchyEnabled() != null) { + contentJson.addProperty("hierarchy_enabled", replaceCustomControlLibraryOptions.hierarchyEnabled()); + } + if (replaceCustomControlLibraryOptions.controlsCount() != null) { + contentJson.addProperty("controls_count", replaceCustomControlLibraryOptions.controlsCount()); + } + if (replaceCustomControlLibraryOptions.controlParentsCount() != null) { + contentJson.addProperty("control_parents_count", replaceCustomControlLibraryOptions.controlParentsCount()); + } + if (replaceCustomControlLibraryOptions.controls() != null) { + contentJson.add("controls", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceCustomControlLibraryOptions.controls())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get all profiles. + * + * View all of the predefined and custom profiles that are available in your account. + * + * @param listProfilesOptions the {@link ListProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProfileCollection} + */ + public ServiceCall listProfiles(ListProfilesOptions listProfilesOptions) { + if (listProfilesOptions == null) { + listProfilesOptions = new ListProfilesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listProfiles"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listProfilesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listProfilesOptions.xCorrelationId()); + } + if (listProfilesOptions.xRequestId() != null) { + builder.header("X-Request-ID", listProfilesOptions.xRequestId()); + } + if (listProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listProfilesOptions.limit())); + } + if (listProfilesOptions.profileType() != null) { + builder.query("profile_type", String.valueOf(listProfilesOptions.profileType())); + } + if (listProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listProfilesOptions.start())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get all profiles. + * + * View all of the predefined and custom profiles that are available in your account. + * + * @return a {@link ServiceCall} with a result of type {@link ProfileCollection} + */ + public ServiceCall listProfiles() { + return listProfiles(null); + } + + /** + * Create a custom profile. + * + * Create a custom profile that is specific to your usecase, by using an existing library as a starting point. For + * more information, see [Building custom + * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * + * @param createProfileOptions the {@link CreateProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Profile} + */ + public ServiceCall createProfile(CreateProfileOptions createProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createProfileOptions, + "createProfileOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createProfile"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (createProfileOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", createProfileOptions.xCorrelationId()); + } + if (createProfileOptions.xRequestId() != null) { + builder.header("X-Request-ID", createProfileOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("profile_name", createProfileOptions.profileName()); + contentJson.addProperty("profile_description", createProfileOptions.profileDescription()); + contentJson.addProperty("profile_type", createProfileOptions.profileType()); + contentJson.add("controls", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createProfileOptions.controls())); + contentJson.add("default_parameters", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createProfileOptions.defaultParameters())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete a custom profile. + * + * Delete a custom profile by providing the profile ID. You can find the ID in the Security and Compliance Center UI. + * For more information about managing your custom profiles, see [Building custom + * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * + * @param deleteCustomProfileOptions the {@link DeleteCustomProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Profile} + */ + public ServiceCall deleteCustomProfile(DeleteCustomProfileOptions deleteCustomProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteCustomProfileOptions, + "deleteCustomProfileOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("profiles_id", deleteCustomProfileOptions.profilesId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "deleteCustomProfile"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (deleteCustomProfileOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", deleteCustomProfileOptions.xCorrelationId()); + } + if (deleteCustomProfileOptions.xRequestId() != null) { + builder.header("X-Request-ID", deleteCustomProfileOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get a profile. + * + * View the details of a profile by providing the profile ID. You can find the profile ID in the Security and + * Compliance Center UI. For more information, see [Building custom + * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * + * @param getProfileOptions the {@link GetProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Profile} + */ + public ServiceCall getProfile(GetProfileOptions getProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getProfileOptions, + "getProfileOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("profiles_id", getProfileOptions.profilesId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProfile"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getProfileOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getProfileOptions.xCorrelationId()); + } + if (getProfileOptions.xRequestId() != null) { + builder.header("X-Request-ID", getProfileOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update a profile. + * + * Update the details of a custom profile. With Security and Compliance Center, you can manage a profile that is + * specific to your usecase, by using an existing library as a starting point. For more information, see [Building + * custom + * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * + * @param replaceProfileOptions the {@link ReplaceProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Profile} + */ + public ServiceCall replaceProfile(ReplaceProfileOptions replaceProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceProfileOptions, + "replaceProfileOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("profiles_id", replaceProfileOptions.profilesId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "replaceProfile"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (replaceProfileOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", replaceProfileOptions.xCorrelationId()); + } + if (replaceProfileOptions.xRequestId() != null) { + builder.header("X-Request-ID", replaceProfileOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("profile_name", replaceProfileOptions.profileName()); + contentJson.addProperty("profile_description", replaceProfileOptions.profileDescription()); + contentJson.addProperty("profile_type", replaceProfileOptions.profileType()); + contentJson.add("controls", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileOptions.controls())); + contentJson.add("default_parameters", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileOptions.defaultParameters())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List all rules. + * + * Retrieve all the rules that you use to target the exact configuration properties that you need to ensure are + * compliant. For more information, see [Defining custom + * rules](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-rules-define). + * + * @param listRulesOptions the {@link ListRulesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RulesPageBase} + */ + public ServiceCall listRules(ListRulesOptions listRulesOptions) { + if (listRulesOptions == null) { + listRulesOptions = new ListRulesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listRules"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listRulesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", listRulesOptions.xCorrelationId()); + } + if (listRulesOptions.xRequestId() != null) { + builder.header("X-Request-Id", listRulesOptions.xRequestId()); + } + if (listRulesOptions.type() != null) { + builder.query("type", String.valueOf(listRulesOptions.type())); + } + if (listRulesOptions.search() != null) { + builder.query("search", String.valueOf(listRulesOptions.search())); + } + if (listRulesOptions.serviceName() != null) { + builder.query("service_name", String.valueOf(listRulesOptions.serviceName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List all rules. + * + * Retrieve all the rules that you use to target the exact configuration properties that you need to ensure are + * compliant. For more information, see [Defining custom + * rules](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-rules-define). + * + * @return a {@link ServiceCall} with a result of type {@link RulesPageBase} + */ + public ServiceCall listRules() { + return listRules(null); + } + + /** + * Create a custom rule. + * + * Create a custom rule to to target the exact configuration properties that you need to evaluate your resources for + * compliance. For more information, see [Defining custom + * rules](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-rules-define). + * + * @param createRuleOptions the {@link CreateRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Rule} + */ + public ServiceCall createRule(CreateRuleOptions createRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createRuleOptions, + "createRuleOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createRule"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (createRuleOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", createRuleOptions.xCorrelationId()); + } + if (createRuleOptions.xRequestId() != null) { + builder.header("X-Request-Id", createRuleOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("description", createRuleOptions.description()); + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRuleOptions.target())); + contentJson.add("required_config", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRuleOptions.requiredConfig())); + if (createRuleOptions.type() != null) { + contentJson.addProperty("type", createRuleOptions.type()); + } + if (createRuleOptions.version() != null) { + contentJson.addProperty("version", createRuleOptions.version()); + } + if (createRuleOptions.xImport() != null) { + contentJson.add("import", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRuleOptions.xImport())); + } + if (createRuleOptions.labels() != null) { + contentJson.add("labels", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRuleOptions.labels())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete a custom rule. + * + * Delete a custom rule that you no longer require to evaluate your resources. For more information, see [Defining + * custom rules](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-rules-define). + * + * @param deleteRuleOptions the {@link DeleteRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall deleteRule(DeleteRuleOptions deleteRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteRuleOptions, + "deleteRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("rule_id", deleteRuleOptions.ruleId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules/{rule_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "deleteRule"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + if (deleteRuleOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", deleteRuleOptions.xCorrelationId()); + } + if (deleteRuleOptions.xRequestId() != null) { + builder.header("X-Request-Id", deleteRuleOptions.xRequestId()); + } + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get a custom rule. + * + * Retrieve a rule that you created to evaluate your resources. For more information, see [Defining custom + * rules](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-rules-define). + * + * @param getRuleOptions the {@link GetRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Rule} + */ + public ServiceCall getRule(GetRuleOptions getRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getRuleOptions, + "getRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("rule_id", getRuleOptions.ruleId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules/{rule_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getRule"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getRuleOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", getRuleOptions.xCorrelationId()); + } + if (getRuleOptions.xRequestId() != null) { + builder.header("X-Request-Id", getRuleOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update a custom rule. + * + * Update a custom rule that you use to target the exact configuration properties that you need to evaluate your + * resources for compliance. For more information, see [Defining custom + * rules](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-rules-define). + * + * @param replaceRuleOptions the {@link ReplaceRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Rule} + */ + public ServiceCall replaceRule(ReplaceRuleOptions replaceRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceRuleOptions, + "replaceRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("rule_id", replaceRuleOptions.ruleId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules/{rule_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "replaceRule"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.header("If-Match", replaceRuleOptions.ifMatch()); + if (replaceRuleOptions.xCorrelationId() != null) { + builder.header("X-Correlation-Id", replaceRuleOptions.xCorrelationId()); + } + if (replaceRuleOptions.xRequestId() != null) { + builder.header("X-Request-Id", replaceRuleOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("description", replaceRuleOptions.description()); + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceRuleOptions.target())); + contentJson.add("required_config", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceRuleOptions.requiredConfig())); + if (replaceRuleOptions.type() != null) { + contentJson.addProperty("type", replaceRuleOptions.type()); + } + if (replaceRuleOptions.version() != null) { + contentJson.addProperty("version", replaceRuleOptions.version()); + } + if (replaceRuleOptions.xImport() != null) { + contentJson.add("import", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceRuleOptions.xImport())); + } + if (replaceRuleOptions.labels() != null) { + contentJson.add("labels", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceRuleOptions.labels())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get all attachments linked to a specific profile. + * + * View all of the attachments that are linked to a specific profile. An attachment is the association between the + * set of resources that you want to evaluate and a profile that contains the specific controls that you want to use. + * For more information, see [Running an evaluation for IBM + * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * + * @param listAttachmentsOptions the {@link ListAttachmentsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AttachmentCollection} + */ + public ServiceCall listAttachments(ListAttachmentsOptions listAttachmentsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listAttachmentsOptions, + "listAttachmentsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("profiles_id", listAttachmentsOptions.profilesId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listAttachments"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listAttachmentsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listAttachmentsOptions.xCorrelationId()); + } + if (listAttachmentsOptions.xRequestId() != null) { + builder.header("X-Request-ID", listAttachmentsOptions.xRequestId()); + } + if (listAttachmentsOptions.limit() != null) { + builder.query("limit", String.valueOf(listAttachmentsOptions.limit())); + } + if (listAttachmentsOptions.start() != null) { + builder.query("start", String.valueOf(listAttachmentsOptions.start())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create an attachment. + * + * Create an attachment to link to a profile to schedule evaluations of your resources on a recurring schedule, or + * on-demand. For more information, see [Running an evaluation for IBM + * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * + * @param createAttachmentOptions the {@link CreateAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AttachmentPrototype} + */ + public ServiceCall createAttachment(CreateAttachmentOptions createAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createAttachmentOptions, + "createAttachmentOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("profiles_id", createAttachmentOptions.profilesId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createAttachment"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (createAttachmentOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", createAttachmentOptions.xCorrelationId()); + } + if (createAttachmentOptions.xRequestId() != null) { + builder.header("X-Request-ID", createAttachmentOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + contentJson.add("attachments", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createAttachmentOptions.attachments())); + if (createAttachmentOptions.profileId() != null) { + contentJson.addProperty("profile_id", createAttachmentOptions.profileId()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete an attachment. + * + * Delete an attachment. Alternatively, if you think that you might need this configuration in the future, you can + * pause an attachment to stop being charged. For more information, see [Running an evaluation for IBM + * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * + * @param deleteProfileAttachmentOptions the {@link DeleteProfileAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AttachmentItem} + */ + public ServiceCall deleteProfileAttachment(DeleteProfileAttachmentOptions deleteProfileAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteProfileAttachmentOptions, + "deleteProfileAttachmentOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("attachment_id", deleteProfileAttachmentOptions.attachmentId()); + pathParamsMap.put("profiles_id", deleteProfileAttachmentOptions.profilesId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments/{attachment_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "deleteProfileAttachment"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (deleteProfileAttachmentOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", deleteProfileAttachmentOptions.xCorrelationId()); + } + if (deleteProfileAttachmentOptions.xRequestId() != null) { + builder.header("X-Request-ID", deleteProfileAttachmentOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get an attachment. + * + * View the details of an attachment a profile by providing the attachment ID. You can find this value in the + * Security and Compliance Center UI. For more information, see [Running an evaluation for IBM + * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * + * @param getProfileAttachmentOptions the {@link GetProfileAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AttachmentItem} + */ + public ServiceCall getProfileAttachment(GetProfileAttachmentOptions getProfileAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getProfileAttachmentOptions, + "getProfileAttachmentOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("attachment_id", getProfileAttachmentOptions.attachmentId()); + pathParamsMap.put("profiles_id", getProfileAttachmentOptions.profilesId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments/{attachment_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProfileAttachment"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getProfileAttachmentOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getProfileAttachmentOptions.xCorrelationId()); + } + if (getProfileAttachmentOptions.xRequestId() != null) { + builder.header("X-Request-ID", getProfileAttachmentOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update an attachment. + * + * Update an attachment that is linked to a profile to evaluate your resources on a recurring schedule, or on-demand. + * For more information, see [Running an evaluation for IBM + * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * + * @param replaceProfileAttachmentOptions the {@link ReplaceProfileAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AttachmentItem} + */ + public ServiceCall replaceProfileAttachment(ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceProfileAttachmentOptions, + "replaceProfileAttachmentOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("attachment_id", replaceProfileAttachmentOptions.attachmentId()); + pathParamsMap.put("profiles_id", replaceProfileAttachmentOptions.profilesId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments/{attachment_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "replaceProfileAttachment"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (replaceProfileAttachmentOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", replaceProfileAttachmentOptions.xCorrelationId()); + } + if (replaceProfileAttachmentOptions.xRequestId() != null) { + builder.header("X-Request-ID", replaceProfileAttachmentOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + if (replaceProfileAttachmentOptions.id() != null) { + contentJson.addProperty("id", replaceProfileAttachmentOptions.id()); + } + if (replaceProfileAttachmentOptions.profileId() != null) { + contentJson.addProperty("profile_id", replaceProfileAttachmentOptions.profileId()); + } + if (replaceProfileAttachmentOptions.accountId() != null) { + contentJson.addProperty("account_id", replaceProfileAttachmentOptions.accountId()); + } + if (replaceProfileAttachmentOptions.instanceId() != null) { + contentJson.addProperty("instance_id", replaceProfileAttachmentOptions.instanceId()); + } + if (replaceProfileAttachmentOptions.scope() != null) { + contentJson.add("scope", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.scope())); + } + if (replaceProfileAttachmentOptions.createdOn() != null) { + contentJson.add("created_on", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.createdOn())); + } + if (replaceProfileAttachmentOptions.createdBy() != null) { + contentJson.addProperty("created_by", replaceProfileAttachmentOptions.createdBy()); + } + if (replaceProfileAttachmentOptions.updatedOn() != null) { + contentJson.add("updated_on", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.updatedOn())); + } + if (replaceProfileAttachmentOptions.updatedBy() != null) { + contentJson.addProperty("updated_by", replaceProfileAttachmentOptions.updatedBy()); + } + if (replaceProfileAttachmentOptions.status() != null) { + contentJson.addProperty("status", replaceProfileAttachmentOptions.status()); + } + if (replaceProfileAttachmentOptions.schedule() != null) { + contentJson.addProperty("schedule", replaceProfileAttachmentOptions.schedule()); + } + if (replaceProfileAttachmentOptions.notifications() != null) { + contentJson.add("notifications", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.notifications())); + } + if (replaceProfileAttachmentOptions.attachmentParameters() != null) { + contentJson.add("attachment_parameters", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.attachmentParameters())); + } + if (replaceProfileAttachmentOptions.lastScan() != null) { + contentJson.add("last_scan", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.lastScan())); + } + if (replaceProfileAttachmentOptions.nextScanTime() != null) { + contentJson.add("next_scan_time", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.nextScanTime())); + } + if (replaceProfileAttachmentOptions.name() != null) { + contentJson.addProperty("name", replaceProfileAttachmentOptions.name()); + } + if (replaceProfileAttachmentOptions.description() != null) { + contentJson.addProperty("description", replaceProfileAttachmentOptions.description()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create a scan. + * + * Create a scan to evaluate your resources on a recurring basis or on demand. + * + * @param createScanOptions the {@link CreateScanOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Scan} + */ + public ServiceCall createScan(CreateScanOptions createScanOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createScanOptions, + "createScanOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/scans")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createScan"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (createScanOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", createScanOptions.xCorrelationId()); + } + if (createScanOptions.xRequestId() != null) { + builder.header("X-Request-ID", createScanOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("attachment_id", createScanOptions.attachmentId()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get all attachments in an instance. + * + * View all of the attachments that are linked to an account. An attachment is the association between the set of + * resources that you want to evaluate and a profile that contains the specific controls that you want to use. For + * more information, see [Running an evaluation for IBM + * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * + * @param listAttachmentsAccountOptions the {@link ListAttachmentsAccountOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AttachmentCollection} + */ + public ServiceCall listAttachmentsAccount(ListAttachmentsAccountOptions listAttachmentsAccountOptions) { + if (listAttachmentsAccountOptions == null) { + listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/attachments")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listAttachmentsAccount"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listAttachmentsAccountOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listAttachmentsAccountOptions.xCorrelationId()); + } + if (listAttachmentsAccountOptions.xRequestId() != null) { + builder.header("X-Request-ID", listAttachmentsAccountOptions.xRequestId()); + } + if (listAttachmentsAccountOptions.limit() != null) { + builder.query("limit", String.valueOf(listAttachmentsAccountOptions.limit())); + } + if (listAttachmentsAccountOptions.start() != null) { + builder.query("start", String.valueOf(listAttachmentsAccountOptions.start())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get all attachments in an instance. + * + * View all of the attachments that are linked to an account. An attachment is the association between the set of + * resources that you want to evaluate and a profile that contains the specific controls that you want to use. For + * more information, see [Running an evaluation for IBM + * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * + * @return a {@link ServiceCall} with a result of type {@link AttachmentCollection} + */ + public ServiceCall listAttachmentsAccount() { + return listAttachmentsAccount(null); + } + + /** + * Get the latest reports. + * + * Retrieve the latest reports, which are grouped by profile ID, scope ID, and attachment ID. For more information, + * see [Viewing results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getLatestReportsOptions the {@link GetLatestReportsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReportLatest} + */ + public ServiceCall getLatestReports(GetLatestReportsOptions getLatestReportsOptions) { + if (getLatestReportsOptions == null) { + getLatestReportsOptions = new GetLatestReportsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/latest")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getLatestReports"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getLatestReportsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getLatestReportsOptions.xCorrelationId()); + } + if (getLatestReportsOptions.xRequestId() != null) { + builder.header("X-Request-ID", getLatestReportsOptions.xRequestId()); + } + if (getLatestReportsOptions.sort() != null) { + builder.query("sort", String.valueOf(getLatestReportsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get the latest reports. + * + * Retrieve the latest reports, which are grouped by profile ID, scope ID, and attachment ID. For more information, + * see [Viewing results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @return a {@link ServiceCall} with a result of type {@link ReportLatest} + */ + public ServiceCall getLatestReports() { + return getLatestReports(null); + } + + /** + * List reports. + * + * Retrieve a page of reports that are filtered by the specified parameters. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param listReportsOptions the {@link ListReportsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReportPage} + */ + public ServiceCall listReports(ListReportsOptions listReportsOptions) { + if (listReportsOptions == null) { + listReportsOptions = new ListReportsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listReports"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listReportsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listReportsOptions.xCorrelationId()); + } + if (listReportsOptions.xRequestId() != null) { + builder.header("X-Request-ID", listReportsOptions.xRequestId()); + } + if (listReportsOptions.attachmentId() != null) { + builder.query("attachment_id", String.valueOf(listReportsOptions.attachmentId())); + } + if (listReportsOptions.groupId() != null) { + builder.query("group_id", String.valueOf(listReportsOptions.groupId())); + } + if (listReportsOptions.profileId() != null) { + builder.query("profile_id", String.valueOf(listReportsOptions.profileId())); + } + if (listReportsOptions.type() != null) { + builder.query("type", String.valueOf(listReportsOptions.type())); + } + if (listReportsOptions.start() != null) { + builder.query("start", String.valueOf(listReportsOptions.start())); + } + if (listReportsOptions.limit() != null) { + builder.query("limit", String.valueOf(listReportsOptions.limit())); + } + if (listReportsOptions.sort() != null) { + builder.query("sort", String.valueOf(listReportsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List reports. + * + * Retrieve a page of reports that are filtered by the specified parameters. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @return a {@link ServiceCall} with a result of type {@link ReportPage} + */ + public ServiceCall listReports() { + return listReports(null); + } + + /** + * Get a report. + * + * Retrieve a report by specifying its ID. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getReportOptions the {@link GetReportOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Report} + */ + public ServiceCall getReport(GetReportOptions getReportOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReportOptions, + "getReportOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", getReportOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getReport"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getReportOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getReportOptions.xCorrelationId()); + } + if (getReportOptions.xRequestId() != null) { + builder.header("X-Request-ID", getReportOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get a report summary. + * + * Retrieve the complete summarized information for a report. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getReportSummaryOptions the {@link GetReportSummaryOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReportSummary} + */ + public ServiceCall getReportSummary(GetReportSummaryOptions getReportSummaryOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReportSummaryOptions, + "getReportSummaryOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", getReportSummaryOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/summary", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getReportSummary"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getReportSummaryOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getReportSummaryOptions.xCorrelationId()); + } + if (getReportSummaryOptions.xRequestId() != null) { + builder.header("X-Request-ID", getReportSummaryOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get report evaluation details. + * + * Retrieve the evaluation details of a report by specifying the report ID. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getReportEvaluationOptions the {@link GetReportEvaluationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InputStream} + */ + public ServiceCall getReportEvaluation(GetReportEvaluationOptions getReportEvaluationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReportEvaluationOptions, + "getReportEvaluationOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", getReportEvaluationOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/download", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getReportEvaluation"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/csv"); + if (getReportEvaluationOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getReportEvaluationOptions.xCorrelationId()); + } + if (getReportEvaluationOptions.xRequestId() != null) { + builder.header("X-Request-ID", getReportEvaluationOptions.xRequestId()); + } + if (getReportEvaluationOptions.excludeSummary() != null) { + builder.query("exclude_summary", String.valueOf(getReportEvaluationOptions.excludeSummary())); + } + ResponseConverter responseConverter = ResponseConverterUtils.getInputStream(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get report controls. + * + * Retrieve a sorted and filtered list of controls for the specified report. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getReportControlsOptions the {@link GetReportControlsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReportControls} + */ + public ServiceCall getReportControls(GetReportControlsOptions getReportControlsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReportControlsOptions, + "getReportControlsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", getReportControlsOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/controls", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getReportControls"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getReportControlsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getReportControlsOptions.xCorrelationId()); + } + if (getReportControlsOptions.xRequestId() != null) { + builder.header("X-Request-ID", getReportControlsOptions.xRequestId()); + } + if (getReportControlsOptions.controlId() != null) { + builder.query("control_id", String.valueOf(getReportControlsOptions.controlId())); + } + if (getReportControlsOptions.controlName() != null) { + builder.query("control_name", String.valueOf(getReportControlsOptions.controlName())); + } + if (getReportControlsOptions.controlDescription() != null) { + builder.query("control_description", String.valueOf(getReportControlsOptions.controlDescription())); + } + if (getReportControlsOptions.controlCategory() != null) { + builder.query("control_category", String.valueOf(getReportControlsOptions.controlCategory())); + } + if (getReportControlsOptions.status() != null) { + builder.query("status", String.valueOf(getReportControlsOptions.status())); + } + if (getReportControlsOptions.sort() != null) { + builder.query("sort", String.valueOf(getReportControlsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get a report rule. + * + * Retrieve the rule by specifying the report ID and rule ID. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getReportRuleOptions the {@link GetReportRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RuleInfo} + */ + public ServiceCall getReportRule(GetReportRuleOptions getReportRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReportRuleOptions, + "getReportRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", getReportRuleOptions.reportId()); + pathParamsMap.put("rule_id", getReportRuleOptions.ruleId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/rules/{rule_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getReportRule"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getReportRuleOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getReportRuleOptions.xCorrelationId()); + } + if (getReportRuleOptions.xRequestId() != null) { + builder.header("X-Request-ID", getReportRuleOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List report evaluations. + * + * Get a paginated list of evaluations for the specified report. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param listReportEvaluationsOptions the {@link ListReportEvaluationsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EvaluationPage} + */ + public ServiceCall listReportEvaluations(ListReportEvaluationsOptions listReportEvaluationsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listReportEvaluationsOptions, + "listReportEvaluationsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", listReportEvaluationsOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/evaluations", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listReportEvaluations"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listReportEvaluationsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listReportEvaluationsOptions.xCorrelationId()); + } + if (listReportEvaluationsOptions.xRequestId() != null) { + builder.header("X-Request-ID", listReportEvaluationsOptions.xRequestId()); + } + if (listReportEvaluationsOptions.assessmentId() != null) { + builder.query("assessment_id", String.valueOf(listReportEvaluationsOptions.assessmentId())); + } + if (listReportEvaluationsOptions.componentId() != null) { + builder.query("component_id", String.valueOf(listReportEvaluationsOptions.componentId())); + } + if (listReportEvaluationsOptions.targetId() != null) { + builder.query("target_id", String.valueOf(listReportEvaluationsOptions.targetId())); + } + if (listReportEvaluationsOptions.targetName() != null) { + builder.query("target_name", String.valueOf(listReportEvaluationsOptions.targetName())); + } + if (listReportEvaluationsOptions.status() != null) { + builder.query("status", String.valueOf(listReportEvaluationsOptions.status())); + } + if (listReportEvaluationsOptions.start() != null) { + builder.query("start", String.valueOf(listReportEvaluationsOptions.start())); + } + if (listReportEvaluationsOptions.limit() != null) { + builder.query("limit", String.valueOf(listReportEvaluationsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List report resources. + * + * Get a paginated list of resources for the specified report. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param listReportResourcesOptions the {@link ListReportResourcesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ResourcePage} + */ + public ServiceCall listReportResources(ListReportResourcesOptions listReportResourcesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listReportResourcesOptions, + "listReportResourcesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", listReportResourcesOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/resources", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listReportResources"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listReportResourcesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listReportResourcesOptions.xCorrelationId()); + } + if (listReportResourcesOptions.xRequestId() != null) { + builder.header("X-Request-ID", listReportResourcesOptions.xRequestId()); + } + if (listReportResourcesOptions.id() != null) { + builder.query("id", String.valueOf(listReportResourcesOptions.id())); + } + if (listReportResourcesOptions.resourceName() != null) { + builder.query("resource_name", String.valueOf(listReportResourcesOptions.resourceName())); + } + if (listReportResourcesOptions.accountId() != null) { + builder.query("account_id", String.valueOf(listReportResourcesOptions.accountId())); + } + if (listReportResourcesOptions.componentId() != null) { + builder.query("component_id", String.valueOf(listReportResourcesOptions.componentId())); + } + if (listReportResourcesOptions.status() != null) { + builder.query("status", String.valueOf(listReportResourcesOptions.status())); + } + if (listReportResourcesOptions.sort() != null) { + builder.query("sort", String.valueOf(listReportResourcesOptions.sort())); + } + if (listReportResourcesOptions.start() != null) { + builder.query("start", String.valueOf(listReportResourcesOptions.start())); + } + if (listReportResourcesOptions.limit() != null) { + builder.query("limit", String.valueOf(listReportResourcesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get report tags. + * + * Retrieve a list of tags for the specified report. For more information, see [Viewing + * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getReportTagsOptions the {@link GetReportTagsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReportTags} + */ + public ServiceCall getReportTags(GetReportTagsOptions getReportTagsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReportTagsOptions, + "getReportTagsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", getReportTagsOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/tags", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getReportTags"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getReportTagsOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getReportTagsOptions.xCorrelationId()); + } + if (getReportTagsOptions.xRequestId() != null) { + builder.header("X-Request-ID", getReportTagsOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get report violations drift. + * + * Get a list of report violation data points for the specified report and time frame. For more information, see + * [Viewing results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). + * + * @param getReportViolationsDriftOptions the {@link GetReportViolationsDriftOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReportViolationsDrift} + */ + public ServiceCall getReportViolationsDrift(GetReportViolationsDriftOptions getReportViolationsDriftOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReportViolationsDriftOptions, + "getReportViolationsDriftOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("report_id", getReportViolationsDriftOptions.reportId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports/{report_id}/violations_drift", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getReportViolationsDrift"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getReportViolationsDriftOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getReportViolationsDriftOptions.xCorrelationId()); + } + if (getReportViolationsDriftOptions.xRequestId() != null) { + builder.header("X-Request-ID", getReportViolationsDriftOptions.xRequestId()); + } + if (getReportViolationsDriftOptions.scanTimeDuration() != null) { + builder.query("scan_time_duration", String.valueOf(getReportViolationsDriftOptions.scanTimeDuration())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List all provider types. + * + * List all the registered provider types. For more information about connecting Workload Protection with the Security + * and Compliance Center, see [Connecting Workload + * Protection](/docs/security-compliance?topic=security-compliance-setup-workload-protection&interface=api#wp-register). + * + * @param listProviderTypesOptions the {@link ListProviderTypesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypesCollection} + */ + public ServiceCall listProviderTypes(ListProviderTypesOptions listProviderTypesOptions) { + if (listProviderTypesOptions == null) { + listProviderTypesOptions = new ListProviderTypesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listProviderTypes"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listProviderTypesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listProviderTypesOptions.xCorrelationId()); + } + if (listProviderTypesOptions.xRequestId() != null) { + builder.header("X-Request-ID", listProviderTypesOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List all provider types. + * + * List all the registered provider types. For more information about connecting Workload Protection with the Security + * and Compliance Center, see [Connecting Workload + * Protection](/docs/security-compliance?topic=security-compliance-setup-workload-protection&interface=api#wp-register). + * + * @return a {@link ServiceCall} with a result of type {@link ProviderTypesCollection} + */ + public ServiceCall listProviderTypes() { + return listProviderTypes(null); + } + + /** + * Get a provider type. + * + * Retrieve a provider type by specifying its ID. For more information about integrations, see [Connecting Workload + * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * + * @param getProviderTypeByIdOptions the {@link GetProviderTypeByIdOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypeItem} + */ + public ServiceCall getProviderTypeById(GetProviderTypeByIdOptions getProviderTypeByIdOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getProviderTypeByIdOptions, + "getProviderTypeByIdOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_type_id", getProviderTypeByIdOptions.providerTypeId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProviderTypeById"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getProviderTypeByIdOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getProviderTypeByIdOptions.xCorrelationId()); + } + if (getProviderTypeByIdOptions.xRequestId() != null) { + builder.header("X-Request-ID", getProviderTypeByIdOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List all provider type instances. + * + * Retrieve all instances of provider type. For more information about integrations, see [Connecting Workload + * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * + * @param listProviderTypeInstancesOptions the {@link ListProviderTypeInstancesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstancesResponse} + */ + public ServiceCall listProviderTypeInstances(ListProviderTypeInstancesOptions listProviderTypeInstancesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listProviderTypeInstancesOptions, + "listProviderTypeInstancesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_type_id", listProviderTypeInstancesOptions.providerTypeId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}/provider_type_instances", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listProviderTypeInstances"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listProviderTypeInstancesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listProviderTypeInstancesOptions.xCorrelationId()); + } + if (listProviderTypeInstancesOptions.xRequestId() != null) { + builder.header("X-Request-ID", listProviderTypeInstancesOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create a provider type instance. + * + * Create an instance of a provider type. For more information about integrations, see [Connecting Workload + * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * + * @param createProviderTypeInstanceOptions the {@link CreateProviderTypeInstanceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstanceItem} + */ + public ServiceCall createProviderTypeInstance(CreateProviderTypeInstanceOptions createProviderTypeInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createProviderTypeInstanceOptions, + "createProviderTypeInstanceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_type_id", createProviderTypeInstanceOptions.providerTypeId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}/provider_type_instances", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createProviderTypeInstance"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (createProviderTypeInstanceOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", createProviderTypeInstanceOptions.xCorrelationId()); + } + if (createProviderTypeInstanceOptions.xRequestId() != null) { + builder.header("X-Request-ID", createProviderTypeInstanceOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + if (createProviderTypeInstanceOptions.name() != null) { + contentJson.addProperty("name", createProviderTypeInstanceOptions.name()); + } + if (createProviderTypeInstanceOptions.attributes() != null) { + contentJson.add("attributes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createProviderTypeInstanceOptions.attributes())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Remove a specific instance of a provider type. + * + * Remove a specific instance of a provider type. + * + * @param deleteProviderTypeInstanceOptions the {@link DeleteProviderTypeInstanceOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall deleteProviderTypeInstance(DeleteProviderTypeInstanceOptions deleteProviderTypeInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteProviderTypeInstanceOptions, + "deleteProviderTypeInstanceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_type_id", deleteProviderTypeInstanceOptions.providerTypeId()); + pathParamsMap.put("provider_type_instance_id", deleteProviderTypeInstanceOptions.providerTypeInstanceId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}/provider_type_instances/{provider_type_instance_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "deleteProviderTypeInstance"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + if (deleteProviderTypeInstanceOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", deleteProviderTypeInstanceOptions.xCorrelationId()); + } + if (deleteProviderTypeInstanceOptions.xRequestId() != null) { + builder.header("X-Request-ID", deleteProviderTypeInstanceOptions.xRequestId()); + } + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List a provider type instance. + * + * Retrieve a provider type instance by specifying the provider type ID, and Security and Compliance Center instance + * ID. For more information about integrations, see [Connecting Workload + * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * + * @param getProviderTypeInstanceOptions the {@link GetProviderTypeInstanceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstanceItem} + */ + public ServiceCall getProviderTypeInstance(GetProviderTypeInstanceOptions getProviderTypeInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getProviderTypeInstanceOptions, + "getProviderTypeInstanceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_type_id", getProviderTypeInstanceOptions.providerTypeId()); + pathParamsMap.put("provider_type_instance_id", getProviderTypeInstanceOptions.providerTypeInstanceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}/provider_type_instances/{provider_type_instance_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProviderTypeInstance"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getProviderTypeInstanceOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getProviderTypeInstanceOptions.xCorrelationId()); + } + if (getProviderTypeInstanceOptions.xRequestId() != null) { + builder.header("X-Request-ID", getProviderTypeInstanceOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Patch a specific instance of a provider type. + * + * Patch a specific instance of a provider type. + * + * @param updateProviderTypeInstanceOptions the {@link UpdateProviderTypeInstanceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstanceItem} + */ + public ServiceCall updateProviderTypeInstance(UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateProviderTypeInstanceOptions, + "updateProviderTypeInstanceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_type_id", updateProviderTypeInstanceOptions.providerTypeId()); + pathParamsMap.put("provider_type_instance_id", updateProviderTypeInstanceOptions.providerTypeInstanceId()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}/provider_type_instances/{provider_type_instance_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "updateProviderTypeInstance"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (updateProviderTypeInstanceOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", updateProviderTypeInstanceOptions.xCorrelationId()); + } + if (updateProviderTypeInstanceOptions.xRequestId() != null) { + builder.header("X-Request-ID", updateProviderTypeInstanceOptions.xRequestId()); + } + final JsonObject contentJson = new JsonObject(); + if (updateProviderTypeInstanceOptions.name() != null) { + contentJson.addProperty("name", updateProviderTypeInstanceOptions.name()); + } + if (updateProviderTypeInstanceOptions.attributes() != null) { + contentJson.add("attributes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateProviderTypeInstanceOptions.attributes())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get a list of instances for all provider types. + * + * Get a list of instances for all provider types. + * + * @param getProviderTypesInstancesOptions the {@link GetProviderTypesInstancesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypesInstancesResponse} + */ + public ServiceCall getProviderTypesInstances(GetProviderTypesInstancesOptions getProviderTypesInstancesOptions) { + if (getProviderTypesInstancesOptions == null) { + getProviderTypesInstancesOptions = new GetProviderTypesInstancesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types_instances")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProviderTypesInstances"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getProviderTypesInstancesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getProviderTypesInstancesOptions.xCorrelationId()); + } + if (getProviderTypesInstancesOptions.xRequestId() != null) { + builder.header("X-Request-ID", getProviderTypesInstancesOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get a list of instances for all provider types. + * + * Get a list of instances for all provider types. + * + * @return a {@link ServiceCall} with a result of type {@link ProviderTypesInstancesResponse} + */ + public ServiceCall getProviderTypesInstances() { + return getProviderTypesInstances(null); + } + +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Account.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Account.java new file mode 100644 index 00000000..d3a86d37 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Account.java @@ -0,0 +1,61 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The account that is associated with a report. + */ +public class Account extends GenericModel { + + protected String id; + protected String name; + protected String type; + + protected Account() { } + + /** + * Gets the id. + * + * The account ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the name. + * + * The account name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the type. + * + * The account type. + * + * @return the type + */ + public String getType() { + return type; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalProperty.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalProperty.java new file mode 100644 index 00000000..8cc83f7d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalProperty.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * AdditionalProperty. + */ +public class AdditionalProperty extends GenericModel { + + /** + * An additional property that indicates the type of the attribute in various formats (text, url, secret, label, + * masked). + */ + public interface Type { + /** secret. */ + String SECRET = "secret"; + /** label. */ + String LABEL = "label"; + /** url. */ + String URL = "url"; + /** text. */ + String TEXT = "text"; + /** masked. */ + String MASKED = "masked"; + } + + protected String type; + @SerializedName("display_name") + protected String displayName; + + protected AdditionalProperty() { } + + /** + * Gets the type. + * + * An additional property that indicates the type of the attribute in various formats (text, url, secret, label, + * masked). + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the displayName. + * + * The name of the attribute that is displayed in the UI. + * + * @return the displayName + */ + public String getDisplayName() { + return displayName; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttribute.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttribute.java new file mode 100644 index 00000000..903b126b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttribute.java @@ -0,0 +1,196 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The additional target attribute of the service. + */ +public class AdditionalTargetAttribute extends GenericModel { + + /** + * The operator. + */ + public interface Operator { + /** string_equals. */ + String STRING_EQUALS = "string_equals"; + /** string_not_equals. */ + String STRING_NOT_EQUALS = "string_not_equals"; + /** string_match. */ + String STRING_MATCH = "string_match"; + /** string_not_match. */ + String STRING_NOT_MATCH = "string_not_match"; + /** string_contains. */ + String STRING_CONTAINS = "string_contains"; + /** string_not_contains. */ + String STRING_NOT_CONTAINS = "string_not_contains"; + /** num_equals. */ + String NUM_EQUALS = "num_equals"; + /** num_not_equals. */ + String NUM_NOT_EQUALS = "num_not_equals"; + /** num_less_than. */ + String NUM_LESS_THAN = "num_less_than"; + /** num_less_than_equals. */ + String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; + /** num_greater_than. */ + String NUM_GREATER_THAN = "num_greater_than"; + /** num_greater_than_equals. */ + String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; + /** is_empty. */ + String IS_EMPTY = "is_empty"; + /** is_not_empty. */ + String IS_NOT_EMPTY = "is_not_empty"; + /** is_true. */ + String IS_TRUE = "is_true"; + /** is_false. */ + String IS_FALSE = "is_false"; + /** strings_in_list. */ + String STRINGS_IN_LIST = "strings_in_list"; + /** strings_allowed. */ + String STRINGS_ALLOWED = "strings_allowed"; + /** strings_required. */ + String STRINGS_REQUIRED = "strings_required"; + /** ips_in_range. */ + String IPS_IN_RANGE = "ips_in_range"; + /** ips_equals. */ + String IPS_EQUALS = "ips_equals"; + /** ips_not_equals. */ + String IPS_NOT_EQUALS = "ips_not_equals"; + /** days_less_than. */ + String DAYS_LESS_THAN = "days_less_than"; + } + + protected String name; + protected String operator; + protected String value; + + /** + * Builder. + */ + public static class Builder { + private String name; + private String operator; + private String value; + + /** + * Instantiates a new Builder from an existing AdditionalTargetAttribute instance. + * + * @param additionalTargetAttribute the instance to initialize the Builder with + */ + private Builder(AdditionalTargetAttribute additionalTargetAttribute) { + this.name = additionalTargetAttribute.name; + this.operator = additionalTargetAttribute.operator; + this.value = additionalTargetAttribute.value; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a AdditionalTargetAttribute. + * + * @return the new AdditionalTargetAttribute instance + */ + public AdditionalTargetAttribute build() { + return new AdditionalTargetAttribute(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the AdditionalTargetAttribute builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the operator. + * + * @param operator the operator + * @return the AdditionalTargetAttribute builder + */ + public Builder operator(String operator) { + this.operator = operator; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the AdditionalTargetAttribute builder + */ + public Builder value(String value) { + this.value = value; + return this; + } + } + + protected AdditionalTargetAttribute() { } + + protected AdditionalTargetAttribute(Builder builder) { + name = builder.name; + operator = builder.operator; + value = builder.value; + } + + /** + * New builder. + * + * @return a AdditionalTargetAttribute builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the name. + * + * The additional target attribute name. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the operator. + * + * The operator. + * + * @return the operator + */ + public String operator() { + return operator; + } + + /** + * Gets the value. + * + * The value. + * + * @return the value + */ + public String value() { + return value; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Assessment.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Assessment.java new file mode 100644 index 00000000..de93bf9e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Assessment.java @@ -0,0 +1,105 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control specification assessment. + */ +public class Assessment extends GenericModel { + + @SerializedName("assessment_id") + protected String assessmentId; + @SerializedName("assessment_type") + protected String assessmentType; + @SerializedName("assessment_method") + protected String assessmentMethod; + @SerializedName("assessment_description") + protected String assessmentDescription; + @SerializedName("parameter_count") + protected Long parameterCount; + protected List parameters; + + protected Assessment() { } + + /** + * Gets the assessmentId. + * + * The assessment ID. + * + * @return the assessmentId + */ + public String getAssessmentId() { + return assessmentId; + } + + /** + * Gets the assessmentType. + * + * The assessment type. + * + * @return the assessmentType + */ + public String getAssessmentType() { + return assessmentType; + } + + /** + * Gets the assessmentMethod. + * + * The assessment method. + * + * @return the assessmentMethod + */ + public String getAssessmentMethod() { + return assessmentMethod; + } + + /** + * Gets the assessmentDescription. + * + * The assessment description. + * + * @return the assessmentDescription + */ + public String getAssessmentDescription() { + return assessmentDescription; + } + + /** + * Gets the parameterCount. + * + * The number of parameters of this assessment. + * + * @return the parameterCount + */ + public Long getParameterCount() { + return parameterCount; + } + + /** + * Gets the parameters. + * + * The list of parameters of this assessment. + * + * @return the parameters + */ + public List getParameters() { + return parameters; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Attachment.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Attachment.java new file mode 100644 index 00000000..fc93fd68 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Attachment.java @@ -0,0 +1,87 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The attachment that is associated with a report. + */ +public class Attachment extends GenericModel { + + protected String id; + protected String name; + protected String description; + protected String schedule; + protected List scope; + + protected Attachment() { } + + /** + * Gets the id. + * + * The attachment ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the name. + * + * The name of the attachment. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the description. + * + * The description of the attachment. + * + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * Gets the schedule. + * + * The attachment schedule. + * + * @return the schedule + */ + public String getSchedule() { + return schedule; + } + + /** + * Gets the scope. + * + * The scope of the attachment. + * + * @return the scope + */ + public List getScope() { + return scope; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollection.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollection.java new file mode 100644 index 00000000..a412a2fa --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollection.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body of an attachment. + */ +public class AttachmentCollection extends GenericModel { + + @SerializedName("total_count") + protected Long totalCount; + protected Long limit; + protected PaginatedCollectionFirst first; + protected PaginatedCollectionNext next; + protected List attachments; + + protected AttachmentCollection() { } + + /** + * Gets the totalCount. + * + * The number of attachments. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the limit. + * + * The limit of attachments per request. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the first. + * + * The reference to the first page of entries. + * + * @return the first + */ + public PaginatedCollectionFirst getFirst() { + return first; + } + + /** + * Gets the next. + * + * The reference URL for the next few entries. + * + * @return the next + */ + public PaginatedCollectionNext getNext() { + return next; + } + + /** + * Gets the attachments. + * + * The list of attachments. + * + * @return the attachments + */ + public List getAttachments() { + return attachments; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItem.java new file mode 100644 index 00000000..f879bb86 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItem.java @@ -0,0 +1,579 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The request payload of the attachments parameter. + */ +public class AttachmentItem extends GenericModel { + + /** + * The status of an attachment evaluation. + */ + public interface Status { + /** enabled. */ + String ENABLED = "enabled"; + /** disabled. */ + String DISABLED = "disabled"; + } + + /** + * The schedule of an attachment evaluation. + */ + public interface Schedule { + /** daily. */ + String DAILY = "daily"; + /** every_7_days. */ + String EVERY_7_DAYS = "every_7_days"; + /** every_30_days. */ + String EVERY_30_DAYS = "every_30_days"; + } + + protected String id; + @SerializedName("profile_id") + protected String profileId; + @SerializedName("account_id") + protected String accountId; + @SerializedName("instance_id") + protected String instanceId; + protected List scope; + @SerializedName("created_on") + protected Date createdOn; + @SerializedName("created_by") + protected String createdBy; + @SerializedName("updated_on") + protected Date updatedOn; + @SerializedName("updated_by") + protected String updatedBy; + protected String status; + protected String schedule; + protected AttachmentsNotificationsPrototype notifications; + @SerializedName("attachment_parameters") + protected List attachmentParameters; + @SerializedName("last_scan") + protected LastScan lastScan; + @SerializedName("next_scan_time") + protected Date nextScanTime; + protected String name; + protected String description; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String profileId; + private String accountId; + private String instanceId; + private List scope; + private Date createdOn; + private String createdBy; + private Date updatedOn; + private String updatedBy; + private String status; + private String schedule; + private AttachmentsNotificationsPrototype notifications; + private List attachmentParameters; + private LastScan lastScan; + private Date nextScanTime; + private String name; + private String description; + + /** + * Instantiates a new Builder from an existing AttachmentItem instance. + * + * @param attachmentItem the instance to initialize the Builder with + */ + private Builder(AttachmentItem attachmentItem) { + this.id = attachmentItem.id; + this.profileId = attachmentItem.profileId; + this.accountId = attachmentItem.accountId; + this.instanceId = attachmentItem.instanceId; + this.scope = attachmentItem.scope; + this.createdOn = attachmentItem.createdOn; + this.createdBy = attachmentItem.createdBy; + this.updatedOn = attachmentItem.updatedOn; + this.updatedBy = attachmentItem.updatedBy; + this.status = attachmentItem.status; + this.schedule = attachmentItem.schedule; + this.notifications = attachmentItem.notifications; + this.attachmentParameters = attachmentItem.attachmentParameters; + this.lastScan = attachmentItem.lastScan; + this.nextScanTime = attachmentItem.nextScanTime; + this.name = attachmentItem.name; + this.description = attachmentItem.description; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a AttachmentItem. + * + * @return the new AttachmentItem instance + */ + public AttachmentItem build() { + return new AttachmentItem(this); + } + + /** + * Adds an scope to scope. + * + * @param scope the new scope + * @return the AttachmentItem builder + */ + public Builder addScope(MultiCloudScope scope) { + com.ibm.cloud.sdk.core.util.Validator.notNull(scope, + "scope cannot be null"); + if (this.scope == null) { + this.scope = new ArrayList(); + } + this.scope.add(scope); + return this; + } + + /** + * Adds an attachmentParameters to attachmentParameters. + * + * @param attachmentParameters the new attachmentParameters + * @return the AttachmentItem builder + */ + public Builder addAttachmentParameters(AttachmentParameterPrototype attachmentParameters) { + com.ibm.cloud.sdk.core.util.Validator.notNull(attachmentParameters, + "attachmentParameters cannot be null"); + if (this.attachmentParameters == null) { + this.attachmentParameters = new ArrayList(); + } + this.attachmentParameters.add(attachmentParameters); + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the AttachmentItem builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the profileId. + * + * @param profileId the profileId + * @return the AttachmentItem builder + */ + public Builder profileId(String profileId) { + this.profileId = profileId; + return this; + } + + /** + * Set the accountId. + * + * @param accountId the accountId + * @return the AttachmentItem builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set the instanceId. + * + * @param instanceId the instanceId + * @return the AttachmentItem builder + */ + public Builder instanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Set the scope. + * Existing scope will be replaced. + * + * @param scope the scope + * @return the AttachmentItem builder + */ + public Builder scope(List scope) { + this.scope = scope; + return this; + } + + /** + * Set the createdOn. + * + * @param createdOn the createdOn + * @return the AttachmentItem builder + */ + public Builder createdOn(Date createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Set the createdBy. + * + * @param createdBy the createdBy + * @return the AttachmentItem builder + */ + public Builder createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Set the updatedOn. + * + * @param updatedOn the updatedOn + * @return the AttachmentItem builder + */ + public Builder updatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + /** + * Set the updatedBy. + * + * @param updatedBy the updatedBy + * @return the AttachmentItem builder + */ + public Builder updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the AttachmentItem builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * Set the schedule. + * + * @param schedule the schedule + * @return the AttachmentItem builder + */ + public Builder schedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Set the notifications. + * + * @param notifications the notifications + * @return the AttachmentItem builder + */ + public Builder notifications(AttachmentsNotificationsPrototype notifications) { + this.notifications = notifications; + return this; + } + + /** + * Set the attachmentParameters. + * Existing attachmentParameters will be replaced. + * + * @param attachmentParameters the attachmentParameters + * @return the AttachmentItem builder + */ + public Builder attachmentParameters(List attachmentParameters) { + this.attachmentParameters = attachmentParameters; + return this; + } + + /** + * Set the lastScan. + * + * @param lastScan the lastScan + * @return the AttachmentItem builder + */ + public Builder lastScan(LastScan lastScan) { + this.lastScan = lastScan; + return this; + } + + /** + * Set the nextScanTime. + * + * @param nextScanTime the nextScanTime + * @return the AttachmentItem builder + */ + public Builder nextScanTime(Date nextScanTime) { + this.nextScanTime = nextScanTime; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the AttachmentItem builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the AttachmentItem builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + } + + protected AttachmentItem() { } + + protected AttachmentItem(Builder builder) { + id = builder.id; + profileId = builder.profileId; + accountId = builder.accountId; + instanceId = builder.instanceId; + scope = builder.scope; + createdOn = builder.createdOn; + createdBy = builder.createdBy; + updatedOn = builder.updatedOn; + updatedBy = builder.updatedBy; + status = builder.status; + schedule = builder.schedule; + notifications = builder.notifications; + attachmentParameters = builder.attachmentParameters; + lastScan = builder.lastScan; + nextScanTime = builder.nextScanTime; + name = builder.name; + description = builder.description; + } + + /** + * New builder. + * + * @return a AttachmentItem builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The ID of the attachment. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the profileId. + * + * The ID of the profile that is specified in the attachment. + * + * @return the profileId + */ + public String profileId() { + return profileId; + } + + /** + * Gets the accountId. + * + * The account ID that is associated to the attachment. + * + * @return the accountId + */ + public String accountId() { + return accountId; + } + + /** + * Gets the instanceId. + * + * The instance ID of the account that is associated to the attachment. + * + * @return the instanceId + */ + public String instanceId() { + return instanceId; + } + + /** + * Gets the scope. + * + * The scope payload for the multi cloud feature. + * + * @return the scope + */ + public List scope() { + return scope; + } + + /** + * Gets the createdOn. + * + * The date when the attachment was created. + * + * @return the createdOn + */ + public Date createdOn() { + return createdOn; + } + + /** + * Gets the createdBy. + * + * The user who created the attachment. + * + * @return the createdBy + */ + public String createdBy() { + return createdBy; + } + + /** + * Gets the updatedOn. + * + * The date when the attachment was updated. + * + * @return the updatedOn + */ + public Date updatedOn() { + return updatedOn; + } + + /** + * Gets the updatedBy. + * + * The user who updated the attachment. + * + * @return the updatedBy + */ + public String updatedBy() { + return updatedBy; + } + + /** + * Gets the status. + * + * The status of an attachment evaluation. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the schedule. + * + * The schedule of an attachment evaluation. + * + * @return the schedule + */ + public String schedule() { + return schedule; + } + + /** + * Gets the notifications. + * + * The request payload of the attachment notifications. + * + * @return the notifications + */ + public AttachmentsNotificationsPrototype notifications() { + return notifications; + } + + /** + * Gets the attachmentParameters. + * + * The profile parameters for the attachment. + * + * @return the attachmentParameters + */ + public List attachmentParameters() { + return attachmentParameters; + } + + /** + * Gets the lastScan. + * + * The details of the last scan of an attachment. + * + * @return the lastScan + */ + public LastScan lastScan() { + return lastScan; + } + + /** + * Gets the nextScanTime. + * + * The start time of the next scan. + * + * @return the nextScanTime + */ + public Date nextScanTime() { + return nextScanTime; + } + + /** + * Gets the name. + * + * The name of the attachment. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + * The description for the attachment. + * + * @return the description + */ + public String description() { + return description; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototype.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototype.java new file mode 100644 index 00000000..c4f9338a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototype.java @@ -0,0 +1,249 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The parameters related to the Attachment. + */ +public class AttachmentParameterPrototype extends GenericModel { + + /** + * The parameter type. + */ + public interface ParameterType { + /** string. */ + String STRING = "string"; + /** numeric. */ + String NUMERIC = "numeric"; + /** general. */ + String GENERAL = "general"; + /** boolean. */ + String X_BOOLEAN = "boolean"; + /** string_list. */ + String STRING_LIST = "string_list"; + /** ip_list. */ + String IP_LIST = "ip_list"; + /** timestamp. */ + String TIMESTAMP = "timestamp"; + } + + @SerializedName("assessment_type") + protected String assessmentType; + @SerializedName("assessment_id") + protected String assessmentId; + @SerializedName("parameter_name") + protected String parameterName; + @SerializedName("parameter_value") + protected String parameterValue; + @SerializedName("parameter_display_name") + protected String parameterDisplayName; + @SerializedName("parameter_type") + protected String parameterType; + + /** + * Builder. + */ + public static class Builder { + private String assessmentType; + private String assessmentId; + private String parameterName; + private String parameterValue; + private String parameterDisplayName; + private String parameterType; + + /** + * Instantiates a new Builder from an existing AttachmentParameterPrototype instance. + * + * @param attachmentParameterPrototype the instance to initialize the Builder with + */ + private Builder(AttachmentParameterPrototype attachmentParameterPrototype) { + this.assessmentType = attachmentParameterPrototype.assessmentType; + this.assessmentId = attachmentParameterPrototype.assessmentId; + this.parameterName = attachmentParameterPrototype.parameterName; + this.parameterValue = attachmentParameterPrototype.parameterValue; + this.parameterDisplayName = attachmentParameterPrototype.parameterDisplayName; + this.parameterType = attachmentParameterPrototype.parameterType; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a AttachmentParameterPrototype. + * + * @return the new AttachmentParameterPrototype instance + */ + public AttachmentParameterPrototype build() { + return new AttachmentParameterPrototype(this); + } + + /** + * Set the assessmentType. + * + * @param assessmentType the assessmentType + * @return the AttachmentParameterPrototype builder + */ + public Builder assessmentType(String assessmentType) { + this.assessmentType = assessmentType; + return this; + } + + /** + * Set the assessmentId. + * + * @param assessmentId the assessmentId + * @return the AttachmentParameterPrototype builder + */ + public Builder assessmentId(String assessmentId) { + this.assessmentId = assessmentId; + return this; + } + + /** + * Set the parameterName. + * + * @param parameterName the parameterName + * @return the AttachmentParameterPrototype builder + */ + public Builder parameterName(String parameterName) { + this.parameterName = parameterName; + return this; + } + + /** + * Set the parameterValue. + * + * @param parameterValue the parameterValue + * @return the AttachmentParameterPrototype builder + */ + public Builder parameterValue(String parameterValue) { + this.parameterValue = parameterValue; + return this; + } + + /** + * Set the parameterDisplayName. + * + * @param parameterDisplayName the parameterDisplayName + * @return the AttachmentParameterPrototype builder + */ + public Builder parameterDisplayName(String parameterDisplayName) { + this.parameterDisplayName = parameterDisplayName; + return this; + } + + /** + * Set the parameterType. + * + * @param parameterType the parameterType + * @return the AttachmentParameterPrototype builder + */ + public Builder parameterType(String parameterType) { + this.parameterType = parameterType; + return this; + } + } + + protected AttachmentParameterPrototype() { } + + protected AttachmentParameterPrototype(Builder builder) { + assessmentType = builder.assessmentType; + assessmentId = builder.assessmentId; + parameterName = builder.parameterName; + parameterValue = builder.parameterValue; + parameterDisplayName = builder.parameterDisplayName; + parameterType = builder.parameterType; + } + + /** + * New builder. + * + * @return a AttachmentParameterPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assessmentType. + * + * The type of the implementation. + * + * @return the assessmentType + */ + public String assessmentType() { + return assessmentType; + } + + /** + * Gets the assessmentId. + * + * The implementation ID of the parameter. + * + * @return the assessmentId + */ + public String assessmentId() { + return assessmentId; + } + + /** + * Gets the parameterName. + * + * The parameter name. + * + * @return the parameterName + */ + public String parameterName() { + return parameterName; + } + + /** + * Gets the parameterValue. + * + * The value of the parameter. + * + * @return the parameterValue + */ + public String parameterValue() { + return parameterValue; + } + + /** + * Gets the parameterDisplayName. + * + * The parameter display name. + * + * @return the parameterDisplayName + */ + public String parameterDisplayName() { + return parameterDisplayName; + } + + /** + * Gets the parameterType. + * + * The parameter type. + * + * @return the parameterType + */ + public String parameterType() { + return parameterType; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototype.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototype.java new file mode 100644 index 00000000..37c399c0 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototype.java @@ -0,0 +1,151 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The request body of getting an attachment that is associated with your account. + */ +public class AttachmentPrototype extends GenericModel { + + @SerializedName("profile_id") + protected String profileId; + protected List attachments; + + /** + * Builder. + */ + public static class Builder { + private String profileId; + private List attachments; + + /** + * Instantiates a new Builder from an existing AttachmentPrototype instance. + * + * @param attachmentPrototype the instance to initialize the Builder with + */ + private Builder(AttachmentPrototype attachmentPrototype) { + this.profileId = attachmentPrototype.profileId; + this.attachments = attachmentPrototype.attachments; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param attachments the attachments + */ + public Builder(List attachments) { + this.attachments = attachments; + } + + /** + * Builds a AttachmentPrototype. + * + * @return the new AttachmentPrototype instance + */ + public AttachmentPrototype build() { + return new AttachmentPrototype(this); + } + + /** + * Adds an attachments to attachments. + * + * @param attachments the new attachments + * @return the AttachmentPrototype builder + */ + public Builder addAttachments(AttachmentsPrototype attachments) { + com.ibm.cloud.sdk.core.util.Validator.notNull(attachments, + "attachments cannot be null"); + if (this.attachments == null) { + this.attachments = new ArrayList(); + } + this.attachments.add(attachments); + return this; + } + + /** + * Set the profileId. + * + * @param profileId the profileId + * @return the AttachmentPrototype builder + */ + public Builder profileId(String profileId) { + this.profileId = profileId; + return this; + } + + /** + * Set the attachments. + * Existing attachments will be replaced. + * + * @param attachments the attachments + * @return the AttachmentPrototype builder + */ + public Builder attachments(List attachments) { + this.attachments = attachments; + return this; + } + } + + protected AttachmentPrototype() { } + + protected AttachmentPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attachments, + "attachments cannot be null"); + profileId = builder.profileId; + attachments = builder.attachments; + } + + /** + * New builder. + * + * @return a AttachmentPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the profileId. + * + * The ID of the profile that is specified in the attachment. + * + * @return the profileId + */ + public String profileId() { + return profileId; + } + + /** + * Gets the attachments. + * + * The array that displays all of the available attachments. + * + * @return the attachments + */ + public List attachments() { + return attachments; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScope.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScope.java new file mode 100644 index 00000000..20fa5fa9 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScope.java @@ -0,0 +1,65 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A scope of the attachment. + */ +public class AttachmentScope extends GenericModel { + + protected String id; + protected String environment; + @SerializedName("properties") + protected List xProperties; + + protected AttachmentScope() { } + + /** + * Gets the id. + * + * The unique identifier for this scope. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the environment. + * + * The environment that relates to this scope. + * + * @return the environment + */ + public String getEnvironment() { + return environment; + } + + /** + * Gets the xProperties. + * + * The properties that are supported for scoping by this environment. + * + * @return the xProperties + */ + public List getXProperties() { + return xProperties; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsAccountPager.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsAccountPager.java new file mode 100644 index 00000000..f9bb296e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsAccountPager.java @@ -0,0 +1,107 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * AttachmentsAccountPager can be used to simplify the use of the "listAttachmentsAccount" method. + */ +public class AttachmentsAccountPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListAttachmentsAccountOptions options; + protected SecurityAndComplianceCenterApi client; + protected PageContext pageContext; + + // Hide the default ctor. + protected AttachmentsAccountPager() { } + + /** + * Constructs a new AttachmentsAccountPager instance with the specified client and options model instance. + * @param client the SecurityAndComplianceCenterApi instance to be used to invoke the "listAttachmentsAccount" method + * @param options the ListAttachmentsAccountOptions instance to be used to invoke the "listAttachmentsAccount" method + */ + public AttachmentsAccountPager(SecurityAndComplianceCenterApi client, ListAttachmentsAccountOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<AttachmentItem> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListAttachmentsAccountOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + AttachmentCollection result = client.listAttachmentsAccount(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + next = result.getNext().getStart(); + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getAttachments(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<AttachmentItem> containing all results returned by the "listAttachmentsAccount" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototype.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototype.java new file mode 100644 index 00000000..a406ff58 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototype.java @@ -0,0 +1,133 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The request payload of the attachment notifications. + */ +public class AttachmentsNotificationsPrototype extends GenericModel { + + protected Boolean enabled; + protected FailedControls controls; + + /** + * Builder. + */ + public static class Builder { + private Boolean enabled; + private FailedControls controls; + + /** + * Instantiates a new Builder from an existing AttachmentsNotificationsPrototype instance. + * + * @param attachmentsNotificationsPrototype the instance to initialize the Builder with + */ + private Builder(AttachmentsNotificationsPrototype attachmentsNotificationsPrototype) { + this.enabled = attachmentsNotificationsPrototype.enabled; + this.controls = attachmentsNotificationsPrototype.controls; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param enabled the enabled + * @param controls the controls + */ + public Builder(Boolean enabled, FailedControls controls) { + this.enabled = enabled; + this.controls = controls; + } + + /** + * Builds a AttachmentsNotificationsPrototype. + * + * @return the new AttachmentsNotificationsPrototype instance + */ + public AttachmentsNotificationsPrototype build() { + return new AttachmentsNotificationsPrototype(this); + } + + /** + * Set the enabled. + * + * @param enabled the enabled + * @return the AttachmentsNotificationsPrototype builder + */ + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Set the controls. + * + * @param controls the controls + * @return the AttachmentsNotificationsPrototype builder + */ + public Builder controls(FailedControls controls) { + this.controls = controls; + return this; + } + } + + protected AttachmentsNotificationsPrototype() { } + + protected AttachmentsNotificationsPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.enabled, + "enabled cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.controls, + "controls cannot be null"); + enabled = builder.enabled; + controls = builder.controls; + } + + /** + * New builder. + * + * @return a AttachmentsNotificationsPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the enabled. + * + * enabled notifications. + * + * @return the enabled + */ + public Boolean enabled() { + return enabled; + } + + /** + * Gets the controls. + * + * The failed controls. + * + * @return the controls + */ + public FailedControls controls() { + return controls; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPager.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPager.java new file mode 100644 index 00000000..6a5f4af3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPager.java @@ -0,0 +1,107 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * AttachmentsPager can be used to simplify the use of the "listAttachments" method. + */ +public class AttachmentsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListAttachmentsOptions options; + protected SecurityAndComplianceCenterApi client; + protected PageContext pageContext; + + // Hide the default ctor. + protected AttachmentsPager() { } + + /** + * Constructs a new AttachmentsPager instance with the specified client and options model instance. + * @param client the SecurityAndComplianceCenterApi instance to be used to invoke the "listAttachments" method + * @param options the ListAttachmentsOptions instance to be used to invoke the "listAttachments" method + */ + public AttachmentsPager(SecurityAndComplianceCenterApi client, ListAttachmentsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<AttachmentItem> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListAttachmentsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + AttachmentCollection result = client.listAttachments(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + next = result.getNext().getStart(); + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getAttachments(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<AttachmentItem> containing all results returned by the "listAttachments" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototype.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototype.java new file mode 100644 index 00000000..409d7b14 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototype.java @@ -0,0 +1,362 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The request payload of getting all of the attachments that are associated with the account. + */ +public class AttachmentsPrototype extends GenericModel { + + /** + * The status of the scan of an attachment. + */ + public interface Status { + /** enabled. */ + String ENABLED = "enabled"; + /** disabled. */ + String DISABLED = "disabled"; + } + + /** + * The schedule of an attachment evaluation. + */ + public interface Schedule { + /** daily. */ + String DAILY = "daily"; + /** every_7_days. */ + String EVERY_7_DAYS = "every_7_days"; + /** every_30_days. */ + String EVERY_30_DAYS = "every_30_days"; + } + + protected String id; + protected String name; + protected String description; + protected List scope; + protected String status; + protected String schedule; + protected AttachmentsNotificationsPrototype notifications; + @SerializedName("attachment_parameters") + protected List attachmentParameters; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String name; + private String description; + private List scope; + private String status; + private String schedule; + private AttachmentsNotificationsPrototype notifications; + private List attachmentParameters; + + /** + * Instantiates a new Builder from an existing AttachmentsPrototype instance. + * + * @param attachmentsPrototype the instance to initialize the Builder with + */ + private Builder(AttachmentsPrototype attachmentsPrototype) { + this.id = attachmentsPrototype.id; + this.name = attachmentsPrototype.name; + this.description = attachmentsPrototype.description; + this.scope = attachmentsPrototype.scope; + this.status = attachmentsPrototype.status; + this.schedule = attachmentsPrototype.schedule; + this.notifications = attachmentsPrototype.notifications; + this.attachmentParameters = attachmentsPrototype.attachmentParameters; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param name the name + * @param scope the scope + * @param status the status + * @param schedule the schedule + * @param attachmentParameters the attachmentParameters + */ + public Builder(String name, List scope, String status, String schedule, List attachmentParameters) { + this.name = name; + this.scope = scope; + this.status = status; + this.schedule = schedule; + this.attachmentParameters = attachmentParameters; + } + + /** + * Builds a AttachmentsPrototype. + * + * @return the new AttachmentsPrototype instance + */ + public AttachmentsPrototype build() { + return new AttachmentsPrototype(this); + } + + /** + * Adds an scope to scope. + * + * @param scope the new scope + * @return the AttachmentsPrototype builder + */ + public Builder addScope(MultiCloudScope scope) { + com.ibm.cloud.sdk.core.util.Validator.notNull(scope, + "scope cannot be null"); + if (this.scope == null) { + this.scope = new ArrayList(); + } + this.scope.add(scope); + return this; + } + + /** + * Adds an attachmentParameters to attachmentParameters. + * + * @param attachmentParameters the new attachmentParameters + * @return the AttachmentsPrototype builder + */ + public Builder addAttachmentParameters(AttachmentParameterPrototype attachmentParameters) { + com.ibm.cloud.sdk.core.util.Validator.notNull(attachmentParameters, + "attachmentParameters cannot be null"); + if (this.attachmentParameters == null) { + this.attachmentParameters = new ArrayList(); + } + this.attachmentParameters.add(attachmentParameters); + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the AttachmentsPrototype builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the AttachmentsPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the AttachmentsPrototype builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the scope. + * Existing scope will be replaced. + * + * @param scope the scope + * @return the AttachmentsPrototype builder + */ + public Builder scope(List scope) { + this.scope = scope; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the AttachmentsPrototype builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * Set the schedule. + * + * @param schedule the schedule + * @return the AttachmentsPrototype builder + */ + public Builder schedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Set the notifications. + * + * @param notifications the notifications + * @return the AttachmentsPrototype builder + */ + public Builder notifications(AttachmentsNotificationsPrototype notifications) { + this.notifications = notifications; + return this; + } + + /** + * Set the attachmentParameters. + * Existing attachmentParameters will be replaced. + * + * @param attachmentParameters the attachmentParameters + * @return the AttachmentsPrototype builder + */ + public Builder attachmentParameters(List attachmentParameters) { + this.attachmentParameters = attachmentParameters; + return this; + } + } + + protected AttachmentsPrototype() { } + + protected AttachmentsPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, + "name cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.scope, + "scope cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.status, + "status cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.schedule, + "schedule cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attachmentParameters, + "attachmentParameters cannot be null"); + id = builder.id; + name = builder.name; + description = builder.description; + scope = builder.scope; + status = builder.status; + schedule = builder.schedule; + notifications = builder.notifications; + attachmentParameters = builder.attachmentParameters; + } + + /** + * New builder. + * + * @return a AttachmentsPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The id that is generated from the scope type and ID. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the name. + * + * The name that is generated from the scope type and ID. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + * The description for the attachment. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the scope. + * + * The scope payload for the multi cloud feature. + * + * @return the scope + */ + public List scope() { + return scope; + } + + /** + * Gets the status. + * + * The status of the scan of an attachment. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the schedule. + * + * The schedule of an attachment evaluation. + * + * @return the schedule + */ + public String schedule() { + return schedule; + } + + /** + * Gets the notifications. + * + * The request payload of the attachment notifications. + * + * @return the notifications + */ + public AttachmentsNotificationsPrototype notifications() { + return notifications; + } + + /** + * Gets the attachmentParameters. + * + * The profile parameters for the attachment. + * + * @return the attachmentParameters + */ + public List attachmentParameters() { + return attachmentParameters; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScore.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScore.java new file mode 100644 index 00000000..6a67983d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScore.java @@ -0,0 +1,63 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The compliance score. + */ +public class ComplianceScore extends GenericModel { + + protected Long passed; + @SerializedName("total_count") + protected Long totalCount; + protected Long percent; + + protected ComplianceScore() { } + + /** + * Gets the passed. + * + * The number of successful evaluations. + * + * @return the passed + */ + public Long getPassed() { + return passed; + } + + /** + * Gets the totalCount. + * + * The total number of evaluations. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the percent. + * + * The percentage of successful evaluations. + * + * @return the percent + */ + public Long getPercent() { + return percent; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStats.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStats.java new file mode 100644 index 00000000..89b863b1 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStats.java @@ -0,0 +1,117 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The compliance stats. + */ +public class ComplianceStats extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("compliant_count") + protected Long compliantCount; + @SerializedName("not_compliant_count") + protected Long notCompliantCount; + @SerializedName("unable_to_perform_count") + protected Long unableToPerformCount; + @SerializedName("user_evaluation_required_count") + protected Long userEvaluationRequiredCount; + + protected ComplianceStats() { } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of checks. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the compliantCount. + * + * The number of compliant checks. + * + * @return the compliantCount + */ + public Long getCompliantCount() { + return compliantCount; + } + + /** + * Gets the notCompliantCount. + * + * The number of checks that are not compliant. + * + * @return the notCompliantCount + */ + public Long getNotCompliantCount() { + return notCompliantCount; + } + + /** + * Gets the unableToPerformCount. + * + * The number of checks that are unable to perform. + * + * @return the unableToPerformCount + */ + public Long getUnableToPerformCount() { + return unableToPerformCount; + } + + /** + * Gets the userEvaluationRequiredCount. + * + * The number of checks that require a user evaluation. + * + * @return the userEvaluationRequiredCount + */ + public Long getUserEvaluationRequiredCount() { + return userEvaluationRequiredCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocs.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocs.java new file mode 100644 index 00000000..d0c77e41 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocs.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control documentation. + */ +public class ControlDocs extends GenericModel { + + @SerializedName("control_docs_id") + protected String controlDocsId; + @SerializedName("control_docs_type") + protected String controlDocsType; + + /** + * Builder. + */ + public static class Builder { + private String controlDocsId; + private String controlDocsType; + + /** + * Instantiates a new Builder from an existing ControlDocs instance. + * + * @param controlDocs the instance to initialize the Builder with + */ + private Builder(ControlDocs controlDocs) { + this.controlDocsId = controlDocs.controlDocsId; + this.controlDocsType = controlDocs.controlDocsType; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ControlDocs. + * + * @return the new ControlDocs instance + */ + public ControlDocs build() { + return new ControlDocs(this); + } + + /** + * Set the controlDocsId. + * + * @param controlDocsId the controlDocsId + * @return the ControlDocs builder + */ + public Builder controlDocsId(String controlDocsId) { + this.controlDocsId = controlDocsId; + return this; + } + + /** + * Set the controlDocsType. + * + * @param controlDocsType the controlDocsType + * @return the ControlDocs builder + */ + public Builder controlDocsType(String controlDocsType) { + this.controlDocsType = controlDocsType; + return this; + } + } + + protected ControlDocs() { } + + protected ControlDocs(Builder builder) { + controlDocsId = builder.controlDocsId; + controlDocsType = builder.controlDocsType; + } + + /** + * New builder. + * + * @return a ControlDocs builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlDocsId. + * + * The ID of the control documentation. + * + * @return the controlDocsId + */ + public String controlDocsId() { + return controlDocsId; + } + + /** + * Gets the controlDocsType. + * + * The type of control documentation. + * + * @return the controlDocsType + */ + public String controlDocsType() { + return controlDocsType; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrariesPager.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrariesPager.java new file mode 100644 index 00000000..5280dcae --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrariesPager.java @@ -0,0 +1,107 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ControlLibrariesPager can be used to simplify the use of the "listControlLibraries" method. + */ +public class ControlLibrariesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListControlLibrariesOptions options; + protected SecurityAndComplianceCenterApi client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ControlLibrariesPager() { } + + /** + * Constructs a new ControlLibrariesPager instance with the specified client and options model instance. + * @param client the SecurityAndComplianceCenterApi instance to be used to invoke the "listControlLibraries" method + * @param options the ListControlLibrariesOptions instance to be used to invoke the "listControlLibraries" method + */ + public ControlLibrariesPager(SecurityAndComplianceCenterApi client, ListControlLibrariesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<ControlLibraryItem> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListControlLibrariesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ControlLibraryCollection result = client.listControlLibraries(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + next = result.getNext().getStart(); + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getControlLibraries(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<ControlLibraryItem> containing all results returned by the "listControlLibraries" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrary.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrary.java new file mode 100644 index 00000000..6318b945 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibrary.java @@ -0,0 +1,527 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The request payload of the control library. + */ +public class ControlLibrary extends GenericModel { + + /** + * The control library type. + */ + public interface ControlLibraryType { + /** predefined. */ + String PREDEFINED = "predefined"; + /** custom. */ + String CUSTOM = "custom"; + } + + protected String id; + @SerializedName("account_id") + protected String accountId; + @SerializedName("control_library_name") + protected String controlLibraryName; + @SerializedName("control_library_description") + protected String controlLibraryDescription; + @SerializedName("control_library_type") + protected String controlLibraryType; + @SerializedName("version_group_label") + protected String versionGroupLabel; + @SerializedName("control_library_version") + protected String controlLibraryVersion; + @SerializedName("created_on") + protected Date createdOn; + @SerializedName("created_by") + protected String createdBy; + @SerializedName("updated_on") + protected Date updatedOn; + @SerializedName("updated_by") + protected String updatedBy; + protected Boolean latest; + @SerializedName("hierarchy_enabled") + protected Boolean hierarchyEnabled; + @SerializedName("controls_count") + protected Long controlsCount; + @SerializedName("control_parents_count") + protected Long controlParentsCount; + protected List controls; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String accountId; + private String controlLibraryName; + private String controlLibraryDescription; + private String controlLibraryType; + private String versionGroupLabel; + private String controlLibraryVersion; + private Date createdOn; + private String createdBy; + private Date updatedOn; + private String updatedBy; + private Boolean latest; + private Boolean hierarchyEnabled; + private Long controlsCount; + private Long controlParentsCount; + private List controls; + + /** + * Instantiates a new Builder from an existing ControlLibrary instance. + * + * @param controlLibrary the instance to initialize the Builder with + */ + private Builder(ControlLibrary controlLibrary) { + this.id = controlLibrary.id; + this.accountId = controlLibrary.accountId; + this.controlLibraryName = controlLibrary.controlLibraryName; + this.controlLibraryDescription = controlLibrary.controlLibraryDescription; + this.controlLibraryType = controlLibrary.controlLibraryType; + this.versionGroupLabel = controlLibrary.versionGroupLabel; + this.controlLibraryVersion = controlLibrary.controlLibraryVersion; + this.createdOn = controlLibrary.createdOn; + this.createdBy = controlLibrary.createdBy; + this.updatedOn = controlLibrary.updatedOn; + this.updatedBy = controlLibrary.updatedBy; + this.latest = controlLibrary.latest; + this.hierarchyEnabled = controlLibrary.hierarchyEnabled; + this.controlsCount = controlLibrary.controlsCount; + this.controlParentsCount = controlLibrary.controlParentsCount; + this.controls = controlLibrary.controls; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ControlLibrary. + * + * @return the new ControlLibrary instance + */ + public ControlLibrary build() { + return new ControlLibrary(this); + } + + /** + * Adds an controls to controls. + * + * @param controls the new controls + * @return the ControlLibrary builder + */ + public Builder addControls(ControlsInControlLib controls) { + com.ibm.cloud.sdk.core.util.Validator.notNull(controls, + "controls cannot be null"); + if (this.controls == null) { + this.controls = new ArrayList(); + } + this.controls.add(controls); + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the ControlLibrary builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the accountId. + * + * @param accountId the accountId + * @return the ControlLibrary builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set the controlLibraryName. + * + * @param controlLibraryName the controlLibraryName + * @return the ControlLibrary builder + */ + public Builder controlLibraryName(String controlLibraryName) { + this.controlLibraryName = controlLibraryName; + return this; + } + + /** + * Set the controlLibraryDescription. + * + * @param controlLibraryDescription the controlLibraryDescription + * @return the ControlLibrary builder + */ + public Builder controlLibraryDescription(String controlLibraryDescription) { + this.controlLibraryDescription = controlLibraryDescription; + return this; + } + + /** + * Set the controlLibraryType. + * + * @param controlLibraryType the controlLibraryType + * @return the ControlLibrary builder + */ + public Builder controlLibraryType(String controlLibraryType) { + this.controlLibraryType = controlLibraryType; + return this; + } + + /** + * Set the versionGroupLabel. + * + * @param versionGroupLabel the versionGroupLabel + * @return the ControlLibrary builder + */ + public Builder versionGroupLabel(String versionGroupLabel) { + this.versionGroupLabel = versionGroupLabel; + return this; + } + + /** + * Set the controlLibraryVersion. + * + * @param controlLibraryVersion the controlLibraryVersion + * @return the ControlLibrary builder + */ + public Builder controlLibraryVersion(String controlLibraryVersion) { + this.controlLibraryVersion = controlLibraryVersion; + return this; + } + + /** + * Set the createdOn. + * + * @param createdOn the createdOn + * @return the ControlLibrary builder + */ + public Builder createdOn(Date createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Set the createdBy. + * + * @param createdBy the createdBy + * @return the ControlLibrary builder + */ + public Builder createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Set the updatedOn. + * + * @param updatedOn the updatedOn + * @return the ControlLibrary builder + */ + public Builder updatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + /** + * Set the updatedBy. + * + * @param updatedBy the updatedBy + * @return the ControlLibrary builder + */ + public Builder updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Set the latest. + * + * @param latest the latest + * @return the ControlLibrary builder + */ + public Builder latest(Boolean latest) { + this.latest = latest; + return this; + } + + /** + * Set the hierarchyEnabled. + * + * @param hierarchyEnabled the hierarchyEnabled + * @return the ControlLibrary builder + */ + public Builder hierarchyEnabled(Boolean hierarchyEnabled) { + this.hierarchyEnabled = hierarchyEnabled; + return this; + } + + /** + * Set the controlsCount. + * + * @param controlsCount the controlsCount + * @return the ControlLibrary builder + */ + public Builder controlsCount(long controlsCount) { + this.controlsCount = controlsCount; + return this; + } + + /** + * Set the controlParentsCount. + * + * @param controlParentsCount the controlParentsCount + * @return the ControlLibrary builder + */ + public Builder controlParentsCount(long controlParentsCount) { + this.controlParentsCount = controlParentsCount; + return this; + } + + /** + * Set the controls. + * Existing controls will be replaced. + * + * @param controls the controls + * @return the ControlLibrary builder + */ + public Builder controls(List controls) { + this.controls = controls; + return this; + } + } + + protected ControlLibrary() { } + + protected ControlLibrary(Builder builder) { + id = builder.id; + accountId = builder.accountId; + controlLibraryName = builder.controlLibraryName; + controlLibraryDescription = builder.controlLibraryDescription; + controlLibraryType = builder.controlLibraryType; + versionGroupLabel = builder.versionGroupLabel; + controlLibraryVersion = builder.controlLibraryVersion; + createdOn = builder.createdOn; + createdBy = builder.createdBy; + updatedOn = builder.updatedOn; + updatedBy = builder.updatedBy; + latest = builder.latest; + hierarchyEnabled = builder.hierarchyEnabled; + controlsCount = builder.controlsCount; + controlParentsCount = builder.controlParentsCount; + controls = builder.controls; + } + + /** + * New builder. + * + * @return a ControlLibrary builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The control library ID. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the accountId. + * + * The account ID. + * + * @return the accountId + */ + public String accountId() { + return accountId; + } + + /** + * Gets the controlLibraryName. + * + * The control library name. + * + * @return the controlLibraryName + */ + public String controlLibraryName() { + return controlLibraryName; + } + + /** + * Gets the controlLibraryDescription. + * + * The control library description. + * + * @return the controlLibraryDescription + */ + public String controlLibraryDescription() { + return controlLibraryDescription; + } + + /** + * Gets the controlLibraryType. + * + * The control library type. + * + * @return the controlLibraryType + */ + public String controlLibraryType() { + return controlLibraryType; + } + + /** + * Gets the versionGroupLabel. + * + * The version group label. + * + * @return the versionGroupLabel + */ + public String versionGroupLabel() { + return versionGroupLabel; + } + + /** + * Gets the controlLibraryVersion. + * + * The control library version. + * + * @return the controlLibraryVersion + */ + public String controlLibraryVersion() { + return controlLibraryVersion; + } + + /** + * Gets the createdOn. + * + * The date when the control library was created. + * + * @return the createdOn + */ + public Date createdOn() { + return createdOn; + } + + /** + * Gets the createdBy. + * + * The user who created the control library. + * + * @return the createdBy + */ + public String createdBy() { + return createdBy; + } + + /** + * Gets the updatedOn. + * + * The date when the control library was updated. + * + * @return the updatedOn + */ + public Date updatedOn() { + return updatedOn; + } + + /** + * Gets the updatedBy. + * + * The user who updated the control library. + * + * @return the updatedBy + */ + public String updatedBy() { + return updatedBy; + } + + /** + * Gets the latest. + * + * The latest version of the control library. + * + * @return the latest + */ + public Boolean latest() { + return latest; + } + + /** + * Gets the hierarchyEnabled. + * + * The indication of whether hierarchy is enabled for the control library. + * + * @return the hierarchyEnabled + */ + public Boolean hierarchyEnabled() { + return hierarchyEnabled; + } + + /** + * Gets the controlsCount. + * + * The number of controls. + * + * @return the controlsCount + */ + public Long controlsCount() { + return controlsCount; + } + + /** + * Gets the controlParentsCount. + * + * The number of parent controls in the control library. + * + * @return the controlParentsCount + */ + public Long controlParentsCount() { + return controlParentsCount; + } + + /** + * Gets the controls. + * + * The list of controls in a control library. + * + * @return the controls + */ + public List controls() { + return controls; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollection.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollection.java new file mode 100644 index 00000000..45b1df7c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollection.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body of control libraries. + */ +public class ControlLibraryCollection extends GenericModel { + + @SerializedName("total_count") + protected Long totalCount; + protected Long limit; + protected PaginatedCollectionFirst first; + protected PaginatedCollectionNext next; + @SerializedName("control_libraries") + protected List controlLibraries; + + protected ControlLibraryCollection() { } + + /** + * Gets the totalCount. + * + * The number of control libraries. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the limit. + * + * limit. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the first. + * + * The reference to the first page of entries. + * + * @return the first + */ + public PaginatedCollectionFirst getFirst() { + return first; + } + + /** + * Gets the next. + * + * The reference URL for the next few entries. + * + * @return the next + */ + public PaginatedCollectionNext getNext() { + return next; + } + + /** + * Gets the controlLibraries. + * + * The control libraries. + * + * @return the controlLibraries + */ + public List getControlLibraries() { + return controlLibraries; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDelete.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDelete.java new file mode 100644 index 00000000..7e4ed8ee --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDelete.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body of deleting of a control library. + */ +public class ControlLibraryDelete extends GenericModel { + + protected String deleted; + + protected ControlLibraryDelete() { } + + /** + * Gets the deleted. + * + * The delete message of a control library. + * + * @return the deleted + */ + public String getDeleted() { + return deleted; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItem.java new file mode 100644 index 00000000..87335b35 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItem.java @@ -0,0 +1,195 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ControlLibraryItem. + */ +public class ControlLibraryItem extends GenericModel { + + protected String id; + @SerializedName("account_id") + protected String accountId; + @SerializedName("control_library_name") + protected String controlLibraryName; + @SerializedName("control_library_description") + protected String controlLibraryDescription; + @SerializedName("control_library_type") + protected String controlLibraryType; + @SerializedName("created_on") + protected Date createdOn; + @SerializedName("created_by") + protected String createdBy; + @SerializedName("updated_on") + protected Date updatedOn; + @SerializedName("updated_by") + protected String updatedBy; + @SerializedName("version_group_label") + protected String versionGroupLabel; + @SerializedName("control_library_version") + protected String controlLibraryVersion; + protected Boolean latest; + @SerializedName("controls_count") + protected Long controlsCount; + + protected ControlLibraryItem() { } + + /** + * Gets the id. + * + * The ID of the control library. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the accountId. + * + * The Account ID. + * + * @return the accountId + */ + public String getAccountId() { + return accountId; + } + + /** + * Gets the controlLibraryName. + * + * The control library name. + * + * @return the controlLibraryName + */ + public String getControlLibraryName() { + return controlLibraryName; + } + + /** + * Gets the controlLibraryDescription. + * + * The control library description. + * + * @return the controlLibraryDescription + */ + public String getControlLibraryDescription() { + return controlLibraryDescription; + } + + /** + * Gets the controlLibraryType. + * + * The control library type. + * + * @return the controlLibraryType + */ + public String getControlLibraryType() { + return controlLibraryType; + } + + /** + * Gets the createdOn. + * + * The date when the control library was created. + * + * @return the createdOn + */ + public Date getCreatedOn() { + return createdOn; + } + + /** + * Gets the createdBy. + * + * The user who created the control library. + * + * @return the createdBy + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * Gets the updatedOn. + * + * The date when the control library was updated. + * + * @return the updatedOn + */ + public Date getUpdatedOn() { + return updatedOn; + } + + /** + * Gets the updatedBy. + * + * The use who updated the control library. + * + * @return the updatedBy + */ + public String getUpdatedBy() { + return updatedBy; + } + + /** + * Gets the versionGroupLabel. + * + * The version group label. + * + * @return the versionGroupLabel + */ + public String getVersionGroupLabel() { + return versionGroupLabel; + } + + /** + * Gets the controlLibraryVersion. + * + * The control library version. + * + * @return the controlLibraryVersion + */ + public String getControlLibraryVersion() { + return controlLibraryVersion; + } + + /** + * Gets the latest. + * + * The latest control library version. + * + * @return the latest + */ + public Boolean isLatest() { + return latest; + } + + /** + * Gets the controlsCount. + * + * The number of controls. + * + * @return the controlsCount + */ + public Long getControlsCount() { + return controlsCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStats.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStats.java new file mode 100644 index 00000000..2f6fd59f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStats.java @@ -0,0 +1,194 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control specification with compliance stats. + */ +public class ControlSpecificationWithStats extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + @SerializedName("control_specification_id") + protected String controlSpecificationId; + @SerializedName("component_id") + protected String componentId; + @SerializedName("control_specification_description") + protected String controlSpecificationDescription; + protected String environment; + protected String responsibility; + protected List assessments; + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("compliant_count") + protected Long compliantCount; + @SerializedName("not_compliant_count") + protected Long notCompliantCount; + @SerializedName("unable_to_perform_count") + protected Long unableToPerformCount; + @SerializedName("user_evaluation_required_count") + protected Long userEvaluationRequiredCount; + + protected ControlSpecificationWithStats() { } + + /** + * Gets the controlSpecificationId. + * + * The control specification ID. + * + * @return the controlSpecificationId + */ + public String getControlSpecificationId() { + return controlSpecificationId; + } + + /** + * Gets the componentId. + * + * The component ID. + * + * @return the componentId + */ + public String getComponentId() { + return componentId; + } + + /** + * Gets the controlSpecificationDescription. + * + * The component description. + * + * @return the controlSpecificationDescription + */ + public String getControlSpecificationDescription() { + return controlSpecificationDescription; + } + + /** + * Gets the environment. + * + * The environment. + * + * @return the environment + */ + public String getEnvironment() { + return environment; + } + + /** + * Gets the responsibility. + * + * The responsibility for managing control specifications. + * + * @return the responsibility + */ + public String getResponsibility() { + return responsibility; + } + + /** + * Gets the assessments. + * + * The list of assessments. + * + * @return the assessments + */ + public List getAssessments() { + return assessments; + } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of checks. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the compliantCount. + * + * The number of compliant checks. + * + * @return the compliantCount + */ + public Long getCompliantCount() { + return compliantCount; + } + + /** + * Gets the notCompliantCount. + * + * The number of checks that are not compliant. + * + * @return the notCompliantCount + */ + public Long getNotCompliantCount() { + return notCompliantCount; + } + + /** + * Gets the unableToPerformCount. + * + * The number of checks that are unable to perform. + * + * @return the unableToPerformCount + */ + public Long getUnableToPerformCount() { + return unableToPerformCount; + } + + /** + * Gets the userEvaluationRequiredCount. + * + * The number of checks that require a user evaluation. + * + * @return the userEvaluationRequiredCount + */ + public Long getUserEvaluationRequiredCount() { + return userEvaluationRequiredCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java new file mode 100644 index 00000000..da57fcd9 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java @@ -0,0 +1,308 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control specifications of a control library. + */ +public class ControlSpecifications extends GenericModel { + + /** + * The responsibility for managing the control. + */ + public interface Responsibility { + /** user. */ + String USER = "user"; + } + + @SerializedName("control_specification_id") + protected String controlSpecificationId; + protected String responsibility; + @SerializedName("component_id") + protected String componentId; + @SerializedName("componenet_name") + protected String componenetName; + protected String environment; + @SerializedName("control_specification_description") + protected String controlSpecificationDescription; + @SerializedName("assessments_count") + protected Long assessmentsCount; + protected List assessments; + + /** + * Builder. + */ + public static class Builder { + private String controlSpecificationId; + private String responsibility; + private String componentId; + private String componenetName; + private String environment; + private String controlSpecificationDescription; + private Long assessmentsCount; + private List assessments; + + /** + * Instantiates a new Builder from an existing ControlSpecifications instance. + * + * @param controlSpecifications the instance to initialize the Builder with + */ + private Builder(ControlSpecifications controlSpecifications) { + this.controlSpecificationId = controlSpecifications.controlSpecificationId; + this.responsibility = controlSpecifications.responsibility; + this.componentId = controlSpecifications.componentId; + this.componenetName = controlSpecifications.componenetName; + this.environment = controlSpecifications.environment; + this.controlSpecificationDescription = controlSpecifications.controlSpecificationDescription; + this.assessmentsCount = controlSpecifications.assessmentsCount; + this.assessments = controlSpecifications.assessments; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ControlSpecifications. + * + * @return the new ControlSpecifications instance + */ + public ControlSpecifications build() { + return new ControlSpecifications(this); + } + + /** + * Adds an assessments to assessments. + * + * @param assessments the new assessments + * @return the ControlSpecifications builder + */ + public Builder addAssessments(Implementation assessments) { + com.ibm.cloud.sdk.core.util.Validator.notNull(assessments, + "assessments cannot be null"); + if (this.assessments == null) { + this.assessments = new ArrayList(); + } + this.assessments.add(assessments); + return this; + } + + /** + * Set the controlSpecificationId. + * + * @param controlSpecificationId the controlSpecificationId + * @return the ControlSpecifications builder + */ + public Builder controlSpecificationId(String controlSpecificationId) { + this.controlSpecificationId = controlSpecificationId; + return this; + } + + /** + * Set the responsibility. + * + * @param responsibility the responsibility + * @return the ControlSpecifications builder + */ + public Builder responsibility(String responsibility) { + this.responsibility = responsibility; + return this; + } + + /** + * Set the componentId. + * + * @param componentId the componentId + * @return the ControlSpecifications builder + */ + public Builder componentId(String componentId) { + this.componentId = componentId; + return this; + } + + /** + * Set the componenetName. + * + * @param componenetName the componenetName + * @return the ControlSpecifications builder + */ + public Builder componenetName(String componenetName) { + this.componenetName = componenetName; + return this; + } + + /** + * Set the environment. + * + * @param environment the environment + * @return the ControlSpecifications builder + */ + public Builder environment(String environment) { + this.environment = environment; + return this; + } + + /** + * Set the controlSpecificationDescription. + * + * @param controlSpecificationDescription the controlSpecificationDescription + * @return the ControlSpecifications builder + */ + public Builder controlSpecificationDescription(String controlSpecificationDescription) { + this.controlSpecificationDescription = controlSpecificationDescription; + return this; + } + + /** + * Set the assessmentsCount. + * + * @param assessmentsCount the assessmentsCount + * @return the ControlSpecifications builder + */ + public Builder assessmentsCount(long assessmentsCount) { + this.assessmentsCount = assessmentsCount; + return this; + } + + /** + * Set the assessments. + * Existing assessments will be replaced. + * + * @param assessments the assessments + * @return the ControlSpecifications builder + */ + public Builder assessments(List assessments) { + this.assessments = assessments; + return this; + } + } + + protected ControlSpecifications() { } + + protected ControlSpecifications(Builder builder) { + controlSpecificationId = builder.controlSpecificationId; + responsibility = builder.responsibility; + componentId = builder.componentId; + componenetName = builder.componenetName; + environment = builder.environment; + controlSpecificationDescription = builder.controlSpecificationDescription; + assessmentsCount = builder.assessmentsCount; + assessments = builder.assessments; + } + + /** + * New builder. + * + * @return a ControlSpecifications builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlSpecificationId. + * + * The control specification ID. + * + * @return the controlSpecificationId + */ + public String controlSpecificationId() { + return controlSpecificationId; + } + + /** + * Gets the responsibility. + * + * The responsibility for managing the control. + * + * @return the responsibility + */ + public String responsibility() { + return responsibility; + } + + /** + * Gets the componentId. + * + * The component ID. + * + * @return the componentId + */ + public String componentId() { + return componentId; + } + + /** + * Gets the componenetName. + * + * The component name. + * + * @return the componenetName + */ + public String componenetName() { + return componenetName; + } + + /** + * Gets the environment. + * + * The control specifications environment. + * + * @return the environment + */ + public String environment() { + return environment; + } + + /** + * Gets the controlSpecificationDescription. + * + * The control specifications description. + * + * @return the controlSpecificationDescription + */ + public String controlSpecificationDescription() { + return controlSpecificationDescription; + } + + /** + * Gets the assessmentsCount. + * + * The number of assessments. + * + * @return the assessmentsCount + */ + public Long assessmentsCount() { + return assessmentsCount; + } + + /** + * Gets the assessments. + * + * The assessments. + * + * @return the assessments + */ + public List assessments() { + return assessments; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStats.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStats.java new file mode 100644 index 00000000..40281437 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStats.java @@ -0,0 +1,222 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control with compliance stats. + */ +public class ControlWithStats extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + protected String id; + @SerializedName("control_library_id") + protected String controlLibraryId; + @SerializedName("control_library_version") + protected String controlLibraryVersion; + @SerializedName("control_name") + protected String controlName; + @SerializedName("control_description") + protected String controlDescription; + @SerializedName("control_category") + protected String controlCategory; + @SerializedName("control_path") + protected String controlPath; + @SerializedName("control_specifications") + protected List controlSpecifications; + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("compliant_count") + protected Long compliantCount; + @SerializedName("not_compliant_count") + protected Long notCompliantCount; + @SerializedName("unable_to_perform_count") + protected Long unableToPerformCount; + @SerializedName("user_evaluation_required_count") + protected Long userEvaluationRequiredCount; + + protected ControlWithStats() { } + + /** + * Gets the id. + * + * The control ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the controlLibraryId. + * + * The control library ID. + * + * @return the controlLibraryId + */ + public String getControlLibraryId() { + return controlLibraryId; + } + + /** + * Gets the controlLibraryVersion. + * + * The control library version. + * + * @return the controlLibraryVersion + */ + public String getControlLibraryVersion() { + return controlLibraryVersion; + } + + /** + * Gets the controlName. + * + * The control name. + * + * @return the controlName + */ + public String getControlName() { + return controlName; + } + + /** + * Gets the controlDescription. + * + * The control description. + * + * @return the controlDescription + */ + public String getControlDescription() { + return controlDescription; + } + + /** + * Gets the controlCategory. + * + * The control category. + * + * @return the controlCategory + */ + public String getControlCategory() { + return controlCategory; + } + + /** + * Gets the controlPath. + * + * The control path. + * + * @return the controlPath + */ + public String getControlPath() { + return controlPath; + } + + /** + * Gets the controlSpecifications. + * + * The list of specifications that are on the page. + * + * @return the controlSpecifications + */ + public List getControlSpecifications() { + return controlSpecifications; + } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of checks. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the compliantCount. + * + * The number of compliant checks. + * + * @return the compliantCount + */ + public Long getCompliantCount() { + return compliantCount; + } + + /** + * Gets the notCompliantCount. + * + * The number of checks that are not compliant. + * + * @return the notCompliantCount + */ + public Long getNotCompliantCount() { + return notCompliantCount; + } + + /** + * Gets the unableToPerformCount. + * + * The number of checks that are unable to perform. + * + * @return the unableToPerformCount + */ + public Long getUnableToPerformCount() { + return unableToPerformCount; + } + + /** + * Gets the userEvaluationRequiredCount. + * + * The number of checks that require a user evaluation. + * + * @return the userEvaluationRequiredCount + */ + public Long getUserEvaluationRequiredCount() { + return userEvaluationRequiredCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLib.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLib.java new file mode 100644 index 00000000..edf8b87f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLib.java @@ -0,0 +1,383 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control details of a control library. + */ +public class ControlsInControlLib extends GenericModel { + + /** + * The control status. + */ + public interface Status { + /** enabled. */ + String ENABLED = "enabled"; + /** disabled. */ + String DISABLED = "disabled"; + } + + @SerializedName("control_name") + protected String controlName; + @SerializedName("control_id") + protected String controlId; + @SerializedName("control_description") + protected String controlDescription; + @SerializedName("control_category") + protected String controlCategory; + @SerializedName("control_parent") + protected String controlParent; + @SerializedName("control_tags") + protected List controlTags; + @SerializedName("control_specifications") + protected List controlSpecifications; + @SerializedName("control_docs") + protected ControlDocs controlDocs; + @SerializedName("control_requirement") + protected Boolean controlRequirement; + protected String status; + + /** + * Builder. + */ + public static class Builder { + private String controlName; + private String controlId; + private String controlDescription; + private String controlCategory; + private String controlParent; + private List controlTags; + private List controlSpecifications; + private ControlDocs controlDocs; + private Boolean controlRequirement; + private String status; + + /** + * Instantiates a new Builder from an existing ControlsInControlLib instance. + * + * @param controlsInControlLib the instance to initialize the Builder with + */ + private Builder(ControlsInControlLib controlsInControlLib) { + this.controlName = controlsInControlLib.controlName; + this.controlId = controlsInControlLib.controlId; + this.controlDescription = controlsInControlLib.controlDescription; + this.controlCategory = controlsInControlLib.controlCategory; + this.controlParent = controlsInControlLib.controlParent; + this.controlTags = controlsInControlLib.controlTags; + this.controlSpecifications = controlsInControlLib.controlSpecifications; + this.controlDocs = controlsInControlLib.controlDocs; + this.controlRequirement = controlsInControlLib.controlRequirement; + this.status = controlsInControlLib.status; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ControlsInControlLib. + * + * @return the new ControlsInControlLib instance + */ + public ControlsInControlLib build() { + return new ControlsInControlLib(this); + } + + /** + * Adds an controlTags to controlTags. + * + * @param controlTags the new controlTags + * @return the ControlsInControlLib builder + */ + public Builder addControlTags(String controlTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(controlTags, + "controlTags cannot be null"); + if (this.controlTags == null) { + this.controlTags = new ArrayList(); + } + this.controlTags.add(controlTags); + return this; + } + + /** + * Adds an controlSpecifications to controlSpecifications. + * + * @param controlSpecifications the new controlSpecifications + * @return the ControlsInControlLib builder + */ + public Builder addControlSpecifications(ControlSpecifications controlSpecifications) { + com.ibm.cloud.sdk.core.util.Validator.notNull(controlSpecifications, + "controlSpecifications cannot be null"); + if (this.controlSpecifications == null) { + this.controlSpecifications = new ArrayList(); + } + this.controlSpecifications.add(controlSpecifications); + return this; + } + + /** + * Set the controlName. + * + * @param controlName the controlName + * @return the ControlsInControlLib builder + */ + public Builder controlName(String controlName) { + this.controlName = controlName; + return this; + } + + /** + * Set the controlId. + * + * @param controlId the controlId + * @return the ControlsInControlLib builder + */ + public Builder controlId(String controlId) { + this.controlId = controlId; + return this; + } + + /** + * Set the controlDescription. + * + * @param controlDescription the controlDescription + * @return the ControlsInControlLib builder + */ + public Builder controlDescription(String controlDescription) { + this.controlDescription = controlDescription; + return this; + } + + /** + * Set the controlCategory. + * + * @param controlCategory the controlCategory + * @return the ControlsInControlLib builder + */ + public Builder controlCategory(String controlCategory) { + this.controlCategory = controlCategory; + return this; + } + + /** + * Set the controlParent. + * + * @param controlParent the controlParent + * @return the ControlsInControlLib builder + */ + public Builder controlParent(String controlParent) { + this.controlParent = controlParent; + return this; + } + + /** + * Set the controlTags. + * Existing controlTags will be replaced. + * + * @param controlTags the controlTags + * @return the ControlsInControlLib builder + */ + public Builder controlTags(List controlTags) { + this.controlTags = controlTags; + return this; + } + + /** + * Set the controlSpecifications. + * Existing controlSpecifications will be replaced. + * + * @param controlSpecifications the controlSpecifications + * @return the ControlsInControlLib builder + */ + public Builder controlSpecifications(List controlSpecifications) { + this.controlSpecifications = controlSpecifications; + return this; + } + + /** + * Set the controlDocs. + * + * @param controlDocs the controlDocs + * @return the ControlsInControlLib builder + */ + public Builder controlDocs(ControlDocs controlDocs) { + this.controlDocs = controlDocs; + return this; + } + + /** + * Set the controlRequirement. + * + * @param controlRequirement the controlRequirement + * @return the ControlsInControlLib builder + */ + public Builder controlRequirement(Boolean controlRequirement) { + this.controlRequirement = controlRequirement; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the ControlsInControlLib builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + } + + protected ControlsInControlLib() { } + + protected ControlsInControlLib(Builder builder) { + controlName = builder.controlName; + controlId = builder.controlId; + controlDescription = builder.controlDescription; + controlCategory = builder.controlCategory; + controlParent = builder.controlParent; + controlTags = builder.controlTags; + controlSpecifications = builder.controlSpecifications; + controlDocs = builder.controlDocs; + controlRequirement = builder.controlRequirement; + status = builder.status; + } + + /** + * New builder. + * + * @return a ControlsInControlLib builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlName. + * + * The ID of the control library that contains the profile. + * + * @return the controlName + */ + public String controlName() { + return controlName; + } + + /** + * Gets the controlId. + * + * The control name. + * + * @return the controlId + */ + public String controlId() { + return controlId; + } + + /** + * Gets the controlDescription. + * + * The control description. + * + * @return the controlDescription + */ + public String controlDescription() { + return controlDescription; + } + + /** + * Gets the controlCategory. + * + * The control category. + * + * @return the controlCategory + */ + public String controlCategory() { + return controlCategory; + } + + /** + * Gets the controlParent. + * + * The parent control. + * + * @return the controlParent + */ + public String controlParent() { + return controlParent; + } + + /** + * Gets the controlTags. + * + * The control tags. + * + * @return the controlTags + */ + public List controlTags() { + return controlTags; + } + + /** + * Gets the controlSpecifications. + * + * The control specifications. + * + * @return the controlSpecifications + */ + public List controlSpecifications() { + return controlSpecifications; + } + + /** + * Gets the controlDocs. + * + * The control documentation. + * + * @return the controlDocs + */ + public ControlDocs controlDocs() { + return controlDocs; + } + + /** + * Gets the controlRequirement. + * + * Is this a control that can be automated or manually evaluated. + * + * @return the controlRequirement + */ + public Boolean controlRequirement() { + return controlRequirement; + } + + /** + * Gets the status. + * + * The control status. + * + * @return the status + */ + public String status() { + return status; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java new file mode 100644 index 00000000..f6a2cba0 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java @@ -0,0 +1,247 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The createAttachment options. + */ +public class CreateAttachmentOptions extends GenericModel { + + protected String profilesId; + protected List attachments; + protected String profileId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String profilesId; + private List attachments; + private String profileId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing CreateAttachmentOptions instance. + * + * @param createAttachmentOptions the instance to initialize the Builder with + */ + private Builder(CreateAttachmentOptions createAttachmentOptions) { + this.profilesId = createAttachmentOptions.profilesId; + this.attachments = createAttachmentOptions.attachments; + this.profileId = createAttachmentOptions.profileId; + this.xCorrelationId = createAttachmentOptions.xCorrelationId; + this.xRequestId = createAttachmentOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param profilesId the profilesId + * @param attachments the attachments + */ + public Builder(String profilesId, List attachments) { + this.profilesId = profilesId; + this.attachments = attachments; + } + + /** + * Builds a CreateAttachmentOptions. + * + * @return the new CreateAttachmentOptions instance + */ + public CreateAttachmentOptions build() { + return new CreateAttachmentOptions(this); + } + + /** + * Adds an attachments to attachments. + * + * @param attachments the new attachments + * @return the CreateAttachmentOptions builder + */ + public Builder addAttachments(AttachmentsPrototype attachments) { + com.ibm.cloud.sdk.core.util.Validator.notNull(attachments, + "attachments cannot be null"); + if (this.attachments == null) { + this.attachments = new ArrayList(); + } + this.attachments.add(attachments); + return this; + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the CreateAttachmentOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the attachments. + * Existing attachments will be replaced. + * + * @param attachments the attachments + * @return the CreateAttachmentOptions builder + */ + public Builder attachments(List attachments) { + this.attachments = attachments; + return this; + } + + /** + * Set the profileId. + * + * @param profileId the profileId + * @return the CreateAttachmentOptions builder + */ + public Builder profileId(String profileId) { + this.profileId = profileId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the CreateAttachmentOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the CreateAttachmentOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the attachmentPrototype. + * + * @param attachmentPrototype the attachmentPrototype + * @return the CreateAttachmentOptions builder + */ + public Builder attachmentPrototype(AttachmentPrototype attachmentPrototype) { + this.attachments = attachmentPrototype.attachments(); + this.profileId = attachmentPrototype.profileId(); + return this; + } + } + + protected CreateAttachmentOptions() { } + + protected CreateAttachmentOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attachments, + "attachments cannot be null"); + profilesId = builder.profilesId; + attachments = builder.attachments; + profileId = builder.profileId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a CreateAttachmentOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the attachments. + * + * The array that displays all of the available attachments. + * + * @return the attachments + */ + public List attachments() { + return attachments; + } + + /** + * Gets the profileId. + * + * The ID of the profile that is specified in the attachment. + * + * @return the profileId + */ + public String profileId() { + return profileId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptions.java new file mode 100644 index 00000000..cd831032 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptions.java @@ -0,0 +1,383 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The createCustomControlLibrary options. + */ +public class CreateCustomControlLibraryOptions extends GenericModel { + + /** + * The control library type. + */ + public interface ControlLibraryType { + /** predefined. */ + String PREDEFINED = "predefined"; + /** custom. */ + String CUSTOM = "custom"; + } + + protected String controlLibraryName; + protected String controlLibraryDescription; + protected String controlLibraryType; + protected List controls; + protected String versionGroupLabel; + protected String controlLibraryVersion; + protected Boolean latest; + protected Long controlsCount; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String controlLibraryName; + private String controlLibraryDescription; + private String controlLibraryType; + private List controls; + private String versionGroupLabel; + private String controlLibraryVersion; + private Boolean latest; + private Long controlsCount; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing CreateCustomControlLibraryOptions instance. + * + * @param createCustomControlLibraryOptions the instance to initialize the Builder with + */ + private Builder(CreateCustomControlLibraryOptions createCustomControlLibraryOptions) { + this.controlLibraryName = createCustomControlLibraryOptions.controlLibraryName; + this.controlLibraryDescription = createCustomControlLibraryOptions.controlLibraryDescription; + this.controlLibraryType = createCustomControlLibraryOptions.controlLibraryType; + this.controls = createCustomControlLibraryOptions.controls; + this.versionGroupLabel = createCustomControlLibraryOptions.versionGroupLabel; + this.controlLibraryVersion = createCustomControlLibraryOptions.controlLibraryVersion; + this.latest = createCustomControlLibraryOptions.latest; + this.controlsCount = createCustomControlLibraryOptions.controlsCount; + this.xCorrelationId = createCustomControlLibraryOptions.xCorrelationId; + this.xRequestId = createCustomControlLibraryOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param controlLibraryName the controlLibraryName + * @param controlLibraryDescription the controlLibraryDescription + * @param controlLibraryType the controlLibraryType + * @param controls the controls + */ + public Builder(String controlLibraryName, String controlLibraryDescription, String controlLibraryType, List controls) { + this.controlLibraryName = controlLibraryName; + this.controlLibraryDescription = controlLibraryDescription; + this.controlLibraryType = controlLibraryType; + this.controls = controls; + } + + /** + * Builds a CreateCustomControlLibraryOptions. + * + * @return the new CreateCustomControlLibraryOptions instance + */ + public CreateCustomControlLibraryOptions build() { + return new CreateCustomControlLibraryOptions(this); + } + + /** + * Adds an controls to controls. + * + * @param controls the new controls + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder addControls(ControlsInControlLib controls) { + com.ibm.cloud.sdk.core.util.Validator.notNull(controls, + "controls cannot be null"); + if (this.controls == null) { + this.controls = new ArrayList(); + } + this.controls.add(controls); + return this; + } + + /** + * Set the controlLibraryName. + * + * @param controlLibraryName the controlLibraryName + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder controlLibraryName(String controlLibraryName) { + this.controlLibraryName = controlLibraryName; + return this; + } + + /** + * Set the controlLibraryDescription. + * + * @param controlLibraryDescription the controlLibraryDescription + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder controlLibraryDescription(String controlLibraryDescription) { + this.controlLibraryDescription = controlLibraryDescription; + return this; + } + + /** + * Set the controlLibraryType. + * + * @param controlLibraryType the controlLibraryType + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder controlLibraryType(String controlLibraryType) { + this.controlLibraryType = controlLibraryType; + return this; + } + + /** + * Set the controls. + * Existing controls will be replaced. + * + * @param controls the controls + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder controls(List controls) { + this.controls = controls; + return this; + } + + /** + * Set the versionGroupLabel. + * + * @param versionGroupLabel the versionGroupLabel + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder versionGroupLabel(String versionGroupLabel) { + this.versionGroupLabel = versionGroupLabel; + return this; + } + + /** + * Set the controlLibraryVersion. + * + * @param controlLibraryVersion the controlLibraryVersion + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder controlLibraryVersion(String controlLibraryVersion) { + this.controlLibraryVersion = controlLibraryVersion; + return this; + } + + /** + * Set the latest. + * + * @param latest the latest + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder latest(Boolean latest) { + this.latest = latest; + return this; + } + + /** + * Set the controlsCount. + * + * @param controlsCount the controlsCount + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder controlsCount(long controlsCount) { + this.controlsCount = controlsCount; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the CreateCustomControlLibraryOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected CreateCustomControlLibraryOptions() { } + + protected CreateCustomControlLibraryOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.controlLibraryName, + "controlLibraryName cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.controlLibraryDescription, + "controlLibraryDescription cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.controlLibraryType, + "controlLibraryType cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.controls, + "controls cannot be null"); + controlLibraryName = builder.controlLibraryName; + controlLibraryDescription = builder.controlLibraryDescription; + controlLibraryType = builder.controlLibraryType; + controls = builder.controls; + versionGroupLabel = builder.versionGroupLabel; + controlLibraryVersion = builder.controlLibraryVersion; + latest = builder.latest; + controlsCount = builder.controlsCount; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a CreateCustomControlLibraryOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlLibraryName. + * + * The control library name. + * + * @return the controlLibraryName + */ + public String controlLibraryName() { + return controlLibraryName; + } + + /** + * Gets the controlLibraryDescription. + * + * The control library description. + * + * @return the controlLibraryDescription + */ + public String controlLibraryDescription() { + return controlLibraryDescription; + } + + /** + * Gets the controlLibraryType. + * + * The control library type. + * + * @return the controlLibraryType + */ + public String controlLibraryType() { + return controlLibraryType; + } + + /** + * Gets the controls. + * + * The controls. + * + * @return the controls + */ + public List controls() { + return controls; + } + + /** + * Gets the versionGroupLabel. + * + * The version group label. + * + * @return the versionGroupLabel + */ + public String versionGroupLabel() { + return versionGroupLabel; + } + + /** + * Gets the controlLibraryVersion. + * + * The control library version. + * + * @return the controlLibraryVersion + */ + public String controlLibraryVersion() { + return controlLibraryVersion; + } + + /** + * Gets the latest. + * + * The latest control library version. + * + * @return the latest + */ + public Boolean latest() { + return latest; + } + + /** + * Gets the controlsCount. + * + * The number of controls. + * + * @return the controlsCount + */ + public Long controlsCount() { + return controlsCount; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptions.java new file mode 100644 index 00000000..f4bfe47c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptions.java @@ -0,0 +1,326 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The createProfile options. + */ +public class CreateProfileOptions extends GenericModel { + + /** + * The profile type. + */ + public interface ProfileType { + /** predefined. */ + String PREDEFINED = "predefined"; + /** custom. */ + String CUSTOM = "custom"; + } + + protected String profileName; + protected String profileDescription; + protected String profileType; + protected List controls; + protected List defaultParameters; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String profileName; + private String profileDescription; + private String profileType; + private List controls; + private List defaultParameters; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing CreateProfileOptions instance. + * + * @param createProfileOptions the instance to initialize the Builder with + */ + private Builder(CreateProfileOptions createProfileOptions) { + this.profileName = createProfileOptions.profileName; + this.profileDescription = createProfileOptions.profileDescription; + this.profileType = createProfileOptions.profileType; + this.controls = createProfileOptions.controls; + this.defaultParameters = createProfileOptions.defaultParameters; + this.xCorrelationId = createProfileOptions.xCorrelationId; + this.xRequestId = createProfileOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param profileName the profileName + * @param profileDescription the profileDescription + * @param profileType the profileType + * @param controls the controls + * @param defaultParameters the defaultParameters + */ + public Builder(String profileName, String profileDescription, String profileType, List controls, List defaultParameters) { + this.profileName = profileName; + this.profileDescription = profileDescription; + this.profileType = profileType; + this.controls = controls; + this.defaultParameters = defaultParameters; + } + + /** + * Builds a CreateProfileOptions. + * + * @return the new CreateProfileOptions instance + */ + public CreateProfileOptions build() { + return new CreateProfileOptions(this); + } + + /** + * Adds an controls to controls. + * + * @param controls the new controls + * @return the CreateProfileOptions builder + */ + public Builder addControls(ProfileControlsPrototype controls) { + com.ibm.cloud.sdk.core.util.Validator.notNull(controls, + "controls cannot be null"); + if (this.controls == null) { + this.controls = new ArrayList(); + } + this.controls.add(controls); + return this; + } + + /** + * Adds an defaultParameters to defaultParameters. + * + * @param defaultParameters the new defaultParameters + * @return the CreateProfileOptions builder + */ + public Builder addDefaultParameters(DefaultParametersPrototype defaultParameters) { + com.ibm.cloud.sdk.core.util.Validator.notNull(defaultParameters, + "defaultParameters cannot be null"); + if (this.defaultParameters == null) { + this.defaultParameters = new ArrayList(); + } + this.defaultParameters.add(defaultParameters); + return this; + } + + /** + * Set the profileName. + * + * @param profileName the profileName + * @return the CreateProfileOptions builder + */ + public Builder profileName(String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Set the profileDescription. + * + * @param profileDescription the profileDescription + * @return the CreateProfileOptions builder + */ + public Builder profileDescription(String profileDescription) { + this.profileDescription = profileDescription; + return this; + } + + /** + * Set the profileType. + * + * @param profileType the profileType + * @return the CreateProfileOptions builder + */ + public Builder profileType(String profileType) { + this.profileType = profileType; + return this; + } + + /** + * Set the controls. + * Existing controls will be replaced. + * + * @param controls the controls + * @return the CreateProfileOptions builder + */ + public Builder controls(List controls) { + this.controls = controls; + return this; + } + + /** + * Set the defaultParameters. + * Existing defaultParameters will be replaced. + * + * @param defaultParameters the defaultParameters + * @return the CreateProfileOptions builder + */ + public Builder defaultParameters(List defaultParameters) { + this.defaultParameters = defaultParameters; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the CreateProfileOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the CreateProfileOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected CreateProfileOptions() { } + + protected CreateProfileOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileName, + "profileName cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileDescription, + "profileDescription cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileType, + "profileType cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.controls, + "controls cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.defaultParameters, + "defaultParameters cannot be null"); + profileName = builder.profileName; + profileDescription = builder.profileDescription; + profileType = builder.profileType; + controls = builder.controls; + defaultParameters = builder.defaultParameters; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a CreateProfileOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the profileName. + * + * The name of the profile. + * + * @return the profileName + */ + public String profileName() { + return profileName; + } + + /** + * Gets the profileDescription. + * + * The description of the profile. + * + * @return the profileDescription + */ + public String profileDescription() { + return profileDescription; + } + + /** + * Gets the profileType. + * + * The profile type. + * + * @return the profileType + */ + public String profileType() { + return profileType; + } + + /** + * Gets the controls. + * + * The controls that are in the profile. + * + * @return the controls + */ + public List controls() { + return controls; + } + + /** + * Gets the defaultParameters. + * + * The default parameters of the profile. + * + * @return the defaultParameters + */ + public List defaultParameters() { + return defaultParameters; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is used for downstream requests, and retries of those requests. If a value + * of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java new file mode 100644 index 00000000..1430b900 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java @@ -0,0 +1,213 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Map; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The createProviderTypeInstance options. + */ +public class CreateProviderTypeInstanceOptions extends GenericModel { + + protected String providerTypeId; + protected String name; + protected Map attributes; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String providerTypeId; + private String name; + private Map attributes; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing CreateProviderTypeInstanceOptions instance. + * + * @param createProviderTypeInstanceOptions the instance to initialize the Builder with + */ + private Builder(CreateProviderTypeInstanceOptions createProviderTypeInstanceOptions) { + this.providerTypeId = createProviderTypeInstanceOptions.providerTypeId; + this.name = createProviderTypeInstanceOptions.name; + this.attributes = createProviderTypeInstanceOptions.attributes; + this.xCorrelationId = createProviderTypeInstanceOptions.xCorrelationId; + this.xRequestId = createProviderTypeInstanceOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param providerTypeId the providerTypeId + */ + public Builder(String providerTypeId) { + this.providerTypeId = providerTypeId; + } + + /** + * Builds a CreateProviderTypeInstanceOptions. + * + * @return the new CreateProviderTypeInstanceOptions instance + */ + public CreateProviderTypeInstanceOptions build() { + return new CreateProviderTypeInstanceOptions(this); + } + + /** + * Set the providerTypeId. + * + * @param providerTypeId the providerTypeId + * @return the CreateProviderTypeInstanceOptions builder + */ + public Builder providerTypeId(String providerTypeId) { + this.providerTypeId = providerTypeId; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the CreateProviderTypeInstanceOptions builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the attributes. + * + * @param attributes the attributes + * @return the CreateProviderTypeInstanceOptions builder + */ + public Builder attributes(Map attributes) { + this.attributes = attributes; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the CreateProviderTypeInstanceOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the CreateProviderTypeInstanceOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected CreateProviderTypeInstanceOptions() { } + + protected CreateProviderTypeInstanceOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeId, + "providerTypeId cannot be empty"); + providerTypeId = builder.providerTypeId; + name = builder.name; + attributes = builder.attributes; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a CreateProviderTypeInstanceOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerTypeId. + * + * The provider type ID. + * + * @return the providerTypeId + */ + public String providerTypeId() { + return providerTypeId; + } + + /** + * Gets the name. + * + * The provider type instance name. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the attributes. + * + * The attributes for connecting to the provider type instance. + * + * @return the attributes + */ + public Map attributes() { + return attributes; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java new file mode 100644 index 00000000..2b3cb4ad --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java @@ -0,0 +1,353 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The createRule options. + */ +public class CreateRuleOptions extends GenericModel { + + /** + * The rule type (user_defined or system_defined). + */ + public interface Type { + /** user_defined. */ + String USER_DEFINED = "user_defined"; + /** system_defined. */ + String SYSTEM_DEFINED = "system_defined"; + } + + protected String description; + protected Target target; + protected RequiredConfig requiredConfig; + protected String type; + protected String version; + protected Import xImport; + protected List labels; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String description; + private Target target; + private RequiredConfig requiredConfig; + private String type; + private String version; + private Import xImport; + private List labels; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing CreateRuleOptions instance. + * + * @param createRuleOptions the instance to initialize the Builder with + */ + private Builder(CreateRuleOptions createRuleOptions) { + this.description = createRuleOptions.description; + this.target = createRuleOptions.target; + this.requiredConfig = createRuleOptions.requiredConfig; + this.type = createRuleOptions.type; + this.version = createRuleOptions.version; + this.xImport = createRuleOptions.xImport; + this.labels = createRuleOptions.labels; + this.xCorrelationId = createRuleOptions.xCorrelationId; + this.xRequestId = createRuleOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param description the description + * @param target the target + * @param requiredConfig the requiredConfig + */ + public Builder(String description, Target target, RequiredConfig requiredConfig) { + this.description = description; + this.target = target; + this.requiredConfig = requiredConfig; + } + + /** + * Builds a CreateRuleOptions. + * + * @return the new CreateRuleOptions instance + */ + public CreateRuleOptions build() { + return new CreateRuleOptions(this); + } + + /** + * Adds an labels to labels. + * + * @param labels the new labels + * @return the CreateRuleOptions builder + */ + public Builder addLabels(String labels) { + com.ibm.cloud.sdk.core.util.Validator.notNull(labels, + "labels cannot be null"); + if (this.labels == null) { + this.labels = new ArrayList(); + } + this.labels.add(labels); + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the CreateRuleOptions builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the target. + * + * @param target the target + * @return the CreateRuleOptions builder + */ + public Builder target(Target target) { + this.target = target; + return this; + } + + /** + * Set the requiredConfig. + * + * @param requiredConfig the requiredConfig + * @return the CreateRuleOptions builder + */ + public Builder requiredConfig(RequiredConfig requiredConfig) { + this.requiredConfig = requiredConfig; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the CreateRuleOptions builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the version. + * + * @param version the version + * @return the CreateRuleOptions builder + */ + public Builder version(String version) { + this.version = version; + return this; + } + + /** + * Set the xImport. + * + * @param xImport the xImport + * @return the CreateRuleOptions builder + */ + public Builder xImport(Import xImport) { + this.xImport = xImport; + return this; + } + + /** + * Set the labels. + * Existing labels will be replaced. + * + * @param labels the labels + * @return the CreateRuleOptions builder + */ + public Builder labels(List labels) { + this.labels = labels; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the CreateRuleOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the CreateRuleOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected CreateRuleOptions() { } + + protected CreateRuleOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.description, + "description cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, + "target cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.requiredConfig, + "requiredConfig cannot be null"); + description = builder.description; + target = builder.target; + requiredConfig = builder.requiredConfig; + type = builder.type; + version = builder.version; + xImport = builder.xImport; + labels = builder.labels; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a CreateRuleOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the description. + * + * The rule description. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the target. + * + * The rule target. + * + * @return the target + */ + public Target target() { + return target; + } + + /** + * Gets the requiredConfig. + * + * The required configurations. + * + * @return the requiredConfig + */ + public RequiredConfig requiredConfig() { + return requiredConfig; + } + + /** + * Gets the type. + * + * The rule type (user_defined or system_defined). + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the version. + * + * The rule version number. + * + * @return the version + */ + public String version() { + return version; + } + + /** + * Gets the xImport. + * + * The collection of import parameters. + * + * @return the xImport + */ + public Import xImport() { + return xImport; + } + + /** + * Gets the labels. + * + * The list of labels that correspond to a rule. + * + * @return the labels + */ + public List labels() { + return labels; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptions.java new file mode 100644 index 00000000..c0de1569 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The createScan options. + */ +public class CreateScanOptions extends GenericModel { + + protected String attachmentId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String attachmentId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing CreateScanOptions instance. + * + * @param createScanOptions the instance to initialize the Builder with + */ + private Builder(CreateScanOptions createScanOptions) { + this.attachmentId = createScanOptions.attachmentId; + this.xCorrelationId = createScanOptions.xCorrelationId; + this.xRequestId = createScanOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param attachmentId the attachmentId + */ + public Builder(String attachmentId) { + this.attachmentId = attachmentId; + } + + /** + * Builds a CreateScanOptions. + * + * @return the new CreateScanOptions instance + */ + public CreateScanOptions build() { + return new CreateScanOptions(this); + } + + /** + * Set the attachmentId. + * + * @param attachmentId the attachmentId + * @return the CreateScanOptions builder + */ + public Builder attachmentId(String attachmentId) { + this.attachmentId = attachmentId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the CreateScanOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the CreateScanOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected CreateScanOptions() { } + + protected CreateScanOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attachmentId, + "attachmentId cannot be null"); + attachmentId = builder.attachmentId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a CreateScanOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the attachmentId. + * + * The attachment ID of a profile. + * + * @return the attachmentId + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototype.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototype.java new file mode 100644 index 00000000..3e4d1759 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototype.java @@ -0,0 +1,249 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control details of a profile. + */ +public class DefaultParametersPrototype extends GenericModel { + + /** + * The parameter type. + */ + public interface ParameterType { + /** string. */ + String STRING = "string"; + /** numeric. */ + String NUMERIC = "numeric"; + /** general. */ + String GENERAL = "general"; + /** boolean. */ + String X_BOOLEAN = "boolean"; + /** string_list. */ + String STRING_LIST = "string_list"; + /** ip_list. */ + String IP_LIST = "ip_list"; + /** timestamp. */ + String TIMESTAMP = "timestamp"; + } + + @SerializedName("assessment_type") + protected String assessmentType; + @SerializedName("assessment_id") + protected String assessmentId; + @SerializedName("parameter_name") + protected String parameterName; + @SerializedName("parameter_default_value") + protected String parameterDefaultValue; + @SerializedName("parameter_display_name") + protected String parameterDisplayName; + @SerializedName("parameter_type") + protected String parameterType; + + /** + * Builder. + */ + public static class Builder { + private String assessmentType; + private String assessmentId; + private String parameterName; + private String parameterDefaultValue; + private String parameterDisplayName; + private String parameterType; + + /** + * Instantiates a new Builder from an existing DefaultParametersPrototype instance. + * + * @param defaultParametersPrototype the instance to initialize the Builder with + */ + private Builder(DefaultParametersPrototype defaultParametersPrototype) { + this.assessmentType = defaultParametersPrototype.assessmentType; + this.assessmentId = defaultParametersPrototype.assessmentId; + this.parameterName = defaultParametersPrototype.parameterName; + this.parameterDefaultValue = defaultParametersPrototype.parameterDefaultValue; + this.parameterDisplayName = defaultParametersPrototype.parameterDisplayName; + this.parameterType = defaultParametersPrototype.parameterType; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a DefaultParametersPrototype. + * + * @return the new DefaultParametersPrototype instance + */ + public DefaultParametersPrototype build() { + return new DefaultParametersPrototype(this); + } + + /** + * Set the assessmentType. + * + * @param assessmentType the assessmentType + * @return the DefaultParametersPrototype builder + */ + public Builder assessmentType(String assessmentType) { + this.assessmentType = assessmentType; + return this; + } + + /** + * Set the assessmentId. + * + * @param assessmentId the assessmentId + * @return the DefaultParametersPrototype builder + */ + public Builder assessmentId(String assessmentId) { + this.assessmentId = assessmentId; + return this; + } + + /** + * Set the parameterName. + * + * @param parameterName the parameterName + * @return the DefaultParametersPrototype builder + */ + public Builder parameterName(String parameterName) { + this.parameterName = parameterName; + return this; + } + + /** + * Set the parameterDefaultValue. + * + * @param parameterDefaultValue the parameterDefaultValue + * @return the DefaultParametersPrototype builder + */ + public Builder parameterDefaultValue(String parameterDefaultValue) { + this.parameterDefaultValue = parameterDefaultValue; + return this; + } + + /** + * Set the parameterDisplayName. + * + * @param parameterDisplayName the parameterDisplayName + * @return the DefaultParametersPrototype builder + */ + public Builder parameterDisplayName(String parameterDisplayName) { + this.parameterDisplayName = parameterDisplayName; + return this; + } + + /** + * Set the parameterType. + * + * @param parameterType the parameterType + * @return the DefaultParametersPrototype builder + */ + public Builder parameterType(String parameterType) { + this.parameterType = parameterType; + return this; + } + } + + protected DefaultParametersPrototype() { } + + protected DefaultParametersPrototype(Builder builder) { + assessmentType = builder.assessmentType; + assessmentId = builder.assessmentId; + parameterName = builder.parameterName; + parameterDefaultValue = builder.parameterDefaultValue; + parameterDisplayName = builder.parameterDisplayName; + parameterType = builder.parameterType; + } + + /** + * New builder. + * + * @return a DefaultParametersPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assessmentType. + * + * The type of the implementation. + * + * @return the assessmentType + */ + public String assessmentType() { + return assessmentType; + } + + /** + * Gets the assessmentId. + * + * The implementation ID of the parameter. + * + * @return the assessmentId + */ + public String assessmentId() { + return assessmentId; + } + + /** + * Gets the parameterName. + * + * The parameter name. + * + * @return the parameterName + */ + public String parameterName() { + return parameterName; + } + + /** + * Gets the parameterDefaultValue. + * + * The default value of the parameter. + * + * @return the parameterDefaultValue + */ + public String parameterDefaultValue() { + return parameterDefaultValue; + } + + /** + * Gets the parameterDisplayName. + * + * The parameter display name. + * + * @return the parameterDisplayName + */ + public String parameterDisplayName() { + return parameterDisplayName; + } + + /** + * Gets the parameterType. + * + * The parameter type. + * + * @return the parameterType + */ + public String parameterType() { + return parameterType; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptions.java new file mode 100644 index 00000000..349d80ca --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The deleteCustomControlLibrary options. + */ +public class DeleteCustomControlLibraryOptions extends GenericModel { + + protected String controlLibrariesId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String controlLibrariesId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing DeleteCustomControlLibraryOptions instance. + * + * @param deleteCustomControlLibraryOptions the instance to initialize the Builder with + */ + private Builder(DeleteCustomControlLibraryOptions deleteCustomControlLibraryOptions) { + this.controlLibrariesId = deleteCustomControlLibraryOptions.controlLibrariesId; + this.xCorrelationId = deleteCustomControlLibraryOptions.xCorrelationId; + this.xRequestId = deleteCustomControlLibraryOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param controlLibrariesId the controlLibrariesId + */ + public Builder(String controlLibrariesId) { + this.controlLibrariesId = controlLibrariesId; + } + + /** + * Builds a DeleteCustomControlLibraryOptions. + * + * @return the new DeleteCustomControlLibraryOptions instance + */ + public DeleteCustomControlLibraryOptions build() { + return new DeleteCustomControlLibraryOptions(this); + } + + /** + * Set the controlLibrariesId. + * + * @param controlLibrariesId the controlLibrariesId + * @return the DeleteCustomControlLibraryOptions builder + */ + public Builder controlLibrariesId(String controlLibrariesId) { + this.controlLibrariesId = controlLibrariesId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the DeleteCustomControlLibraryOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the DeleteCustomControlLibraryOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected DeleteCustomControlLibraryOptions() { } + + protected DeleteCustomControlLibraryOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.controlLibrariesId, + "controlLibrariesId cannot be empty"); + controlLibrariesId = builder.controlLibrariesId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a DeleteCustomControlLibraryOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlLibrariesId. + * + * The control library ID. + * + * @return the controlLibrariesId + */ + public String controlLibrariesId() { + return controlLibrariesId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java new file mode 100644 index 00000000..308a90b2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The deleteCustomProfile options. + */ +public class DeleteCustomProfileOptions extends GenericModel { + + protected String profilesId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String profilesId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing DeleteCustomProfileOptions instance. + * + * @param deleteCustomProfileOptions the instance to initialize the Builder with + */ + private Builder(DeleteCustomProfileOptions deleteCustomProfileOptions) { + this.profilesId = deleteCustomProfileOptions.profilesId; + this.xCorrelationId = deleteCustomProfileOptions.xCorrelationId; + this.xRequestId = deleteCustomProfileOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param profilesId the profilesId + */ + public Builder(String profilesId) { + this.profilesId = profilesId; + } + + /** + * Builds a DeleteCustomProfileOptions. + * + * @return the new DeleteCustomProfileOptions instance + */ + public DeleteCustomProfileOptions build() { + return new DeleteCustomProfileOptions(this); + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the DeleteCustomProfileOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the DeleteCustomProfileOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the DeleteCustomProfileOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected DeleteCustomProfileOptions() { } + + protected DeleteCustomProfileOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + profilesId = builder.profilesId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a DeleteCustomProfileOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java new file mode 100644 index 00000000..8ec59574 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java @@ -0,0 +1,189 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The deleteProfileAttachment options. + */ +public class DeleteProfileAttachmentOptions extends GenericModel { + + protected String attachmentId; + protected String profilesId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String attachmentId; + private String profilesId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing DeleteProfileAttachmentOptions instance. + * + * @param deleteProfileAttachmentOptions the instance to initialize the Builder with + */ + private Builder(DeleteProfileAttachmentOptions deleteProfileAttachmentOptions) { + this.attachmentId = deleteProfileAttachmentOptions.attachmentId; + this.profilesId = deleteProfileAttachmentOptions.profilesId; + this.xCorrelationId = deleteProfileAttachmentOptions.xCorrelationId; + this.xRequestId = deleteProfileAttachmentOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param attachmentId the attachmentId + * @param profilesId the profilesId + */ + public Builder(String attachmentId, String profilesId) { + this.attachmentId = attachmentId; + this.profilesId = profilesId; + } + + /** + * Builds a DeleteProfileAttachmentOptions. + * + * @return the new DeleteProfileAttachmentOptions instance + */ + public DeleteProfileAttachmentOptions build() { + return new DeleteProfileAttachmentOptions(this); + } + + /** + * Set the attachmentId. + * + * @param attachmentId the attachmentId + * @return the DeleteProfileAttachmentOptions builder + */ + public Builder attachmentId(String attachmentId) { + this.attachmentId = attachmentId; + return this; + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the DeleteProfileAttachmentOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the DeleteProfileAttachmentOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the DeleteProfileAttachmentOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected DeleteProfileAttachmentOptions() { } + + protected DeleteProfileAttachmentOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, + "attachmentId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + attachmentId = builder.attachmentId; + profilesId = builder.profilesId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a DeleteProfileAttachmentOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the attachmentId. + * + * The attachment ID. + * + * @return the attachmentId + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptions.java new file mode 100644 index 00000000..f94e8ce1 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptions.java @@ -0,0 +1,189 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The deleteProviderTypeInstance options. + */ +public class DeleteProviderTypeInstanceOptions extends GenericModel { + + protected String providerTypeId; + protected String providerTypeInstanceId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String providerTypeId; + private String providerTypeInstanceId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing DeleteProviderTypeInstanceOptions instance. + * + * @param deleteProviderTypeInstanceOptions the instance to initialize the Builder with + */ + private Builder(DeleteProviderTypeInstanceOptions deleteProviderTypeInstanceOptions) { + this.providerTypeId = deleteProviderTypeInstanceOptions.providerTypeId; + this.providerTypeInstanceId = deleteProviderTypeInstanceOptions.providerTypeInstanceId; + this.xCorrelationId = deleteProviderTypeInstanceOptions.xCorrelationId; + this.xRequestId = deleteProviderTypeInstanceOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param providerTypeId the providerTypeId + * @param providerTypeInstanceId the providerTypeInstanceId + */ + public Builder(String providerTypeId, String providerTypeInstanceId) { + this.providerTypeId = providerTypeId; + this.providerTypeInstanceId = providerTypeInstanceId; + } + + /** + * Builds a DeleteProviderTypeInstanceOptions. + * + * @return the new DeleteProviderTypeInstanceOptions instance + */ + public DeleteProviderTypeInstanceOptions build() { + return new DeleteProviderTypeInstanceOptions(this); + } + + /** + * Set the providerTypeId. + * + * @param providerTypeId the providerTypeId + * @return the DeleteProviderTypeInstanceOptions builder + */ + public Builder providerTypeId(String providerTypeId) { + this.providerTypeId = providerTypeId; + return this; + } + + /** + * Set the providerTypeInstanceId. + * + * @param providerTypeInstanceId the providerTypeInstanceId + * @return the DeleteProviderTypeInstanceOptions builder + */ + public Builder providerTypeInstanceId(String providerTypeInstanceId) { + this.providerTypeInstanceId = providerTypeInstanceId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the DeleteProviderTypeInstanceOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the DeleteProviderTypeInstanceOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected DeleteProviderTypeInstanceOptions() { } + + protected DeleteProviderTypeInstanceOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeId, + "providerTypeId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeInstanceId, + "providerTypeInstanceId cannot be empty"); + providerTypeId = builder.providerTypeId; + providerTypeInstanceId = builder.providerTypeInstanceId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a DeleteProviderTypeInstanceOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerTypeId. + * + * The provider type ID. + * + * @return the providerTypeId + */ + public String providerTypeId() { + return providerTypeId; + } + + /** + * Gets the providerTypeInstanceId. + * + * The provider type instance ID. + * + * @return the providerTypeInstanceId + */ + public String providerTypeInstanceId() { + return providerTypeInstanceId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptions.java new file mode 100644 index 00000000..ad8df5e5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The deleteRule options. + */ +public class DeleteRuleOptions extends GenericModel { + + protected String ruleId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String ruleId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing DeleteRuleOptions instance. + * + * @param deleteRuleOptions the instance to initialize the Builder with + */ + private Builder(DeleteRuleOptions deleteRuleOptions) { + this.ruleId = deleteRuleOptions.ruleId; + this.xCorrelationId = deleteRuleOptions.xCorrelationId; + this.xRequestId = deleteRuleOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param ruleId the ruleId + */ + public Builder(String ruleId) { + this.ruleId = ruleId; + } + + /** + * Builds a DeleteRuleOptions. + * + * @return the new DeleteRuleOptions instance + */ + public DeleteRuleOptions build() { + return new DeleteRuleOptions(this); + } + + /** + * Set the ruleId. + * + * @param ruleId the ruleId + * @return the DeleteRuleOptions builder + */ + public Builder ruleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the DeleteRuleOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the DeleteRuleOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected DeleteRuleOptions() { } + + protected DeleteRuleOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, + "ruleId cannot be empty"); + ruleId = builder.ruleId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a DeleteRuleOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the ruleId. + * + * The ID of the corresponding rule. + * + * @return the ruleId + */ + public String ruleId() { + return ruleId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetails.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetails.java new file mode 100644 index 00000000..7368ee1f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetails.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The evaluation details. + */ +public class EvalDetails extends GenericModel { + + @SerializedName("properties") + protected List xProperties; + + protected EvalDetails() { } + + /** + * Gets the xProperties. + * + * The evaluation properties. + * + * @return the xProperties + */ + public List getXProperties() { + return xProperties; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStats.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStats.java new file mode 100644 index 00000000..21aa0da6 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStats.java @@ -0,0 +1,117 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The evaluation stats. + */ +public class EvalStats extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("pass_count") + protected Long passCount; + @SerializedName("failure_count") + protected Long failureCount; + @SerializedName("error_count") + protected Long errorCount; + @SerializedName("completed_count") + protected Long completedCount; + + protected EvalStats() { } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of evaluations. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the passCount. + * + * The number of passed evaluations. + * + * @return the passCount + */ + public Long getPassCount() { + return passCount; + } + + /** + * Gets the failureCount. + * + * The number of failed evaluations. + * + * @return the failureCount + */ + public Long getFailureCount() { + return failureCount; + } + + /** + * Gets the errorCount. + * + * The number of evaluations that started, but did not finish, and ended with errors. + * + * @return the errorCount + */ + public Long getErrorCount() { + return errorCount; + } + + /** + * Gets the completedCount. + * + * The total number of completed evaluations. + * + * @return the completedCount + */ + public Long getCompletedCount() { + return completedCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Evaluation.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Evaluation.java new file mode 100644 index 00000000..2e7d56b2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Evaluation.java @@ -0,0 +1,165 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The evaluation of a control specification assessment. + */ +public class Evaluation extends GenericModel { + + /** + * The allowed values of an evaluation status. + */ + public interface Status { + /** pass. */ + String PASS = "pass"; + /** failure. */ + String FAILURE = "failure"; + /** error. */ + String ERROR = "error"; + /** skipped. */ + String SKIPPED = "skipped"; + } + + @SerializedName("home_account_id") + protected String homeAccountId; + @SerializedName("report_id") + protected String reportId; + @SerializedName("control_id") + protected String controlId; + @SerializedName("component_id") + protected String componentId; + protected Assessment assessment; + @SerializedName("evaluate_time") + protected String evaluateTime; + protected TargetInfo target; + protected String status; + protected String reason; + protected EvalDetails details; + + protected Evaluation() { } + + /** + * Gets the homeAccountId. + * + * The ID of the home account. + * + * @return the homeAccountId + */ + public String getHomeAccountId() { + return homeAccountId; + } + + /** + * Gets the reportId. + * + * The ID of the report that is associated to the evaluation. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the controlId. + * + * The control ID. + * + * @return the controlId + */ + public String getControlId() { + return controlId; + } + + /** + * Gets the componentId. + * + * The component ID. + * + * @return the componentId + */ + public String getComponentId() { + return componentId; + } + + /** + * Gets the assessment. + * + * The control specification assessment. + * + * @return the assessment + */ + public Assessment getAssessment() { + return assessment; + } + + /** + * Gets the evaluateTime. + * + * The time when the evaluation was made. + * + * @return the evaluateTime + */ + public String getEvaluateTime() { + return evaluateTime; + } + + /** + * Gets the target. + * + * The evaluation target. + * + * @return the target + */ + public TargetInfo getTarget() { + return target; + } + + /** + * Gets the status. + * + * The allowed values of an evaluation status. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the reason. + * + * The reason for the evaluation failure. + * + * @return the reason + */ + public String getReason() { + return reason; + } + + /** + * Gets the details. + * + * The evaluation details. + * + * @return the details + */ + public EvalDetails getDetails() { + return details; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPage.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPage.java new file mode 100644 index 00000000..9ea665c1 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPage.java @@ -0,0 +1,127 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The page of assessment evaluations. + */ +public class EvaluationPage extends GenericModel { + + @SerializedName("total_count") + protected Long totalCount; + protected Long limit; + protected String start; + protected PageHRef first; + protected PageHRef next; + @SerializedName("home_account_id") + protected String homeAccountId; + @SerializedName("report_id") + protected String reportId; + protected List evaluations; + + protected EvaluationPage() { } + + /** + * Gets the totalCount. + * + * The total number of resources that are in the collection. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the limit. + * + * The requested page limi.t. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the start. + * + * The token of the next page, when it's present. + * + * @return the start + */ + public String getStart() { + return start; + } + + /** + * Gets the first. + * + * The page reference. + * + * @return the first + */ + public PageHRef getFirst() { + return first; + } + + /** + * Gets the next. + * + * The page reference. + * + * @return the next + */ + public PageHRef getNext() { + return next; + } + + /** + * Gets the homeAccountId. + * + * The ID of the home account. + * + * @return the homeAccountId + */ + public String getHomeAccountId() { + return homeAccountId; + } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the evaluations. + * + * The list of evaluations that are on the page. + * + * @return the evaluations + */ + public List getEvaluations() { + return evaluations; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotifications.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotifications.java new file mode 100644 index 00000000..da4de0fe --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotifications.java @@ -0,0 +1,204 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The Event Notifications settings. + */ +public class EventNotifications extends GenericModel { + + @SerializedName("instance_crn") + protected String instanceCrn; + @SerializedName("updated_on") + protected Date updatedOn; + @SerializedName("source_id") + protected String sourceId; + @SerializedName("source_description") + protected String sourceDescription; + @SerializedName("source_name") + protected String sourceName; + + /** + * Builder. + */ + public static class Builder { + private String instanceCrn; + private Date updatedOn; + private String sourceId; + private String sourceDescription; + private String sourceName; + + /** + * Instantiates a new Builder from an existing EventNotifications instance. + * + * @param eventNotifications the instance to initialize the Builder with + */ + private Builder(EventNotifications eventNotifications) { + this.instanceCrn = eventNotifications.instanceCrn; + this.updatedOn = eventNotifications.updatedOn; + this.sourceId = eventNotifications.sourceId; + this.sourceDescription = eventNotifications.sourceDescription; + this.sourceName = eventNotifications.sourceName; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a EventNotifications. + * + * @return the new EventNotifications instance + */ + public EventNotifications build() { + return new EventNotifications(this); + } + + /** + * Set the instanceCrn. + * + * @param instanceCrn the instanceCrn + * @return the EventNotifications builder + */ + public Builder instanceCrn(String instanceCrn) { + this.instanceCrn = instanceCrn; + return this; + } + + /** + * Set the updatedOn. + * + * @param updatedOn the updatedOn + * @return the EventNotifications builder + */ + public Builder updatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + /** + * Set the sourceId. + * + * @param sourceId the sourceId + * @return the EventNotifications builder + */ + public Builder sourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Set the sourceDescription. + * + * @param sourceDescription the sourceDescription + * @return the EventNotifications builder + */ + public Builder sourceDescription(String sourceDescription) { + this.sourceDescription = sourceDescription; + return this; + } + + /** + * Set the sourceName. + * + * @param sourceName the sourceName + * @return the EventNotifications builder + */ + public Builder sourceName(String sourceName) { + this.sourceName = sourceName; + return this; + } + } + + protected EventNotifications() { } + + protected EventNotifications(Builder builder) { + instanceCrn = builder.instanceCrn; + updatedOn = builder.updatedOn; + sourceId = builder.sourceId; + sourceDescription = builder.sourceDescription; + sourceName = builder.sourceName; + } + + /** + * New builder. + * + * @return a EventNotifications builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the instanceCrn. + * + * The Event Notifications instance CRN. + * + * @return the instanceCrn + */ + public String instanceCrn() { + return instanceCrn; + } + + /** + * Gets the updatedOn. + * + * The date when the Event Notifications connection was updated. + * + * @return the updatedOn + */ + public Date updatedOn() { + return updatedOn; + } + + /** + * Gets the sourceId. + * + * The connected Security and Compliance Center instance CRN. + * + * @return the sourceId + */ + public String sourceId() { + return sourceId; + } + + /** + * Gets the sourceDescription. + * + * The description of the source of the Event Notifications. + * + * @return the sourceDescription + */ + public String sourceDescription() { + return sourceDescription; + } + + /** + * Gets the sourceName. + * + * The name of the source of the Event Notifications. + * + * @return the sourceName + */ + public String sourceName() { + return sourceName; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControls.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControls.java new file mode 100644 index 00000000..3e5883ab --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControls.java @@ -0,0 +1,141 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The failed controls. + */ +public class FailedControls extends GenericModel { + + @SerializedName("threshold_limit") + protected Long thresholdLimit; + @SerializedName("failed_control_ids") + protected List failedControlIds; + + /** + * Builder. + */ + public static class Builder { + private Long thresholdLimit; + private List failedControlIds; + + /** + * Instantiates a new Builder from an existing FailedControls instance. + * + * @param failedControls the instance to initialize the Builder with + */ + private Builder(FailedControls failedControls) { + this.thresholdLimit = failedControls.thresholdLimit; + this.failedControlIds = failedControls.failedControlIds; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a FailedControls. + * + * @return the new FailedControls instance + */ + public FailedControls build() { + return new FailedControls(this); + } + + /** + * Adds an failedControlIds to failedControlIds. + * + * @param failedControlIds the new failedControlIds + * @return the FailedControls builder + */ + public Builder addFailedControlIds(String failedControlIds) { + com.ibm.cloud.sdk.core.util.Validator.notNull(failedControlIds, + "failedControlIds cannot be null"); + if (this.failedControlIds == null) { + this.failedControlIds = new ArrayList(); + } + this.failedControlIds.add(failedControlIds); + return this; + } + + /** + * Set the thresholdLimit. + * + * @param thresholdLimit the thresholdLimit + * @return the FailedControls builder + */ + public Builder thresholdLimit(long thresholdLimit) { + this.thresholdLimit = thresholdLimit; + return this; + } + + /** + * Set the failedControlIds. + * Existing failedControlIds will be replaced. + * + * @param failedControlIds the failedControlIds + * @return the FailedControls builder + */ + public Builder failedControlIds(List failedControlIds) { + this.failedControlIds = failedControlIds; + return this; + } + } + + protected FailedControls() { } + + protected FailedControls(Builder builder) { + thresholdLimit = builder.thresholdLimit; + failedControlIds = builder.failedControlIds; + } + + /** + * New builder. + * + * @return a FailedControls builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the thresholdLimit. + * + * The threshold limit. + * + * @return the thresholdLimit + */ + public Long thresholdLimit() { + return thresholdLimit; + } + + /** + * Gets the failedControlIds. + * + * The failed control IDs. + * + * @return the failedControlIds + */ + public List failedControlIds() { + return failedControlIds; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptions.java new file mode 100644 index 00000000..e115ea66 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getControlLibrary options. + */ +public class GetControlLibraryOptions extends GenericModel { + + protected String controlLibrariesId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String controlLibrariesId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetControlLibraryOptions instance. + * + * @param getControlLibraryOptions the instance to initialize the Builder with + */ + private Builder(GetControlLibraryOptions getControlLibraryOptions) { + this.controlLibrariesId = getControlLibraryOptions.controlLibrariesId; + this.xCorrelationId = getControlLibraryOptions.xCorrelationId; + this.xRequestId = getControlLibraryOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param controlLibrariesId the controlLibrariesId + */ + public Builder(String controlLibrariesId) { + this.controlLibrariesId = controlLibrariesId; + } + + /** + * Builds a GetControlLibraryOptions. + * + * @return the new GetControlLibraryOptions instance + */ + public GetControlLibraryOptions build() { + return new GetControlLibraryOptions(this); + } + + /** + * Set the controlLibrariesId. + * + * @param controlLibrariesId the controlLibrariesId + * @return the GetControlLibraryOptions builder + */ + public Builder controlLibrariesId(String controlLibrariesId) { + this.controlLibrariesId = controlLibrariesId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetControlLibraryOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetControlLibraryOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetControlLibraryOptions() { } + + protected GetControlLibraryOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.controlLibrariesId, + "controlLibrariesId cannot be empty"); + controlLibrariesId = builder.controlLibrariesId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetControlLibraryOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlLibrariesId. + * + * The control library ID. + * + * @return the controlLibrariesId + */ + public String controlLibrariesId() { + return controlLibrariesId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptions.java new file mode 100644 index 00000000..9b99103e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptions.java @@ -0,0 +1,149 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getLatestReports options. + */ +public class GetLatestReportsOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + protected String sort; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + private String sort; + + /** + * Instantiates a new Builder from an existing GetLatestReportsOptions instance. + * + * @param getLatestReportsOptions the instance to initialize the Builder with + */ + private Builder(GetLatestReportsOptions getLatestReportsOptions) { + this.xCorrelationId = getLatestReportsOptions.xCorrelationId; + this.xRequestId = getLatestReportsOptions.xRequestId; + this.sort = getLatestReportsOptions.sort; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a GetLatestReportsOptions. + * + * @return the new GetLatestReportsOptions instance + */ + public GetLatestReportsOptions build() { + return new GetLatestReportsOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetLatestReportsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetLatestReportsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the sort. + * + * @param sort the sort + * @return the GetLatestReportsOptions builder + */ + public Builder sort(String sort) { + this.sort = sort; + return this; + } + } + + protected GetLatestReportsOptions() { } + + protected GetLatestReportsOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + sort = builder.sort; + } + + /** + * New builder. + * + * @return a GetLatestReportsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the sort. + * + * This field sorts results by using a valid sort field. To learn more, see + * [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting). + * + * @return the sort + */ + public String sort() { + return sort; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java new file mode 100644 index 00000000..ff38879a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java @@ -0,0 +1,189 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getProfileAttachment options. + */ +public class GetProfileAttachmentOptions extends GenericModel { + + protected String attachmentId; + protected String profilesId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String attachmentId; + private String profilesId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetProfileAttachmentOptions instance. + * + * @param getProfileAttachmentOptions the instance to initialize the Builder with + */ + private Builder(GetProfileAttachmentOptions getProfileAttachmentOptions) { + this.attachmentId = getProfileAttachmentOptions.attachmentId; + this.profilesId = getProfileAttachmentOptions.profilesId; + this.xCorrelationId = getProfileAttachmentOptions.xCorrelationId; + this.xRequestId = getProfileAttachmentOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param attachmentId the attachmentId + * @param profilesId the profilesId + */ + public Builder(String attachmentId, String profilesId) { + this.attachmentId = attachmentId; + this.profilesId = profilesId; + } + + /** + * Builds a GetProfileAttachmentOptions. + * + * @return the new GetProfileAttachmentOptions instance + */ + public GetProfileAttachmentOptions build() { + return new GetProfileAttachmentOptions(this); + } + + /** + * Set the attachmentId. + * + * @param attachmentId the attachmentId + * @return the GetProfileAttachmentOptions builder + */ + public Builder attachmentId(String attachmentId) { + this.attachmentId = attachmentId; + return this; + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the GetProfileAttachmentOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetProfileAttachmentOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetProfileAttachmentOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetProfileAttachmentOptions() { } + + protected GetProfileAttachmentOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, + "attachmentId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + attachmentId = builder.attachmentId; + profilesId = builder.profilesId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetProfileAttachmentOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the attachmentId. + * + * The attachment ID. + * + * @return the attachmentId + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java new file mode 100644 index 00000000..8268a433 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getProfile options. + */ +public class GetProfileOptions extends GenericModel { + + protected String profilesId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String profilesId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetProfileOptions instance. + * + * @param getProfileOptions the instance to initialize the Builder with + */ + private Builder(GetProfileOptions getProfileOptions) { + this.profilesId = getProfileOptions.profilesId; + this.xCorrelationId = getProfileOptions.xCorrelationId; + this.xRequestId = getProfileOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param profilesId the profilesId + */ + public Builder(String profilesId) { + this.profilesId = profilesId; + } + + /** + * Builds a GetProfileOptions. + * + * @return the new GetProfileOptions instance + */ + public GetProfileOptions build() { + return new GetProfileOptions(this); + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the GetProfileOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetProfileOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetProfileOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetProfileOptions() { } + + protected GetProfileOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + profilesId = builder.profilesId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetProfileOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptions.java new file mode 100644 index 00000000..a9b279a4 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getProviderTypeById options. + */ +public class GetProviderTypeByIdOptions extends GenericModel { + + protected String providerTypeId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String providerTypeId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetProviderTypeByIdOptions instance. + * + * @param getProviderTypeByIdOptions the instance to initialize the Builder with + */ + private Builder(GetProviderTypeByIdOptions getProviderTypeByIdOptions) { + this.providerTypeId = getProviderTypeByIdOptions.providerTypeId; + this.xCorrelationId = getProviderTypeByIdOptions.xCorrelationId; + this.xRequestId = getProviderTypeByIdOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param providerTypeId the providerTypeId + */ + public Builder(String providerTypeId) { + this.providerTypeId = providerTypeId; + } + + /** + * Builds a GetProviderTypeByIdOptions. + * + * @return the new GetProviderTypeByIdOptions instance + */ + public GetProviderTypeByIdOptions build() { + return new GetProviderTypeByIdOptions(this); + } + + /** + * Set the providerTypeId. + * + * @param providerTypeId the providerTypeId + * @return the GetProviderTypeByIdOptions builder + */ + public Builder providerTypeId(String providerTypeId) { + this.providerTypeId = providerTypeId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetProviderTypeByIdOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetProviderTypeByIdOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetProviderTypeByIdOptions() { } + + protected GetProviderTypeByIdOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeId, + "providerTypeId cannot be empty"); + providerTypeId = builder.providerTypeId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetProviderTypeByIdOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerTypeId. + * + * The provider type ID. + * + * @return the providerTypeId + */ + public String providerTypeId() { + return providerTypeId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptions.java new file mode 100644 index 00000000..1b277f99 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptions.java @@ -0,0 +1,189 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getProviderTypeInstance options. + */ +public class GetProviderTypeInstanceOptions extends GenericModel { + + protected String providerTypeId; + protected String providerTypeInstanceId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String providerTypeId; + private String providerTypeInstanceId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetProviderTypeInstanceOptions instance. + * + * @param getProviderTypeInstanceOptions the instance to initialize the Builder with + */ + private Builder(GetProviderTypeInstanceOptions getProviderTypeInstanceOptions) { + this.providerTypeId = getProviderTypeInstanceOptions.providerTypeId; + this.providerTypeInstanceId = getProviderTypeInstanceOptions.providerTypeInstanceId; + this.xCorrelationId = getProviderTypeInstanceOptions.xCorrelationId; + this.xRequestId = getProviderTypeInstanceOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param providerTypeId the providerTypeId + * @param providerTypeInstanceId the providerTypeInstanceId + */ + public Builder(String providerTypeId, String providerTypeInstanceId) { + this.providerTypeId = providerTypeId; + this.providerTypeInstanceId = providerTypeInstanceId; + } + + /** + * Builds a GetProviderTypeInstanceOptions. + * + * @return the new GetProviderTypeInstanceOptions instance + */ + public GetProviderTypeInstanceOptions build() { + return new GetProviderTypeInstanceOptions(this); + } + + /** + * Set the providerTypeId. + * + * @param providerTypeId the providerTypeId + * @return the GetProviderTypeInstanceOptions builder + */ + public Builder providerTypeId(String providerTypeId) { + this.providerTypeId = providerTypeId; + return this; + } + + /** + * Set the providerTypeInstanceId. + * + * @param providerTypeInstanceId the providerTypeInstanceId + * @return the GetProviderTypeInstanceOptions builder + */ + public Builder providerTypeInstanceId(String providerTypeInstanceId) { + this.providerTypeInstanceId = providerTypeInstanceId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetProviderTypeInstanceOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetProviderTypeInstanceOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetProviderTypeInstanceOptions() { } + + protected GetProviderTypeInstanceOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeId, + "providerTypeId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeInstanceId, + "providerTypeInstanceId cannot be empty"); + providerTypeId = builder.providerTypeId; + providerTypeInstanceId = builder.providerTypeInstanceId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetProviderTypeInstanceOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerTypeId. + * + * The provider type ID. + * + * @return the providerTypeId + */ + public String providerTypeId() { + return providerTypeId; + } + + /** + * Gets the providerTypeInstanceId. + * + * The provider type instance ID. + * + * @return the providerTypeInstanceId + */ + public String providerTypeInstanceId() { + return providerTypeInstanceId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptions.java new file mode 100644 index 00000000..d1a60f3d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptions.java @@ -0,0 +1,122 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getProviderTypesInstances options. + */ +public class GetProviderTypesInstancesOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetProviderTypesInstancesOptions instance. + * + * @param getProviderTypesInstancesOptions the instance to initialize the Builder with + */ + private Builder(GetProviderTypesInstancesOptions getProviderTypesInstancesOptions) { + this.xCorrelationId = getProviderTypesInstancesOptions.xCorrelationId; + this.xRequestId = getProviderTypesInstancesOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a GetProviderTypesInstancesOptions. + * + * @return the new GetProviderTypesInstancesOptions instance + */ + public GetProviderTypesInstancesOptions build() { + return new GetProviderTypesInstancesOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetProviderTypesInstancesOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetProviderTypesInstancesOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetProviderTypesInstancesOptions() { } + + protected GetProviderTypesInstancesOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetProviderTypesInstancesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptions.java new file mode 100644 index 00000000..575b984b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptions.java @@ -0,0 +1,343 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getReportControls options. + */ +public class GetReportControlsOptions extends GenericModel { + + /** + * The compliance status value. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + /** + * This field sorts controls by using a valid sort field. To learn more, see + * [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting). + */ + public interface Sort { + /** control_name. */ + String CONTROL_NAME = "control_name"; + /** control_category. */ + String CONTROL_CATEGORY = "control_category"; + /** status. */ + String STATUS = "status"; + } + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + protected String controlId; + protected String controlName; + protected String controlDescription; + protected String controlCategory; + protected String status; + protected String sort; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + private String controlId; + private String controlName; + private String controlDescription; + private String controlCategory; + private String status; + private String sort; + + /** + * Instantiates a new Builder from an existing GetReportControlsOptions instance. + * + * @param getReportControlsOptions the instance to initialize the Builder with + */ + private Builder(GetReportControlsOptions getReportControlsOptions) { + this.reportId = getReportControlsOptions.reportId; + this.xCorrelationId = getReportControlsOptions.xCorrelationId; + this.xRequestId = getReportControlsOptions.xRequestId; + this.controlId = getReportControlsOptions.controlId; + this.controlName = getReportControlsOptions.controlName; + this.controlDescription = getReportControlsOptions.controlDescription; + this.controlCategory = getReportControlsOptions.controlCategory; + this.status = getReportControlsOptions.status; + this.sort = getReportControlsOptions.sort; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a GetReportControlsOptions. + * + * @return the new GetReportControlsOptions instance + */ + public GetReportControlsOptions build() { + return new GetReportControlsOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the GetReportControlsOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetReportControlsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetReportControlsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the controlId. + * + * @param controlId the controlId + * @return the GetReportControlsOptions builder + */ + public Builder controlId(String controlId) { + this.controlId = controlId; + return this; + } + + /** + * Set the controlName. + * + * @param controlName the controlName + * @return the GetReportControlsOptions builder + */ + public Builder controlName(String controlName) { + this.controlName = controlName; + return this; + } + + /** + * Set the controlDescription. + * + * @param controlDescription the controlDescription + * @return the GetReportControlsOptions builder + */ + public Builder controlDescription(String controlDescription) { + this.controlDescription = controlDescription; + return this; + } + + /** + * Set the controlCategory. + * + * @param controlCategory the controlCategory + * @return the GetReportControlsOptions builder + */ + public Builder controlCategory(String controlCategory) { + this.controlCategory = controlCategory; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the GetReportControlsOptions builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * Set the sort. + * + * @param sort the sort + * @return the GetReportControlsOptions builder + */ + public Builder sort(String sort) { + this.sort = sort; + return this; + } + } + + protected GetReportControlsOptions() { } + + protected GetReportControlsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + controlId = builder.controlId; + controlName = builder.controlName; + controlDescription = builder.controlDescription; + controlCategory = builder.controlCategory; + status = builder.status; + sort = builder.sort; + } + + /** + * New builder. + * + * @return a GetReportControlsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the controlId. + * + * The ID of the control. + * + * @return the controlId + */ + public String controlId() { + return controlId; + } + + /** + * Gets the controlName. + * + * The name of the control. + * + * @return the controlName + */ + public String controlName() { + return controlName; + } + + /** + * Gets the controlDescription. + * + * The description of the control. + * + * @return the controlDescription + */ + public String controlDescription() { + return controlDescription; + } + + /** + * Gets the controlCategory. + * + * A control category value. + * + * @return the controlCategory + */ + public String controlCategory() { + return controlCategory; + } + + /** + * Gets the status. + * + * The compliance status value. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the sort. + * + * This field sorts controls by using a valid sort field. To learn more, see + * [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting). + * + * @return the sort + */ + public String sort() { + return sort; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptions.java new file mode 100644 index 00000000..c9d8c03d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptions.java @@ -0,0 +1,185 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getReportEvaluation options. + */ +public class GetReportEvaluationOptions extends GenericModel { + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + protected Boolean excludeSummary; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + private Boolean excludeSummary; + + /** + * Instantiates a new Builder from an existing GetReportEvaluationOptions instance. + * + * @param getReportEvaluationOptions the instance to initialize the Builder with + */ + private Builder(GetReportEvaluationOptions getReportEvaluationOptions) { + this.reportId = getReportEvaluationOptions.reportId; + this.xCorrelationId = getReportEvaluationOptions.xCorrelationId; + this.xRequestId = getReportEvaluationOptions.xRequestId; + this.excludeSummary = getReportEvaluationOptions.excludeSummary; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a GetReportEvaluationOptions. + * + * @return the new GetReportEvaluationOptions instance + */ + public GetReportEvaluationOptions build() { + return new GetReportEvaluationOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the GetReportEvaluationOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetReportEvaluationOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetReportEvaluationOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the excludeSummary. + * + * @param excludeSummary the excludeSummary + * @return the GetReportEvaluationOptions builder + */ + public Builder excludeSummary(Boolean excludeSummary) { + this.excludeSummary = excludeSummary; + return this; + } + } + + protected GetReportEvaluationOptions() { } + + protected GetReportEvaluationOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + excludeSummary = builder.excludeSummary; + } + + /** + * New builder. + * + * @return a GetReportEvaluationOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the excludeSummary. + * + * The indication of whether report summary metadata must be excluded. + * + * @return the excludeSummary + */ + public Boolean excludeSummary() { + return excludeSummary; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptions.java new file mode 100644 index 00000000..0c08b7d1 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getReport options. + */ +public class GetReportOptions extends GenericModel { + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetReportOptions instance. + * + * @param getReportOptions the instance to initialize the Builder with + */ + private Builder(GetReportOptions getReportOptions) { + this.reportId = getReportOptions.reportId; + this.xCorrelationId = getReportOptions.xCorrelationId; + this.xRequestId = getReportOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a GetReportOptions. + * + * @return the new GetReportOptions instance + */ + public GetReportOptions build() { + return new GetReportOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the GetReportOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetReportOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetReportOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetReportOptions() { } + + protected GetReportOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetReportOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptions.java new file mode 100644 index 00000000..090ccafb --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptions.java @@ -0,0 +1,189 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getReportRule options. + */ +public class GetReportRuleOptions extends GenericModel { + + protected String reportId; + protected String ruleId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String ruleId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetReportRuleOptions instance. + * + * @param getReportRuleOptions the instance to initialize the Builder with + */ + private Builder(GetReportRuleOptions getReportRuleOptions) { + this.reportId = getReportRuleOptions.reportId; + this.ruleId = getReportRuleOptions.ruleId; + this.xCorrelationId = getReportRuleOptions.xCorrelationId; + this.xRequestId = getReportRuleOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + * @param ruleId the ruleId + */ + public Builder(String reportId, String ruleId) { + this.reportId = reportId; + this.ruleId = ruleId; + } + + /** + * Builds a GetReportRuleOptions. + * + * @return the new GetReportRuleOptions instance + */ + public GetReportRuleOptions build() { + return new GetReportRuleOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the GetReportRuleOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the ruleId. + * + * @param ruleId the ruleId + * @return the GetReportRuleOptions builder + */ + public Builder ruleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetReportRuleOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetReportRuleOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetReportRuleOptions() { } + + protected GetReportRuleOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, + "ruleId cannot be empty"); + reportId = builder.reportId; + ruleId = builder.ruleId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetReportRuleOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the ruleId. + * + * The ID of a rule in a report. + * + * @return the ruleId + */ + public String ruleId() { + return ruleId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptions.java new file mode 100644 index 00000000..8087c710 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getReportSummary options. + */ +public class GetReportSummaryOptions extends GenericModel { + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetReportSummaryOptions instance. + * + * @param getReportSummaryOptions the instance to initialize the Builder with + */ + private Builder(GetReportSummaryOptions getReportSummaryOptions) { + this.reportId = getReportSummaryOptions.reportId; + this.xCorrelationId = getReportSummaryOptions.xCorrelationId; + this.xRequestId = getReportSummaryOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a GetReportSummaryOptions. + * + * @return the new GetReportSummaryOptions instance + */ + public GetReportSummaryOptions build() { + return new GetReportSummaryOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the GetReportSummaryOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetReportSummaryOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetReportSummaryOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetReportSummaryOptions() { } + + protected GetReportSummaryOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetReportSummaryOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptions.java new file mode 100644 index 00000000..08f34659 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getReportTags options. + */ +public class GetReportTagsOptions extends GenericModel { + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetReportTagsOptions instance. + * + * @param getReportTagsOptions the instance to initialize the Builder with + */ + private Builder(GetReportTagsOptions getReportTagsOptions) { + this.reportId = getReportTagsOptions.reportId; + this.xCorrelationId = getReportTagsOptions.xCorrelationId; + this.xRequestId = getReportTagsOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a GetReportTagsOptions. + * + * @return the new GetReportTagsOptions instance + */ + public GetReportTagsOptions build() { + return new GetReportTagsOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the GetReportTagsOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetReportTagsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetReportTagsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetReportTagsOptions() { } + + protected GetReportTagsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetReportTagsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptions.java new file mode 100644 index 00000000..1588dfd9 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptions.java @@ -0,0 +1,185 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getReportViolationsDrift options. + */ +public class GetReportViolationsDriftOptions extends GenericModel { + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + protected Long scanTimeDuration; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + private Long scanTimeDuration; + + /** + * Instantiates a new Builder from an existing GetReportViolationsDriftOptions instance. + * + * @param getReportViolationsDriftOptions the instance to initialize the Builder with + */ + private Builder(GetReportViolationsDriftOptions getReportViolationsDriftOptions) { + this.reportId = getReportViolationsDriftOptions.reportId; + this.xCorrelationId = getReportViolationsDriftOptions.xCorrelationId; + this.xRequestId = getReportViolationsDriftOptions.xRequestId; + this.scanTimeDuration = getReportViolationsDriftOptions.scanTimeDuration; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a GetReportViolationsDriftOptions. + * + * @return the new GetReportViolationsDriftOptions instance + */ + public GetReportViolationsDriftOptions build() { + return new GetReportViolationsDriftOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the GetReportViolationsDriftOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetReportViolationsDriftOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetReportViolationsDriftOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the scanTimeDuration. + * + * @param scanTimeDuration the scanTimeDuration + * @return the GetReportViolationsDriftOptions builder + */ + public Builder scanTimeDuration(long scanTimeDuration) { + this.scanTimeDuration = scanTimeDuration; + return this; + } + } + + protected GetReportViolationsDriftOptions() { } + + protected GetReportViolationsDriftOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + scanTimeDuration = builder.scanTimeDuration; + } + + /** + * New builder. + * + * @return a GetReportViolationsDriftOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the scanTimeDuration. + * + * The duration of the `scan_time` timestamp in number of days. + * + * @return the scanTimeDuration + */ + public Long scanTimeDuration() { + return scanTimeDuration; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptions.java new file mode 100644 index 00000000..c9ef224c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getRule options. + */ +public class GetRuleOptions extends GenericModel { + + protected String ruleId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String ruleId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetRuleOptions instance. + * + * @param getRuleOptions the instance to initialize the Builder with + */ + private Builder(GetRuleOptions getRuleOptions) { + this.ruleId = getRuleOptions.ruleId; + this.xCorrelationId = getRuleOptions.xCorrelationId; + this.xRequestId = getRuleOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param ruleId the ruleId + */ + public Builder(String ruleId) { + this.ruleId = ruleId; + } + + /** + * Builds a GetRuleOptions. + * + * @return the new GetRuleOptions instance + */ + public GetRuleOptions build() { + return new GetRuleOptions(this); + } + + /** + * Set the ruleId. + * + * @param ruleId the ruleId + * @return the GetRuleOptions builder + */ + public Builder ruleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetRuleOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetRuleOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetRuleOptions() { } + + protected GetRuleOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, + "ruleId cannot be empty"); + ruleId = builder.ruleId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetRuleOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the ruleId. + * + * The ID of the corresponding rule. + * + * @return the ruleId + */ + public String ruleId() { + return ruleId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptions.java new file mode 100644 index 00000000..c946a5f8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptions.java @@ -0,0 +1,122 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getSettings options. + */ +public class GetSettingsOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing GetSettingsOptions instance. + * + * @param getSettingsOptions the instance to initialize the Builder with + */ + private Builder(GetSettingsOptions getSettingsOptions) { + this.xCorrelationId = getSettingsOptions.xCorrelationId; + this.xRequestId = getSettingsOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a GetSettingsOptions. + * + * @return the new GetSettingsOptions instance + */ + public GetSettingsOptions build() { + return new GetSettingsOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the GetSettingsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the GetSettingsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected GetSettingsOptions() { } + + protected GetSettingsOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a GetSettingsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Implementation.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Implementation.java new file mode 100644 index 00000000..c5b347a6 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Implementation.java @@ -0,0 +1,248 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The implementation details of a control library. + */ +public class Implementation extends GenericModel { + + @SerializedName("assessment_id") + protected String assessmentId; + @SerializedName("assessment_method") + protected String assessmentMethod; + @SerializedName("assessment_type") + protected String assessmentType; + @SerializedName("assessment_description") + protected String assessmentDescription; + @SerializedName("parameter_count") + protected Long parameterCount; + protected List parameters; + + /** + * Builder. + */ + public static class Builder { + private String assessmentId; + private String assessmentMethod; + private String assessmentType; + private String assessmentDescription; + private Long parameterCount; + private List parameters; + + /** + * Instantiates a new Builder from an existing Implementation instance. + * + * @param implementation the instance to initialize the Builder with + */ + private Builder(Implementation implementation) { + this.assessmentId = implementation.assessmentId; + this.assessmentMethod = implementation.assessmentMethod; + this.assessmentType = implementation.assessmentType; + this.assessmentDescription = implementation.assessmentDescription; + this.parameterCount = implementation.parameterCount; + this.parameters = implementation.parameters; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a Implementation. + * + * @return the new Implementation instance + */ + public Implementation build() { + return new Implementation(this); + } + + /** + * Adds an parameters to parameters. + * + * @param parameters the new parameters + * @return the Implementation builder + */ + public Builder addParameters(ParameterInfo parameters) { + com.ibm.cloud.sdk.core.util.Validator.notNull(parameters, + "parameters cannot be null"); + if (this.parameters == null) { + this.parameters = new ArrayList(); + } + this.parameters.add(parameters); + return this; + } + + /** + * Set the assessmentId. + * + * @param assessmentId the assessmentId + * @return the Implementation builder + */ + public Builder assessmentId(String assessmentId) { + this.assessmentId = assessmentId; + return this; + } + + /** + * Set the assessmentMethod. + * + * @param assessmentMethod the assessmentMethod + * @return the Implementation builder + */ + public Builder assessmentMethod(String assessmentMethod) { + this.assessmentMethod = assessmentMethod; + return this; + } + + /** + * Set the assessmentType. + * + * @param assessmentType the assessmentType + * @return the Implementation builder + */ + public Builder assessmentType(String assessmentType) { + this.assessmentType = assessmentType; + return this; + } + + /** + * Set the assessmentDescription. + * + * @param assessmentDescription the assessmentDescription + * @return the Implementation builder + */ + public Builder assessmentDescription(String assessmentDescription) { + this.assessmentDescription = assessmentDescription; + return this; + } + + /** + * Set the parameterCount. + * + * @param parameterCount the parameterCount + * @return the Implementation builder + */ + public Builder parameterCount(long parameterCount) { + this.parameterCount = parameterCount; + return this; + } + + /** + * Set the parameters. + * Existing parameters will be replaced. + * + * @param parameters the parameters + * @return the Implementation builder + */ + public Builder parameters(List parameters) { + this.parameters = parameters; + return this; + } + } + + protected Implementation() { } + + protected Implementation(Builder builder) { + assessmentId = builder.assessmentId; + assessmentMethod = builder.assessmentMethod; + assessmentType = builder.assessmentType; + assessmentDescription = builder.assessmentDescription; + parameterCount = builder.parameterCount; + parameters = builder.parameters; + } + + /** + * New builder. + * + * @return a Implementation builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assessmentId. + * + * The assessment ID. + * + * @return the assessmentId + */ + public String assessmentId() { + return assessmentId; + } + + /** + * Gets the assessmentMethod. + * + * The assessment method. + * + * @return the assessmentMethod + */ + public String assessmentMethod() { + return assessmentMethod; + } + + /** + * Gets the assessmentType. + * + * The assessment type. + * + * @return the assessmentType + */ + public String assessmentType() { + return assessmentType; + } + + /** + * Gets the assessmentDescription. + * + * The assessment description. + * + * @return the assessmentDescription + */ + public String assessmentDescription() { + return assessmentDescription; + } + + /** + * Gets the parameterCount. + * + * The parameter count. + * + * @return the parameterCount + */ + public Long parameterCount() { + return parameterCount; + } + + /** + * Gets the parameters. + * + * The parameters. + * + * @return the parameters + */ + public List parameters() { + return parameters; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Import.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Import.java new file mode 100644 index 00000000..7abb403f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Import.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The collection of import parameters. + */ +public class Import extends GenericModel { + + protected List parameters; + + /** + * Builder. + */ + public static class Builder { + private List parameters; + + /** + * Instantiates a new Builder from an existing Import instance. + * + * @param xImport the instance to initialize the Builder with + */ + private Builder(Import xImport) { + this.parameters = xImport.parameters; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a Import. + * + * @return the new Import instance + */ + public Import build() { + return new Import(this); + } + + /** + * Adds an parameters to parameters. + * + * @param parameters the new parameters + * @return the Import builder + */ + public Builder addParameters(Parameter parameters) { + com.ibm.cloud.sdk.core.util.Validator.notNull(parameters, + "parameters cannot be null"); + if (this.parameters == null) { + this.parameters = new ArrayList(); + } + this.parameters.add(parameters); + return this; + } + + /** + * Set the parameters. + * Existing parameters will be replaced. + * + * @param parameters the parameters + * @return the Import builder + */ + public Builder parameters(List parameters) { + this.parameters = parameters; + return this; + } + } + + protected Import() { } + + protected Import(Builder builder) { + parameters = builder.parameters; + } + + /** + * New builder. + * + * @return a Import builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the parameters. + * + * The list of import parameters. + * + * @return the parameters + */ + public List parameters() { + return parameters; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelType.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelType.java new file mode 100644 index 00000000..cc18f4df --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelType.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The label that is associated with the provider type. + */ +public class LabelType extends GenericModel { + + protected String text; + protected String tip; + + protected LabelType() { } + + /** + * Gets the text. + * + * The text of the label. + * + * @return the text + */ + public String getText() { + return text; + } + + /** + * Gets the tip. + * + * The text to be shown when user hover overs the label. + * + * @return the tip + */ + public String getTip() { + return tip; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScan.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScan.java new file mode 100644 index 00000000..ac8c04f7 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScan.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The details of the last scan of an attachment. + */ +public class LastScan extends GenericModel { + + /** + * The status of the last scan of an attachment. + */ + public interface Status { + /** in_progress. */ + String IN_PROGRESS = "in_progress"; + /** completed. */ + String COMPLETED = "completed"; + } + + protected String id; + protected String status; + protected Date time; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String status; + private Date time; + + /** + * Instantiates a new Builder from an existing LastScan instance. + * + * @param lastScan the instance to initialize the Builder with + */ + private Builder(LastScan lastScan) { + this.id = lastScan.id; + this.status = lastScan.status; + this.time = lastScan.time; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a LastScan. + * + * @return the new LastScan instance + */ + public LastScan build() { + return new LastScan(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the LastScan builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the LastScan builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * Set the time. + * + * @param time the time + * @return the LastScan builder + */ + public Builder time(Date time) { + this.time = time; + return this; + } + } + + protected LastScan() { } + + protected LastScan(Builder builder) { + id = builder.id; + status = builder.status; + time = builder.time; + } + + /** + * New builder. + * + * @return a LastScan builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The ID of the last scan of an attachment. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the status. + * + * The status of the last scan of an attachment. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the time. + * + * The time when the last scan started. + * + * @return the time + */ + public Date time() { + return time; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptions.java new file mode 100644 index 00000000..257b05b3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptions.java @@ -0,0 +1,174 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listAttachmentsAccount options. + */ +public class ListAttachmentsAccountOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + protected Long limit; + protected String start; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + private Long limit; + private String start; + + /** + * Instantiates a new Builder from an existing ListAttachmentsAccountOptions instance. + * + * @param listAttachmentsAccountOptions the instance to initialize the Builder with + */ + private Builder(ListAttachmentsAccountOptions listAttachmentsAccountOptions) { + this.xCorrelationId = listAttachmentsAccountOptions.xCorrelationId; + this.xRequestId = listAttachmentsAccountOptions.xRequestId; + this.limit = listAttachmentsAccountOptions.limit; + this.start = listAttachmentsAccountOptions.start; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ListAttachmentsAccountOptions. + * + * @return the new ListAttachmentsAccountOptions instance + */ + public ListAttachmentsAccountOptions build() { + return new ListAttachmentsAccountOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListAttachmentsAccountOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListAttachmentsAccountOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListAttachmentsAccountOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListAttachmentsAccountOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + } + + protected ListAttachmentsAccountOptions() { } + + protected ListAttachmentsAccountOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + limit = builder.limit; + start = builder.start; + } + + /** + * New builder. + * + * @return a ListAttachmentsAccountOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the limit. + * + * The indication of how many resources to return, unless the response is the last page of resources. + * + * @return the limit + */ + public Long limit() { + return limit; + } + + /** + * Gets the start. + * + * Determine what resource to start the page on or after. + * + * @return the start + */ + public String start() { + return start; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java new file mode 100644 index 00000000..2d40b1fd --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java @@ -0,0 +1,211 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listAttachments options. + */ +public class ListAttachmentsOptions extends GenericModel { + + protected String profilesId; + protected String xCorrelationId; + protected String xRequestId; + protected Long limit; + protected String start; + + /** + * Builder. + */ + public static class Builder { + private String profilesId; + private String xCorrelationId; + private String xRequestId; + private Long limit; + private String start; + + /** + * Instantiates a new Builder from an existing ListAttachmentsOptions instance. + * + * @param listAttachmentsOptions the instance to initialize the Builder with + */ + private Builder(ListAttachmentsOptions listAttachmentsOptions) { + this.profilesId = listAttachmentsOptions.profilesId; + this.xCorrelationId = listAttachmentsOptions.xCorrelationId; + this.xRequestId = listAttachmentsOptions.xRequestId; + this.limit = listAttachmentsOptions.limit; + this.start = listAttachmentsOptions.start; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param profilesId the profilesId + */ + public Builder(String profilesId) { + this.profilesId = profilesId; + } + + /** + * Builds a ListAttachmentsOptions. + * + * @return the new ListAttachmentsOptions instance + */ + public ListAttachmentsOptions build() { + return new ListAttachmentsOptions(this); + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the ListAttachmentsOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListAttachmentsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListAttachmentsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListAttachmentsOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListAttachmentsOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + } + + protected ListAttachmentsOptions() { } + + protected ListAttachmentsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + profilesId = builder.profilesId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + limit = builder.limit; + start = builder.start; + } + + /** + * New builder. + * + * @return a ListAttachmentsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the limit. + * + * The indication of how many resources to return, unless the response is the last page of resources. + * + * @return the limit + */ + public Long limit() { + return limit; + } + + /** + * Gets the start. + * + * Determine what resource to start the page on or after. + * + * @return the start + */ + public String start() { + return start; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptions.java new file mode 100644 index 00000000..52fe17c2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptions.java @@ -0,0 +1,200 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listControlLibraries options. + */ +public class ListControlLibrariesOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + protected Long limit; + protected String controlLibraryType; + protected String start; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + private Long limit; + private String controlLibraryType; + private String start; + + /** + * Instantiates a new Builder from an existing ListControlLibrariesOptions instance. + * + * @param listControlLibrariesOptions the instance to initialize the Builder with + */ + private Builder(ListControlLibrariesOptions listControlLibrariesOptions) { + this.xCorrelationId = listControlLibrariesOptions.xCorrelationId; + this.xRequestId = listControlLibrariesOptions.xRequestId; + this.limit = listControlLibrariesOptions.limit; + this.controlLibraryType = listControlLibrariesOptions.controlLibraryType; + this.start = listControlLibrariesOptions.start; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ListControlLibrariesOptions. + * + * @return the new ListControlLibrariesOptions instance + */ + public ListControlLibrariesOptions build() { + return new ListControlLibrariesOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListControlLibrariesOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListControlLibrariesOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListControlLibrariesOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + + /** + * Set the controlLibraryType. + * + * @param controlLibraryType the controlLibraryType + * @return the ListControlLibrariesOptions builder + */ + public Builder controlLibraryType(String controlLibraryType) { + this.controlLibraryType = controlLibraryType; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListControlLibrariesOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + } + + protected ListControlLibrariesOptions() { } + + protected ListControlLibrariesOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + limit = builder.limit; + controlLibraryType = builder.controlLibraryType; + start = builder.start; + } + + /** + * New builder. + * + * @return a ListControlLibrariesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the limit. + * + * The field that indicates how many resources to return, unless the response is the last page of resources. + * + * @return the limit + */ + public Long limit() { + return limit; + } + + /** + * Gets the controlLibraryType. + * + * The field that indicate how you want the resources to be filtered by. + * + * @return the controlLibraryType + */ + public String controlLibraryType() { + return controlLibraryType; + } + + /** + * Gets the start. + * + * Determine what resource to start the page on or after. + * + * @return the start + */ + public String start() { + return start; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptions.java new file mode 100644 index 00000000..b6ad2ba2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptions.java @@ -0,0 +1,200 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listProfiles options. + */ +public class ListProfilesOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + protected Long limit; + protected String profileType; + protected String start; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + private Long limit; + private String profileType; + private String start; + + /** + * Instantiates a new Builder from an existing ListProfilesOptions instance. + * + * @param listProfilesOptions the instance to initialize the Builder with + */ + private Builder(ListProfilesOptions listProfilesOptions) { + this.xCorrelationId = listProfilesOptions.xCorrelationId; + this.xRequestId = listProfilesOptions.xRequestId; + this.limit = listProfilesOptions.limit; + this.profileType = listProfilesOptions.profileType; + this.start = listProfilesOptions.start; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ListProfilesOptions. + * + * @return the new ListProfilesOptions instance + */ + public ListProfilesOptions build() { + return new ListProfilesOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListProfilesOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListProfilesOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListProfilesOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + + /** + * Set the profileType. + * + * @param profileType the profileType + * @return the ListProfilesOptions builder + */ + public Builder profileType(String profileType) { + this.profileType = profileType; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListProfilesOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + } + + protected ListProfilesOptions() { } + + protected ListProfilesOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + limit = builder.limit; + profileType = builder.profileType; + start = builder.start; + } + + /** + * New builder. + * + * @return a ListProfilesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is used for downstream requests, and retries of those requests. If a value + * of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the limit. + * + * The indication of how many resources to return, unless the response is the last page of resources. + * + * @return the limit + */ + public Long limit() { + return limit; + } + + /** + * Gets the profileType. + * + * The field that indicate how you want the resources to be filtered by. + * + * @return the profileType + */ + public String profileType() { + return profileType; + } + + /** + * Gets the start. + * + * Determine what resource to start the page on or after. + * + * @return the start + */ + public String start() { + return start; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptions.java new file mode 100644 index 00000000..2faac151 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptions.java @@ -0,0 +1,159 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listProviderTypeInstances options. + */ +public class ListProviderTypeInstancesOptions extends GenericModel { + + protected String providerTypeId; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String providerTypeId; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing ListProviderTypeInstancesOptions instance. + * + * @param listProviderTypeInstancesOptions the instance to initialize the Builder with + */ + private Builder(ListProviderTypeInstancesOptions listProviderTypeInstancesOptions) { + this.providerTypeId = listProviderTypeInstancesOptions.providerTypeId; + this.xCorrelationId = listProviderTypeInstancesOptions.xCorrelationId; + this.xRequestId = listProviderTypeInstancesOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param providerTypeId the providerTypeId + */ + public Builder(String providerTypeId) { + this.providerTypeId = providerTypeId; + } + + /** + * Builds a ListProviderTypeInstancesOptions. + * + * @return the new ListProviderTypeInstancesOptions instance + */ + public ListProviderTypeInstancesOptions build() { + return new ListProviderTypeInstancesOptions(this); + } + + /** + * Set the providerTypeId. + * + * @param providerTypeId the providerTypeId + * @return the ListProviderTypeInstancesOptions builder + */ + public Builder providerTypeId(String providerTypeId) { + this.providerTypeId = providerTypeId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListProviderTypeInstancesOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListProviderTypeInstancesOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected ListProviderTypeInstancesOptions() { } + + protected ListProviderTypeInstancesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeId, + "providerTypeId cannot be empty"); + providerTypeId = builder.providerTypeId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a ListProviderTypeInstancesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerTypeId. + * + * The provider type ID. + * + * @return the providerTypeId + */ + public String providerTypeId() { + return providerTypeId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptions.java new file mode 100644 index 00000000..00f022b5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptions.java @@ -0,0 +1,122 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listProviderTypes options. + */ +public class ListProviderTypesOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing ListProviderTypesOptions instance. + * + * @param listProviderTypesOptions the instance to initialize the Builder with + */ + private Builder(ListProviderTypesOptions listProviderTypesOptions) { + this.xCorrelationId = listProviderTypesOptions.xCorrelationId; + this.xRequestId = listProviderTypesOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ListProviderTypesOptions. + * + * @return the new ListProviderTypesOptions instance + */ + public ListProviderTypesOptions build() { + return new ListProviderTypesOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListProviderTypesOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListProviderTypesOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected ListProviderTypesOptions() { } + + protected ListProviderTypesOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a ListProviderTypesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java new file mode 100644 index 00000000..526be369 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java @@ -0,0 +1,355 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listReportEvaluations options. + */ +public class ListReportEvaluationsOptions extends GenericModel { + + /** + * The evaluation status value. + */ + public interface Status { + /** pass. */ + String PASS = "pass"; + /** failure. */ + String FAILURE = "failure"; + /** error. */ + String ERROR = "error"; + /** skipped. */ + String SKIPPED = "skipped"; + } + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + protected String assessmentId; + protected String componentId; + protected String targetId; + protected String targetName; + protected String status; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + private String assessmentId; + private String componentId; + private String targetId; + private String targetName; + private String status; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListReportEvaluationsOptions instance. + * + * @param listReportEvaluationsOptions the instance to initialize the Builder with + */ + private Builder(ListReportEvaluationsOptions listReportEvaluationsOptions) { + this.reportId = listReportEvaluationsOptions.reportId; + this.xCorrelationId = listReportEvaluationsOptions.xCorrelationId; + this.xRequestId = listReportEvaluationsOptions.xRequestId; + this.assessmentId = listReportEvaluationsOptions.assessmentId; + this.componentId = listReportEvaluationsOptions.componentId; + this.targetId = listReportEvaluationsOptions.targetId; + this.targetName = listReportEvaluationsOptions.targetName; + this.status = listReportEvaluationsOptions.status; + this.start = listReportEvaluationsOptions.start; + this.limit = listReportEvaluationsOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a ListReportEvaluationsOptions. + * + * @return the new ListReportEvaluationsOptions instance + */ + public ListReportEvaluationsOptions build() { + return new ListReportEvaluationsOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the ListReportEvaluationsOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListReportEvaluationsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListReportEvaluationsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the assessmentId. + * + * @param assessmentId the assessmentId + * @return the ListReportEvaluationsOptions builder + */ + public Builder assessmentId(String assessmentId) { + this.assessmentId = assessmentId; + return this; + } + + /** + * Set the componentId. + * + * @param componentId the componentId + * @return the ListReportEvaluationsOptions builder + */ + public Builder componentId(String componentId) { + this.componentId = componentId; + return this; + } + + /** + * Set the targetId. + * + * @param targetId the targetId + * @return the ListReportEvaluationsOptions builder + */ + public Builder targetId(String targetId) { + this.targetId = targetId; + return this; + } + + /** + * Set the targetName. + * + * @param targetName the targetName + * @return the ListReportEvaluationsOptions builder + */ + public Builder targetName(String targetName) { + this.targetName = targetName; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the ListReportEvaluationsOptions builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListReportEvaluationsOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListReportEvaluationsOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListReportEvaluationsOptions() { } + + protected ListReportEvaluationsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + assessmentId = builder.assessmentId; + componentId = builder.componentId; + targetId = builder.targetId; + targetName = builder.targetName; + status = builder.status; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListReportEvaluationsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the assessmentId. + * + * The ID of the assessment. + * + * @return the assessmentId + */ + public String assessmentId() { + return assessmentId; + } + + /** + * Gets the componentId. + * + * The ID of component. + * + * @return the componentId + */ + public String componentId() { + return componentId; + } + + /** + * Gets the targetId. + * + * The ID of the evaluation target. + * + * @return the targetId + */ + public String targetId() { + return targetId; + } + + /** + * Gets the targetName. + * + * The name of the evaluation target. + * + * @return the targetName + */ + public String targetName() { + return targetName; + } + + /** + * Gets the status. + * + * The evaluation status value. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the start. + * + * The indication of what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The indication of many resources to return, unless the response is the last page of resources. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptions.java new file mode 100644 index 00000000..f42f5a5c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptions.java @@ -0,0 +1,397 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listReportResources options. + */ +public class ListReportResourcesOptions extends GenericModel { + + /** + * The compliance status value. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + /** + * This field sorts resources by using a valid sort field. To learn more, see + * [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting). + */ + public interface Sort { + /** account_id. */ + String ACCOUNT_ID = "account_id"; + /** component_id. */ + String COMPONENT_ID = "component_id"; + /** resource_name. */ + String RESOURCE_NAME = "resource_name"; + /** status. */ + String STATUS = "status"; + } + + protected String reportId; + protected String xCorrelationId; + protected String xRequestId; + protected String id; + protected String resourceName; + protected String accountId; + protected String componentId; + protected String status; + protected String sort; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String reportId; + private String xCorrelationId; + private String xRequestId; + private String id; + private String resourceName; + private String accountId; + private String componentId; + private String status; + private String sort; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListReportResourcesOptions instance. + * + * @param listReportResourcesOptions the instance to initialize the Builder with + */ + private Builder(ListReportResourcesOptions listReportResourcesOptions) { + this.reportId = listReportResourcesOptions.reportId; + this.xCorrelationId = listReportResourcesOptions.xCorrelationId; + this.xRequestId = listReportResourcesOptions.xRequestId; + this.id = listReportResourcesOptions.id; + this.resourceName = listReportResourcesOptions.resourceName; + this.accountId = listReportResourcesOptions.accountId; + this.componentId = listReportResourcesOptions.componentId; + this.status = listReportResourcesOptions.status; + this.sort = listReportResourcesOptions.sort; + this.start = listReportResourcesOptions.start; + this.limit = listReportResourcesOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param reportId the reportId + */ + public Builder(String reportId) { + this.reportId = reportId; + } + + /** + * Builds a ListReportResourcesOptions. + * + * @return the new ListReportResourcesOptions instance + */ + public ListReportResourcesOptions build() { + return new ListReportResourcesOptions(this); + } + + /** + * Set the reportId. + * + * @param reportId the reportId + * @return the ListReportResourcesOptions builder + */ + public Builder reportId(String reportId) { + this.reportId = reportId; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListReportResourcesOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListReportResourcesOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the ListReportResourcesOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the resourceName. + * + * @param resourceName the resourceName + * @return the ListReportResourcesOptions builder + */ + public Builder resourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Set the accountId. + * + * @param accountId the accountId + * @return the ListReportResourcesOptions builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set the componentId. + * + * @param componentId the componentId + * @return the ListReportResourcesOptions builder + */ + public Builder componentId(String componentId) { + this.componentId = componentId; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the ListReportResourcesOptions builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * Set the sort. + * + * @param sort the sort + * @return the ListReportResourcesOptions builder + */ + public Builder sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListReportResourcesOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListReportResourcesOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListReportResourcesOptions() { } + + protected ListReportResourcesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.reportId, + "reportId cannot be empty"); + reportId = builder.reportId; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + id = builder.id; + resourceName = builder.resourceName; + accountId = builder.accountId; + componentId = builder.componentId; + status = builder.status; + sort = builder.sort; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListReportResourcesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the reportId. + * + * The ID of the scan that is associated with a report. + * + * @return the reportId + */ + public String reportId() { + return reportId; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the id. + * + * The ID of the resource. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the resourceName. + * + * The name of the resource. + * + * @return the resourceName + */ + public String resourceName() { + return resourceName; + } + + /** + * Gets the accountId. + * + * The ID of the account owning a resource. + * + * @return the accountId + */ + public String accountId() { + return accountId; + } + + /** + * Gets the componentId. + * + * The ID of component. + * + * @return the componentId + */ + public String componentId() { + return componentId; + } + + /** + * Gets the status. + * + * The compliance status value. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the sort. + * + * This field sorts resources by using a valid sort field. To learn more, see + * [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting). + * + * @return the sort + */ + public String sort() { + return sort; + } + + /** + * Gets the start. + * + * The indication of what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The indication of many resources to return, unless the response is the last page of resources. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptions.java new file mode 100644 index 00000000..8a18b090 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptions.java @@ -0,0 +1,315 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listReports options. + */ +public class ListReportsOptions extends GenericModel { + + /** + * The type of the scan. + */ + public interface Type { + /** ondemand. */ + String ONDEMAND = "ondemand"; + /** scheduled. */ + String SCHEDULED = "scheduled"; + } + + protected String xCorrelationId; + protected String xRequestId; + protected String attachmentId; + protected String groupId; + protected String profileId; + protected String type; + protected String start; + protected Long limit; + protected String sort; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + private String attachmentId; + private String groupId; + private String profileId; + private String type; + private String start; + private Long limit; + private String sort; + + /** + * Instantiates a new Builder from an existing ListReportsOptions instance. + * + * @param listReportsOptions the instance to initialize the Builder with + */ + private Builder(ListReportsOptions listReportsOptions) { + this.xCorrelationId = listReportsOptions.xCorrelationId; + this.xRequestId = listReportsOptions.xRequestId; + this.attachmentId = listReportsOptions.attachmentId; + this.groupId = listReportsOptions.groupId; + this.profileId = listReportsOptions.profileId; + this.type = listReportsOptions.type; + this.start = listReportsOptions.start; + this.limit = listReportsOptions.limit; + this.sort = listReportsOptions.sort; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ListReportsOptions. + * + * @return the new ListReportsOptions instance + */ + public ListReportsOptions build() { + return new ListReportsOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListReportsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListReportsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the attachmentId. + * + * @param attachmentId the attachmentId + * @return the ListReportsOptions builder + */ + public Builder attachmentId(String attachmentId) { + this.attachmentId = attachmentId; + return this; + } + + /** + * Set the groupId. + * + * @param groupId the groupId + * @return the ListReportsOptions builder + */ + public Builder groupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Set the profileId. + * + * @param profileId the profileId + * @return the ListReportsOptions builder + */ + public Builder profileId(String profileId) { + this.profileId = profileId; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the ListReportsOptions builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListReportsOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListReportsOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + + /** + * Set the sort. + * + * @param sort the sort + * @return the ListReportsOptions builder + */ + public Builder sort(String sort) { + this.sort = sort; + return this; + } + } + + protected ListReportsOptions() { } + + protected ListReportsOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + attachmentId = builder.attachmentId; + groupId = builder.groupId; + profileId = builder.profileId; + type = builder.type; + start = builder.start; + limit = builder.limit; + sort = builder.sort; + } + + /** + * New builder. + * + * @return a ListReportsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the attachmentId. + * + * The ID of the attachment. + * + * @return the attachmentId + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Gets the groupId. + * + * The report group ID. + * + * @return the groupId + */ + public String groupId() { + return groupId; + } + + /** + * Gets the profileId. + * + * The ID of the profile. + * + * @return the profileId + */ + public String profileId() { + return profileId; + } + + /** + * Gets the type. + * + * The type of the scan. + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the start. + * + * The indication of what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The indication of many resources to return, unless the response is the last page of resources. + * + * @return the limit + */ + public Long limit() { + return limit; + } + + /** + * Gets the sort. + * + * This field sorts results by using a valid sort field. To learn more, see + * [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting). + * + * @return the sort + */ + public String sort() { + return sort; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptions.java new file mode 100644 index 00000000..16429dc1 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptions.java @@ -0,0 +1,200 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listRules options. + */ +public class ListRulesOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + protected String type; + protected String search; + protected String serviceName; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + private String type; + private String search; + private String serviceName; + + /** + * Instantiates a new Builder from an existing ListRulesOptions instance. + * + * @param listRulesOptions the instance to initialize the Builder with + */ + private Builder(ListRulesOptions listRulesOptions) { + this.xCorrelationId = listRulesOptions.xCorrelationId; + this.xRequestId = listRulesOptions.xRequestId; + this.type = listRulesOptions.type; + this.search = listRulesOptions.search; + this.serviceName = listRulesOptions.serviceName; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ListRulesOptions. + * + * @return the new ListRulesOptions instance + */ + public ListRulesOptions build() { + return new ListRulesOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ListRulesOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ListRulesOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the ListRulesOptions builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the search. + * + * @param search the search + * @return the ListRulesOptions builder + */ + public Builder search(String search) { + this.search = search; + return this; + } + + /** + * Set the serviceName. + * + * @param serviceName the serviceName + * @return the ListRulesOptions builder + */ + public Builder serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + } + + protected ListRulesOptions() { } + + protected ListRulesOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + type = builder.type; + search = builder.search; + serviceName = builder.serviceName; + } + + /** + * New builder. + * + * @return a ListRulesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } + + /** + * Gets the type. + * + * The list of only user-defined, or system-defined rules. + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the search. + * + * The indication of whether to search for rules with a specific string string in the name, description, or labels. + * + * @return the search + */ + public String search() { + return search; + } + + /** + * Gets the serviceName. + * + * Searches for rules targeting corresponding service. + * + * @return the serviceName + */ + public String serviceName() { + return serviceName; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScope.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScope.java new file mode 100644 index 00000000..91e4f12c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScope.java @@ -0,0 +1,155 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The scope payload for the multi cloud feature. + */ +public class MultiCloudScope extends GenericModel { + + protected String environment; + @SerializedName("properties") + protected List xProperties; + + /** + * Builder. + */ + public static class Builder { + private String environment; + private List xProperties; + + /** + * Instantiates a new Builder from an existing MultiCloudScope instance. + * + * @param multiCloudScope the instance to initialize the Builder with + */ + private Builder(MultiCloudScope multiCloudScope) { + this.environment = multiCloudScope.environment; + this.xProperties = multiCloudScope.xProperties; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param environment the environment + * @param xProperties the xProperties + */ + public Builder(String environment, List xProperties) { + this.environment = environment; + this.xProperties = xProperties; + } + + /** + * Builds a MultiCloudScope. + * + * @return the new MultiCloudScope instance + */ + public MultiCloudScope build() { + return new MultiCloudScope(this); + } + + /** + * Adds an xProperties to xProperties. + * + * @param xProperties the new xProperties + * @return the MultiCloudScope builder + */ + public Builder addXProperties(PropertyItem xProperties) { + com.ibm.cloud.sdk.core.util.Validator.notNull(xProperties, + "xProperties cannot be null"); + if (this.xProperties == null) { + this.xProperties = new ArrayList(); + } + this.xProperties.add(xProperties); + return this; + } + + /** + * Set the environment. + * + * @param environment the environment + * @return the MultiCloudScope builder + */ + public Builder environment(String environment) { + this.environment = environment; + return this; + } + + /** + * Set the xProperties. + * Existing xProperties will be replaced. + * + * @param xProperties the xProperties + * @return the MultiCloudScope builder + */ + public Builder xProperties(List xProperties) { + this.xProperties = xProperties; + return this; + } + } + + protected MultiCloudScope() { } + + protected MultiCloudScope(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.environment, + "environment cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.xProperties, + "xProperties cannot be null"); + environment = builder.environment; + xProperties = builder.xProperties; + } + + /** + * New builder. + * + * @return a MultiCloudScope builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the environment. + * + * The environment that relates to this scope. + * + * @return the environment + */ + public String environment() { + return environment; + } + + /** + * Gets the xProperties. + * + * The properties supported for scoping by this environment. + * + * @return the xProperties + */ + public List xProperties() { + return xProperties; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorage.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorage.java new file mode 100644 index 00000000..e48f7b09 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorage.java @@ -0,0 +1,203 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The Cloud Object Storage settings. + */ +public class ObjectStorage extends GenericModel { + + @SerializedName("instance_crn") + protected String instanceCrn; + protected String bucket; + @SerializedName("bucket_location") + protected String bucketLocation; + @SerializedName("bucket_endpoint") + protected String bucketEndpoint; + @SerializedName("updated_on") + protected Date updatedOn; + + /** + * Builder. + */ + public static class Builder { + private String instanceCrn; + private String bucket; + private String bucketLocation; + private String bucketEndpoint; + private Date updatedOn; + + /** + * Instantiates a new Builder from an existing ObjectStorage instance. + * + * @param objectStorage the instance to initialize the Builder with + */ + private Builder(ObjectStorage objectStorage) { + this.instanceCrn = objectStorage.instanceCrn; + this.bucket = objectStorage.bucket; + this.bucketLocation = objectStorage.bucketLocation; + this.bucketEndpoint = objectStorage.bucketEndpoint; + this.updatedOn = objectStorage.updatedOn; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ObjectStorage. + * + * @return the new ObjectStorage instance + */ + public ObjectStorage build() { + return new ObjectStorage(this); + } + + /** + * Set the instanceCrn. + * + * @param instanceCrn the instanceCrn + * @return the ObjectStorage builder + */ + public Builder instanceCrn(String instanceCrn) { + this.instanceCrn = instanceCrn; + return this; + } + + /** + * Set the bucket. + * + * @param bucket the bucket + * @return the ObjectStorage builder + */ + public Builder bucket(String bucket) { + this.bucket = bucket; + return this; + } + + /** + * Set the bucketLocation. + * + * @param bucketLocation the bucketLocation + * @return the ObjectStorage builder + */ + public Builder bucketLocation(String bucketLocation) { + this.bucketLocation = bucketLocation; + return this; + } + + /** + * Set the bucketEndpoint. + * + * @param bucketEndpoint the bucketEndpoint + * @return the ObjectStorage builder + */ + public Builder bucketEndpoint(String bucketEndpoint) { + this.bucketEndpoint = bucketEndpoint; + return this; + } + + /** + * Set the updatedOn. + * + * @param updatedOn the updatedOn + * @return the ObjectStorage builder + */ + public Builder updatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + return this; + } + } + + protected ObjectStorage() { } + + protected ObjectStorage(Builder builder) { + instanceCrn = builder.instanceCrn; + bucket = builder.bucket; + bucketLocation = builder.bucketLocation; + bucketEndpoint = builder.bucketEndpoint; + updatedOn = builder.updatedOn; + } + + /** + * New builder. + * + * @return a ObjectStorage builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the instanceCrn. + * + * The connected Cloud Object Storage instance CRN. + * + * @return the instanceCrn + */ + public String instanceCrn() { + return instanceCrn; + } + + /** + * Gets the bucket. + * + * The connected Cloud Object Storage bucket name. + * + * @return the bucket + */ + public String bucket() { + return bucket; + } + + /** + * Gets the bucketLocation. + * + * The connected Cloud Object Storage bucket location. + * + * @return the bucketLocation + */ + public String bucketLocation() { + return bucketLocation; + } + + /** + * Gets the bucketEndpoint. + * + * The connected Cloud Object Storage bucket endpoint. + * + * @return the bucketEndpoint + */ + public String bucketEndpoint() { + return bucketEndpoint; + } + + /** + * Gets the updatedOn. + * + * The date when the bucket connection was updated. + * + * @return the updatedOn + */ + public Date updatedOn() { + return updatedOn; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRef.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRef.java new file mode 100644 index 00000000..9c3322b2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRef.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The page reference. + */ +public class PageHRef extends GenericModel { + + protected String href; + + protected PageHRef() { } + + /** + * Gets the href. + * + * The URL for the first and next page. + * + * @return the href + */ + public String getHref() { + return href; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirst.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirst.java new file mode 100644 index 00000000..0b64dd19 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirst.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A page reference. + */ +public class PageHRefFirst extends GenericModel { + + protected String href; + + protected PageHRefFirst() { } + + /** + * Gets the href. + * + * A URL for the first and next page. + * + * @return the href + */ + public String getHref() { + return href; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNext.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNext.java new file mode 100644 index 00000000..e266cab3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNext.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A page reference. + */ +public class PageHRefNext extends GenericModel { + + protected String href; + protected String start; + + protected PageHRefNext() { } + + /** + * Gets the href. + * + * A URL for the first and next page. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the start. + * + * The token of the next page when present. + * + * @return the start + */ + public String getStart() { + return start; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirst.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirst.java new file mode 100644 index 00000000..876c3ddb --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirst.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The reference to the first page of entries. + */ +public class PaginatedCollectionFirst extends GenericModel { + + protected String href; + + protected PaginatedCollectionFirst() { } + + /** + * Gets the href. + * + * The reference URL for the first few entries. + * + * @return the href + */ + public String getHref() { + return href; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNext.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNext.java new file mode 100644 index 00000000..02885fc8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNext.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The reference URL for the next few entries. + */ +public class PaginatedCollectionNext extends GenericModel { + + protected String href; + protected String start; + + protected PaginatedCollectionNext() { } + + /** + * Gets the href. + * + * The reference URL for the entries. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the start. + * + * The reference to the start of the list of entries. + * + * @return the start + */ + public String getStart() { + return start; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Parameter.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Parameter.java new file mode 100644 index 00000000..704daa3a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Parameter.java @@ -0,0 +1,192 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The rule import parameter. + */ +public class Parameter extends GenericModel { + + /** + * The property type. + */ + public interface Type { + /** string. */ + String STRING = "string"; + /** numeric. */ + String NUMERIC = "numeric"; + /** general. */ + String GENERAL = "general"; + /** boolean. */ + String X_BOOLEAN = "boolean"; + /** string_list. */ + String STRING_LIST = "string_list"; + /** ip_list. */ + String IP_LIST = "ip_list"; + /** timestamp. */ + String TIMESTAMP = "timestamp"; + } + + protected String name; + @SerializedName("display_name") + protected String displayName; + protected String description; + protected String type; + + /** + * Builder. + */ + public static class Builder { + private String name; + private String displayName; + private String description; + private String type; + + /** + * Instantiates a new Builder from an existing Parameter instance. + * + * @param parameter the instance to initialize the Builder with + */ + private Builder(Parameter parameter) { + this.name = parameter.name; + this.displayName = parameter.displayName; + this.description = parameter.description; + this.type = parameter.type; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a Parameter. + * + * @return the new Parameter instance + */ + public Parameter build() { + return new Parameter(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the Parameter builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the displayName. + * + * @param displayName the displayName + * @return the Parameter builder + */ + public Builder displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the Parameter builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the Parameter builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + } + + protected Parameter() { } + + protected Parameter(Builder builder) { + name = builder.name; + displayName = builder.displayName; + description = builder.description; + type = builder.type; + } + + /** + * New builder. + * + * @return a Parameter builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the name. + * + * The import parameter name. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the displayName. + * + * The display name of the property. + * + * @return the displayName + */ + public String displayName() { + return displayName; + } + + /** + * Gets the description. + * + * The propery description. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the type. + * + * The property type. + * + * @return the type + */ + public String type() { + return type; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfo.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfo.java new file mode 100644 index 00000000..0936dfa5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfo.java @@ -0,0 +1,195 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The parameter details. + */ +public class ParameterInfo extends GenericModel { + + /** + * The parameter type. + */ + public interface ParameterType { + /** string. */ + String STRING = "string"; + /** numeric. */ + String NUMERIC = "numeric"; + /** general. */ + String GENERAL = "general"; + /** boolean. */ + String X_BOOLEAN = "boolean"; + /** string_list. */ + String STRING_LIST = "string_list"; + /** ip_list. */ + String IP_LIST = "ip_list"; + /** timestamp. */ + String TIMESTAMP = "timestamp"; + } + + @SerializedName("parameter_name") + protected String parameterName; + @SerializedName("parameter_display_name") + protected String parameterDisplayName; + @SerializedName("parameter_type") + protected String parameterType; + @SerializedName("parameter_value") + protected Object parameterValue; + + /** + * Builder. + */ + public static class Builder { + private String parameterName; + private String parameterDisplayName; + private String parameterType; + private Object parameterValue; + + /** + * Instantiates a new Builder from an existing ParameterInfo instance. + * + * @param parameterInfo the instance to initialize the Builder with + */ + private Builder(ParameterInfo parameterInfo) { + this.parameterName = parameterInfo.parameterName; + this.parameterDisplayName = parameterInfo.parameterDisplayName; + this.parameterType = parameterInfo.parameterType; + this.parameterValue = parameterInfo.parameterValue; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ParameterInfo. + * + * @return the new ParameterInfo instance + */ + public ParameterInfo build() { + return new ParameterInfo(this); + } + + /** + * Set the parameterName. + * + * @param parameterName the parameterName + * @return the ParameterInfo builder + */ + public Builder parameterName(String parameterName) { + this.parameterName = parameterName; + return this; + } + + /** + * Set the parameterDisplayName. + * + * @param parameterDisplayName the parameterDisplayName + * @return the ParameterInfo builder + */ + public Builder parameterDisplayName(String parameterDisplayName) { + this.parameterDisplayName = parameterDisplayName; + return this; + } + + /** + * Set the parameterType. + * + * @param parameterType the parameterType + * @return the ParameterInfo builder + */ + public Builder parameterType(String parameterType) { + this.parameterType = parameterType; + return this; + } + + /** + * Set the parameterValue. + * + * @param parameterValue the parameterValue + * @return the ParameterInfo builder + */ + public Builder parameterValue(Object parameterValue) { + this.parameterValue = parameterValue; + return this; + } + } + + protected ParameterInfo() { } + + protected ParameterInfo(Builder builder) { + parameterName = builder.parameterName; + parameterDisplayName = builder.parameterDisplayName; + parameterType = builder.parameterType; + parameterValue = builder.parameterValue; + } + + /** + * New builder. + * + * @return a ParameterInfo builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the parameterName. + * + * The parameter name. + * + * @return the parameterName + */ + public String parameterName() { + return parameterName; + } + + /** + * Gets the parameterDisplayName. + * + * The parameter display name. + * + * @return the parameterDisplayName + */ + public String parameterDisplayName() { + return parameterDisplayName; + } + + /** + * Gets the parameterType. + * + * The parameter type. + * + * @return the parameterType + */ + public String parameterType() { + return parameterType; + } + + /** + * Gets the parameterValue. + * + * The property value. + * + * @return the parameterValue + */ + public Object parameterValue() { + return parameterValue; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptions.java new file mode 100644 index 00000000..5fce1973 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptions.java @@ -0,0 +1,122 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The postTestEvent options. + */ +public class PostTestEventOptions extends GenericModel { + + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing PostTestEventOptions instance. + * + * @param postTestEventOptions the instance to initialize the Builder with + */ + private Builder(PostTestEventOptions postTestEventOptions) { + this.xCorrelationId = postTestEventOptions.xCorrelationId; + this.xRequestId = postTestEventOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a PostTestEventOptions. + * + * @return the new PostTestEventOptions instance + */ + public PostTestEventOptions build() { + return new PostTestEventOptions(this); + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the PostTestEventOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the PostTestEventOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected PostTestEventOptions() { } + + protected PostTestEventOptions(Builder builder) { + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a PostTestEventOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Profile.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Profile.java new file mode 100644 index 00000000..bd334ac9 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Profile.java @@ -0,0 +1,270 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body of the profile. + */ +public class Profile extends GenericModel { + + /** + * The profile type, such as custom or predefined. + */ + public interface ProfileType { + /** predefined. */ + String PREDEFINED = "predefined"; + /** custom. */ + String CUSTOM = "custom"; + } + + protected String id; + @SerializedName("profile_name") + protected String profileName; + @SerializedName("profile_description") + protected String profileDescription; + @SerializedName("profile_type") + protected String profileType; + @SerializedName("profile_version") + protected String profileVersion; + @SerializedName("version_group_label") + protected String versionGroupLabel; + @SerializedName("instance_id") + protected String instanceId; + protected Boolean latest; + @SerializedName("hierarchy_enabled") + protected Boolean hierarchyEnabled; + @SerializedName("created_by") + protected String createdBy; + @SerializedName("created_on") + protected Date createdOn; + @SerializedName("updated_by") + protected String updatedBy; + @SerializedName("updated_on") + protected Date updatedOn; + @SerializedName("controls_count") + protected Long controlsCount; + @SerializedName("control_parents_count") + protected Long controlParentsCount; + @SerializedName("attachments_count") + protected Long attachmentsCount; + protected List controls; + @SerializedName("default_parameters") + protected List defaultParameters; + + protected Profile() { } + + /** + * Gets the id. + * + * The unique ID of the profile. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the profileName. + * + * The profile name. + * + * @return the profileName + */ + public String getProfileName() { + return profileName; + } + + /** + * Gets the profileDescription. + * + * The profile description. + * + * @return the profileDescription + */ + public String getProfileDescription() { + return profileDescription; + } + + /** + * Gets the profileType. + * + * The profile type, such as custom or predefined. + * + * @return the profileType + */ + public String getProfileType() { + return profileType; + } + + /** + * Gets the profileVersion. + * + * The version status of the profile. + * + * @return the profileVersion + */ + public String getProfileVersion() { + return profileVersion; + } + + /** + * Gets the versionGroupLabel. + * + * The version group label of the profile. + * + * @return the versionGroupLabel + */ + public String getVersionGroupLabel() { + return versionGroupLabel; + } + + /** + * Gets the instanceId. + * + * The instance ID. + * + * @return the instanceId + */ + public String getInstanceId() { + return instanceId; + } + + /** + * Gets the latest. + * + * The latest version of the profile. + * + * @return the latest + */ + public Boolean isLatest() { + return latest; + } + + /** + * Gets the hierarchyEnabled. + * + * The indication of whether hierarchy is enabled for the profile. + * + * @return the hierarchyEnabled + */ + public Boolean isHierarchyEnabled() { + return hierarchyEnabled; + } + + /** + * Gets the createdBy. + * + * The user who created the profile. + * + * @return the createdBy + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * Gets the createdOn. + * + * The date when the profile was created. + * + * @return the createdOn + */ + public Date getCreatedOn() { + return createdOn; + } + + /** + * Gets the updatedBy. + * + * The user who updated the profile. + * + * @return the updatedBy + */ + public String getUpdatedBy() { + return updatedBy; + } + + /** + * Gets the updatedOn. + * + * The date when the profile was updated. + * + * @return the updatedOn + */ + public Date getUpdatedOn() { + return updatedOn; + } + + /** + * Gets the controlsCount. + * + * The number of controls for the profile. + * + * @return the controlsCount + */ + public Long getControlsCount() { + return controlsCount; + } + + /** + * Gets the controlParentsCount. + * + * The number of parent controls for the profile. + * + * @return the controlParentsCount + */ + public Long getControlParentsCount() { + return controlParentsCount; + } + + /** + * Gets the attachmentsCount. + * + * The number of attachments related to this profile. + * + * @return the attachmentsCount + */ + public Long getAttachmentsCount() { + return attachmentsCount; + } + + /** + * Gets the controls. + * + * The array of controls that are used to create the profile. + * + * @return the controls + */ + public List getControls() { + return controls; + } + + /** + * Gets the defaultParameters. + * + * The default parameters of the profile. + * + * @return the defaultParameters + */ + public List getDefaultParameters() { + return defaultParameters; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java new file mode 100644 index 00000000..53d41102 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body to get all profiles that are linked to your account. + */ +public class ProfileCollection extends GenericModel { + + @SerializedName("total_count") + protected Long totalCount; + protected Long limit; + protected PaginatedCollectionFirst first; + protected PaginatedCollectionNext next; + protected List profiles; + + protected ProfileCollection() { } + + /** + * Gets the totalCount. + * + * The number of profiles. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the limit. + * + * The limit of profiles that can be created. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the first. + * + * The reference to the first page of entries. + * + * @return the first + */ + public PaginatedCollectionFirst getFirst() { + return first; + } + + /** + * Gets the next. + * + * The reference URL for the next few entries. + * + * @return the next + */ + public PaginatedCollectionNext getNext() { + return next; + } + + /** + * Gets the profiles. + * + * The profiles. + * + * @return the profiles + */ + public List getProfiles() { + return profiles; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControls.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControls.java new file mode 100644 index 00000000..85bce82d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControls.java @@ -0,0 +1,171 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control details for the profile. + */ +public class ProfileControls extends GenericModel { + + @SerializedName("control_library_id") + protected String controlLibraryId; + @SerializedName("control_id") + protected String controlId; + @SerializedName("control_library_version") + protected String controlLibraryVersion; + @SerializedName("control_name") + protected String controlName; + @SerializedName("control_description") + protected String controlDescription; + @SerializedName("control_category") + protected String controlCategory; + @SerializedName("control_parent") + protected String controlParent; + @SerializedName("control_requirement") + protected Boolean controlRequirement; + @SerializedName("control_docs") + protected ControlDocs controlDocs; + @SerializedName("control_specifications_count") + protected Long controlSpecificationsCount; + @SerializedName("control_specifications") + protected List controlSpecifications; + + protected ProfileControls() { } + + /** + * Gets the controlLibraryId. + * + * The ID of the control library that contains the profile. + * + * @return the controlLibraryId + */ + public String getControlLibraryId() { + return controlLibraryId; + } + + /** + * Gets the controlId. + * + * The unique ID of the control library that contains the profile. + * + * @return the controlId + */ + public String getControlId() { + return controlId; + } + + /** + * Gets the controlLibraryVersion. + * + * The most recent version of the control library. + * + * @return the controlLibraryVersion + */ + public String getControlLibraryVersion() { + return controlLibraryVersion; + } + + /** + * Gets the controlName. + * + * The control name. + * + * @return the controlName + */ + public String getControlName() { + return controlName; + } + + /** + * Gets the controlDescription. + * + * The control description. + * + * @return the controlDescription + */ + public String getControlDescription() { + return controlDescription; + } + + /** + * Gets the controlCategory. + * + * The control category. + * + * @return the controlCategory + */ + public String getControlCategory() { + return controlCategory; + } + + /** + * Gets the controlParent. + * + * The parent control. + * + * @return the controlParent + */ + public String getControlParent() { + return controlParent; + } + + /** + * Gets the controlRequirement. + * + * Is this a control that can be automated or manually evaluated. + * + * @return the controlRequirement + */ + public Boolean isControlRequirement() { + return controlRequirement; + } + + /** + * Gets the controlDocs. + * + * The control documentation. + * + * @return the controlDocs + */ + public ControlDocs getControlDocs() { + return controlDocs; + } + + /** + * Gets the controlSpecificationsCount. + * + * The number of control specifications. + * + * @return the controlSpecificationsCount + */ + public Long getControlSpecificationsCount() { + return controlSpecificationsCount; + } + + /** + * Gets the controlSpecifications. + * + * The control specifications. + * + * @return the controlSpecifications + */ + public List getControlSpecifications() { + return controlSpecifications; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototype.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototype.java new file mode 100644 index 00000000..45fe8360 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototype.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The control details of a profile. + */ +public class ProfileControlsPrototype extends GenericModel { + + @SerializedName("control_library_id") + protected String controlLibraryId; + @SerializedName("control_id") + protected String controlId; + + /** + * Builder. + */ + public static class Builder { + private String controlLibraryId; + private String controlId; + + /** + * Instantiates a new Builder from an existing ProfileControlsPrototype instance. + * + * @param profileControlsPrototype the instance to initialize the Builder with + */ + private Builder(ProfileControlsPrototype profileControlsPrototype) { + this.controlLibraryId = profileControlsPrototype.controlLibraryId; + this.controlId = profileControlsPrototype.controlId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ProfileControlsPrototype. + * + * @return the new ProfileControlsPrototype instance + */ + public ProfileControlsPrototype build() { + return new ProfileControlsPrototype(this); + } + + /** + * Set the controlLibraryId. + * + * @param controlLibraryId the controlLibraryId + * @return the ProfileControlsPrototype builder + */ + public Builder controlLibraryId(String controlLibraryId) { + this.controlLibraryId = controlLibraryId; + return this; + } + + /** + * Set the controlId. + * + * @param controlId the controlId + * @return the ProfileControlsPrototype builder + */ + public Builder controlId(String controlId) { + this.controlId = controlId; + return this; + } + } + + protected ProfileControlsPrototype() { } + + protected ProfileControlsPrototype(Builder builder) { + controlLibraryId = builder.controlLibraryId; + controlId = builder.controlId; + } + + /** + * New builder. + * + * @return a ProfileControlsPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlLibraryId. + * + * The ID of the control library that contains the profile. + * + * @return the controlLibraryId + */ + public String controlLibraryId() { + return controlLibraryId; + } + + /** + * Gets the controlId. + * + * The control ID. + * + * @return the controlId + */ + public String controlId() { + return controlId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfo.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfo.java new file mode 100644 index 00000000..cb348fe8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfo.java @@ -0,0 +1,61 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The profile information. + */ +public class ProfileInfo extends GenericModel { + + protected String id; + protected String name; + protected String version; + + protected ProfileInfo() { } + + /** + * Gets the id. + * + * The profile ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the name. + * + * The profile name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the version. + * + * The profile version. + * + * @return the version + */ + public String getVersion() { + return version; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItem.java new file mode 100644 index 00000000..9b7fbb4e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItem.java @@ -0,0 +1,195 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ProfileItem. + */ +public class ProfileItem extends GenericModel { + + protected String id; + @SerializedName("profile_name") + protected String profileName; + @SerializedName("profile_description") + protected String profileDescription; + @SerializedName("profile_type") + protected String profileType; + @SerializedName("profile_version") + protected String profileVersion; + @SerializedName("version_group_label") + protected String versionGroupLabel; + protected Boolean latest; + @SerializedName("created_by") + protected String createdBy; + @SerializedName("created_on") + protected Date createdOn; + @SerializedName("updated_by") + protected String updatedBy; + @SerializedName("updated_on") + protected Date updatedOn; + @SerializedName("controls_count") + protected Long controlsCount; + @SerializedName("attachments_count") + protected Long attachmentsCount; + + protected ProfileItem() { } + + /** + * Gets the id. + * + * The profile ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the profileName. + * + * The profile name. + * + * @return the profileName + */ + public String getProfileName() { + return profileName; + } + + /** + * Gets the profileDescription. + * + * The profile description. + * + * @return the profileDescription + */ + public String getProfileDescription() { + return profileDescription; + } + + /** + * Gets the profileType. + * + * The profile type. + * + * @return the profileType + */ + public String getProfileType() { + return profileType; + } + + /** + * Gets the profileVersion. + * + * The profile version. + * + * @return the profileVersion + */ + public String getProfileVersion() { + return profileVersion; + } + + /** + * Gets the versionGroupLabel. + * + * The version group label. + * + * @return the versionGroupLabel + */ + public String getVersionGroupLabel() { + return versionGroupLabel; + } + + /** + * Gets the latest. + * + * The latest profile. + * + * @return the latest + */ + public Boolean isLatest() { + return latest; + } + + /** + * Gets the createdBy. + * + * The user who created the profile. + * + * @return the createdBy + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * Gets the createdOn. + * + * The date when the profile was created. + * + * @return the createdOn + */ + public Date getCreatedOn() { + return createdOn; + } + + /** + * Gets the updatedBy. + * + * The user who updated the profile. + * + * @return the updatedBy + */ + public String getUpdatedBy() { + return updatedBy; + } + + /** + * Gets the updatedOn. + * + * The date when the profile was updated. + * + * @return the updatedOn + */ + public Date getUpdatedOn() { + return updatedOn; + } + + /** + * Gets the controlsCount. + * + * The number of controls. + * + * @return the controlsCount + */ + public Long getControlsCount() { + return controlsCount; + } + + /** + * Gets the attachmentsCount. + * + * The number of attachments. + * + * @return the attachmentsCount + */ + public Long getAttachmentsCount() { + return attachmentsCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfilesPager.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfilesPager.java new file mode 100644 index 00000000..e8764d61 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfilesPager.java @@ -0,0 +1,107 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ProfilesPager can be used to simplify the use of the "listProfiles" method. + */ +public class ProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListProfilesOptions options; + protected SecurityAndComplianceCenterApi client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ProfilesPager() { } + + /** + * Constructs a new ProfilesPager instance with the specified client and options model instance. + * @param client the SecurityAndComplianceCenterApi instance to be used to invoke the "listProfiles" method + * @param options the ListProfilesOptions instance to be used to invoke the "listProfiles" method + */ + public ProfilesPager(SecurityAndComplianceCenterApi client, ListProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<ProfileItem> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ProfileCollection result = client.listProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + next = result.getNext().getStart(); + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<ProfileItem> containing all results returned by the "listProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Property.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Property.java new file mode 100644 index 00000000..235e9c2b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Property.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The property. + */ +public class Property extends GenericModel { + + protected String property; + @SerializedName("property_description") + protected String propertyDescription; + protected String operator; + @SerializedName("expected_value") + protected Object expectedValue; + @SerializedName("found_value") + protected Object foundValue; + + protected Property() { } + + /** + * Gets the property. + * + * The property name. + * + * @return the property + */ + public String getProperty() { + return property; + } + + /** + * Gets the propertyDescription. + * + * The property description. + * + * @return the propertyDescription + */ + public String getPropertyDescription() { + return propertyDescription; + } + + /** + * Gets the operator. + * + * The property operator. + * + * @return the operator + */ + public String getOperator() { + return operator; + } + + /** + * Gets the expectedValue. + * + * The property value. + * + * @return the expectedValue + */ + public Object getExpectedValue() { + return expectedValue; + } + + /** + * Gets the foundValue. + * + * The property value. + * + * @return the foundValue + */ + public Object getFoundValue() { + return foundValue; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItem.java new file mode 100644 index 00000000..3597c275 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItem.java @@ -0,0 +1,118 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The properties supported for scoping by this environment. + */ +public class PropertyItem extends GenericModel { + + protected String name; + protected String value; + + /** + * Builder. + */ + public static class Builder { + private String name; + private String value; + + /** + * Instantiates a new Builder from an existing PropertyItem instance. + * + * @param propertyItem the instance to initialize the Builder with + */ + private Builder(PropertyItem propertyItem) { + this.name = propertyItem.name; + this.value = propertyItem.value; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a PropertyItem. + * + * @return the new PropertyItem instance + */ + public PropertyItem build() { + return new PropertyItem(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the PropertyItem builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the PropertyItem builder + */ + public Builder value(String value) { + this.value = value; + return this; + } + } + + protected PropertyItem() { } + + protected PropertyItem(Builder builder) { + name = builder.name; + value = builder.value; + } + + /** + * New builder. + * + * @return a PropertyItem builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the name. + * + * The name of the property. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the value. + * + * The value of the property. + * + * @return the value + */ + public String value() { + return value; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java new file mode 100644 index 00000000..1b47ce9e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java @@ -0,0 +1,103 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; +import java.util.Map; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A provider type instance. + */ +public class ProviderTypeInstanceItem extends GenericModel { + + protected String id; + protected String type; + protected String name; + protected Map attributes; + @SerializedName("created_at") + protected Date createdAt; + @SerializedName("updated_at") + protected Date updatedAt; + + protected ProviderTypeInstanceItem() { } + + /** + * Gets the id. + * + * The unique identifier of the provider type instance. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the type. + * + * The type of the provider type. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the name. + * + * The name of the provider type instance. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the attributes. + * + * The attributes for connecting to the provider type instance. + * + * @return the attributes + */ + public Map getAttributes() { + return attributes; + } + + /** + * Gets the createdAt. + * + * Time at which resource was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the updatedAt. + * + * Time at which resource was updated. + * + * @return the updatedAt + */ + public Date getUpdatedAt() { + return updatedAt; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponse.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponse.java new file mode 100644 index 00000000..c382480a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponse.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Provider type instances response. + */ +public class ProviderTypeInstancesResponse extends GenericModel { + + @SerializedName("provider_type_instances") + protected List providerTypeInstances; + + protected ProviderTypeInstancesResponse() { } + + /** + * Gets the providerTypeInstances. + * + * The array of instances for a provider type. + * + * @return the providerTypeInstances + */ + public List getProviderTypeInstances() { + return providerTypeInstances; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItem.java new file mode 100644 index 00000000..ba23e0c3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItem.java @@ -0,0 +1,194 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; +import java.util.Map; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The provider type item. + */ +public class ProviderTypeItem extends GenericModel { + + protected String id; + protected String type; + protected String name; + protected String description; + @SerializedName("s2s_enabled") + protected Boolean s2sEnabled; + @SerializedName("instance_limit") + protected Long instanceLimit; + protected String mode; + @SerializedName("data_type") + protected String dataType; + protected String icon; + protected LabelType label; + protected Map attributes; + @SerializedName("created_at") + protected Date createdAt; + @SerializedName("updated_at") + protected Date updatedAt; + + protected ProviderTypeItem() { } + + /** + * Gets the id. + * + * The unique identifier of the provider type. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the type. + * + * The type of the provider type. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the name. + * + * The name of the provider type. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the description. + * + * The provider type description. + * + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * Gets the s2sEnabled. + * + * A boolean that indicates whether the provider type is s2s-enabled. + * + * @return the s2sEnabled + */ + public Boolean isS2sEnabled() { + return s2sEnabled; + } + + /** + * Gets the instanceLimit. + * + * The maximum number of instances that can be created for the provider type. + * + * @return the instanceLimit + */ + public Long getInstanceLimit() { + return instanceLimit; + } + + /** + * Gets the mode. + * + * The mode that is used to get results from provider (`PUSH` or `PULL`). + * + * @return the mode + */ + public String getMode() { + return mode; + } + + /** + * Gets the dataType. + * + * The format of the results that a provider supports. + * + * @return the dataType + */ + public String getDataType() { + return dataType; + } + + /** + * Gets the icon. + * + * The icon of a provider in .svg format that is encoded as a base64 string. + * + * @return the icon + */ + public String getIcon() { + return icon; + } + + /** + * Gets the label. + * + * The label that is associated with the provider type. + * + * @return the label + */ + public LabelType getLabel() { + return label; + } + + /** + * Gets the attributes. + * + * The attributes that are required when you're creating an instance of a provider type. The attributes field can have + * multiple keys in its value. Each of those keys has a value object that includes the type, and display name as + * keys. For example, `{type:"", display_name:""}`. + * **NOTE;** If the provider type is s2s-enabled, which means that if the `s2s_enabled` field is set to `true`, then a + * CRN field of type text is required in the attributes value object. + * + * @return the attributes + */ + public Map getAttributes() { + return attributes; + } + + /** + * Gets the createdAt. + * + * Time at which resource was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the updatedAt. + * + * Time at which resource was updated. + * + * @return the updatedAt + */ + public Date getUpdatedAt() { + return updatedAt; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollection.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollection.java new file mode 100644 index 00000000..3b44af58 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollection.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The provider types collection. + */ +public class ProviderTypesCollection extends GenericModel { + + @SerializedName("provider_types") + protected List providerTypes; + + protected ProviderTypesCollection() { } + + /** + * Gets the providerTypes. + * + * The array of provder type. + * + * @return the providerTypes + */ + public List getProviderTypes() { + return providerTypes; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponse.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponse.java new file mode 100644 index 00000000..dfb4bf2f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponse.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Provider types instances response. + */ +public class ProviderTypesInstancesResponse extends GenericModel { + + @SerializedName("provider_types_instances") + protected List providerTypesInstances; + + protected ProviderTypesInstancesResponse() { } + + /** + * Gets the providerTypesInstances. + * + * The array of instances for all provider types. + * + * @return the providerTypesInstances + */ + public List getProviderTypesInstances() { + return providerTypesInstances; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptions.java new file mode 100644 index 00000000..961ae59a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptions.java @@ -0,0 +1,632 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The replaceCustomControlLibrary options. + */ +public class ReplaceCustomControlLibraryOptions extends GenericModel { + + /** + * The control library type. + */ + public interface ControlLibraryType { + /** predefined. */ + String PREDEFINED = "predefined"; + /** custom. */ + String CUSTOM = "custom"; + } + + protected String controlLibrariesId; + protected String id; + protected String accountId; + protected String controlLibraryName; + protected String controlLibraryDescription; + protected String controlLibraryType; + protected String versionGroupLabel; + protected String controlLibraryVersion; + protected Date createdOn; + protected String createdBy; + protected Date updatedOn; + protected String updatedBy; + protected Boolean latest; + protected Boolean hierarchyEnabled; + protected Long controlsCount; + protected Long controlParentsCount; + protected List controls; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String controlLibrariesId; + private String id; + private String accountId; + private String controlLibraryName; + private String controlLibraryDescription; + private String controlLibraryType; + private String versionGroupLabel; + private String controlLibraryVersion; + private Date createdOn; + private String createdBy; + private Date updatedOn; + private String updatedBy; + private Boolean latest; + private Boolean hierarchyEnabled; + private Long controlsCount; + private Long controlParentsCount; + private List controls; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing ReplaceCustomControlLibraryOptions instance. + * + * @param replaceCustomControlLibraryOptions the instance to initialize the Builder with + */ + private Builder(ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions) { + this.controlLibrariesId = replaceCustomControlLibraryOptions.controlLibrariesId; + this.id = replaceCustomControlLibraryOptions.id; + this.accountId = replaceCustomControlLibraryOptions.accountId; + this.controlLibraryName = replaceCustomControlLibraryOptions.controlLibraryName; + this.controlLibraryDescription = replaceCustomControlLibraryOptions.controlLibraryDescription; + this.controlLibraryType = replaceCustomControlLibraryOptions.controlLibraryType; + this.versionGroupLabel = replaceCustomControlLibraryOptions.versionGroupLabel; + this.controlLibraryVersion = replaceCustomControlLibraryOptions.controlLibraryVersion; + this.createdOn = replaceCustomControlLibraryOptions.createdOn; + this.createdBy = replaceCustomControlLibraryOptions.createdBy; + this.updatedOn = replaceCustomControlLibraryOptions.updatedOn; + this.updatedBy = replaceCustomControlLibraryOptions.updatedBy; + this.latest = replaceCustomControlLibraryOptions.latest; + this.hierarchyEnabled = replaceCustomControlLibraryOptions.hierarchyEnabled; + this.controlsCount = replaceCustomControlLibraryOptions.controlsCount; + this.controlParentsCount = replaceCustomControlLibraryOptions.controlParentsCount; + this.controls = replaceCustomControlLibraryOptions.controls; + this.xCorrelationId = replaceCustomControlLibraryOptions.xCorrelationId; + this.xRequestId = replaceCustomControlLibraryOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param controlLibrariesId the controlLibrariesId + */ + public Builder(String controlLibrariesId) { + this.controlLibrariesId = controlLibrariesId; + } + + /** + * Builds a ReplaceCustomControlLibraryOptions. + * + * @return the new ReplaceCustomControlLibraryOptions instance + */ + public ReplaceCustomControlLibraryOptions build() { + return new ReplaceCustomControlLibraryOptions(this); + } + + /** + * Adds an controls to controls. + * + * @param controls the new controls + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder addControls(ControlsInControlLib controls) { + com.ibm.cloud.sdk.core.util.Validator.notNull(controls, + "controls cannot be null"); + if (this.controls == null) { + this.controls = new ArrayList(); + } + this.controls.add(controls); + return this; + } + + /** + * Set the controlLibrariesId. + * + * @param controlLibrariesId the controlLibrariesId + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlLibrariesId(String controlLibrariesId) { + this.controlLibrariesId = controlLibrariesId; + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the accountId. + * + * @param accountId the accountId + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set the controlLibraryName. + * + * @param controlLibraryName the controlLibraryName + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlLibraryName(String controlLibraryName) { + this.controlLibraryName = controlLibraryName; + return this; + } + + /** + * Set the controlLibraryDescription. + * + * @param controlLibraryDescription the controlLibraryDescription + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlLibraryDescription(String controlLibraryDescription) { + this.controlLibraryDescription = controlLibraryDescription; + return this; + } + + /** + * Set the controlLibraryType. + * + * @param controlLibraryType the controlLibraryType + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlLibraryType(String controlLibraryType) { + this.controlLibraryType = controlLibraryType; + return this; + } + + /** + * Set the versionGroupLabel. + * + * @param versionGroupLabel the versionGroupLabel + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder versionGroupLabel(String versionGroupLabel) { + this.versionGroupLabel = versionGroupLabel; + return this; + } + + /** + * Set the controlLibraryVersion. + * + * @param controlLibraryVersion the controlLibraryVersion + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlLibraryVersion(String controlLibraryVersion) { + this.controlLibraryVersion = controlLibraryVersion; + return this; + } + + /** + * Set the createdOn. + * + * @param createdOn the createdOn + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder createdOn(Date createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Set the createdBy. + * + * @param createdBy the createdBy + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Set the updatedOn. + * + * @param updatedOn the updatedOn + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder updatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + /** + * Set the updatedBy. + * + * @param updatedBy the updatedBy + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Set the latest. + * + * @param latest the latest + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder latest(Boolean latest) { + this.latest = latest; + return this; + } + + /** + * Set the hierarchyEnabled. + * + * @param hierarchyEnabled the hierarchyEnabled + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder hierarchyEnabled(Boolean hierarchyEnabled) { + this.hierarchyEnabled = hierarchyEnabled; + return this; + } + + /** + * Set the controlsCount. + * + * @param controlsCount the controlsCount + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlsCount(long controlsCount) { + this.controlsCount = controlsCount; + return this; + } + + /** + * Set the controlParentsCount. + * + * @param controlParentsCount the controlParentsCount + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlParentsCount(long controlParentsCount) { + this.controlParentsCount = controlParentsCount; + return this; + } + + /** + * Set the controls. + * Existing controls will be replaced. + * + * @param controls the controls + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controls(List controls) { + this.controls = controls; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the controlLibrary. + * + * @param controlLibrary the controlLibrary + * @return the ReplaceCustomControlLibraryOptions builder + */ + public Builder controlLibrary(ControlLibrary controlLibrary) { + this.id = controlLibrary.id(); + this.accountId = controlLibrary.accountId(); + this.controlLibraryName = controlLibrary.controlLibraryName(); + this.controlLibraryDescription = controlLibrary.controlLibraryDescription(); + this.controlLibraryType = controlLibrary.controlLibraryType(); + this.versionGroupLabel = controlLibrary.versionGroupLabel(); + this.controlLibraryVersion = controlLibrary.controlLibraryVersion(); + this.createdOn = controlLibrary.createdOn(); + this.createdBy = controlLibrary.createdBy(); + this.updatedOn = controlLibrary.updatedOn(); + this.updatedBy = controlLibrary.updatedBy(); + this.latest = controlLibrary.latest(); + this.hierarchyEnabled = controlLibrary.hierarchyEnabled(); + this.controlsCount = controlLibrary.controlsCount(); + this.controlParentsCount = controlLibrary.controlParentsCount(); + this.controls = controlLibrary.controls(); + return this; + } + } + + protected ReplaceCustomControlLibraryOptions() { } + + protected ReplaceCustomControlLibraryOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.controlLibrariesId, + "controlLibrariesId cannot be empty"); + controlLibrariesId = builder.controlLibrariesId; + id = builder.id; + accountId = builder.accountId; + controlLibraryName = builder.controlLibraryName; + controlLibraryDescription = builder.controlLibraryDescription; + controlLibraryType = builder.controlLibraryType; + versionGroupLabel = builder.versionGroupLabel; + controlLibraryVersion = builder.controlLibraryVersion; + createdOn = builder.createdOn; + createdBy = builder.createdBy; + updatedOn = builder.updatedOn; + updatedBy = builder.updatedBy; + latest = builder.latest; + hierarchyEnabled = builder.hierarchyEnabled; + controlsCount = builder.controlsCount; + controlParentsCount = builder.controlParentsCount; + controls = builder.controls; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a ReplaceCustomControlLibraryOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the controlLibrariesId. + * + * The control library ID. + * + * @return the controlLibrariesId + */ + public String controlLibrariesId() { + return controlLibrariesId; + } + + /** + * Gets the id. + * + * The control library ID. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the accountId. + * + * The account ID. + * + * @return the accountId + */ + public String accountId() { + return accountId; + } + + /** + * Gets the controlLibraryName. + * + * The control library name. + * + * @return the controlLibraryName + */ + public String controlLibraryName() { + return controlLibraryName; + } + + /** + * Gets the controlLibraryDescription. + * + * The control library description. + * + * @return the controlLibraryDescription + */ + public String controlLibraryDescription() { + return controlLibraryDescription; + } + + /** + * Gets the controlLibraryType. + * + * The control library type. + * + * @return the controlLibraryType + */ + public String controlLibraryType() { + return controlLibraryType; + } + + /** + * Gets the versionGroupLabel. + * + * The version group label. + * + * @return the versionGroupLabel + */ + public String versionGroupLabel() { + return versionGroupLabel; + } + + /** + * Gets the controlLibraryVersion. + * + * The control library version. + * + * @return the controlLibraryVersion + */ + public String controlLibraryVersion() { + return controlLibraryVersion; + } + + /** + * Gets the createdOn. + * + * The date when the control library was created. + * + * @return the createdOn + */ + public Date createdOn() { + return createdOn; + } + + /** + * Gets the createdBy. + * + * The user who created the control library. + * + * @return the createdBy + */ + public String createdBy() { + return createdBy; + } + + /** + * Gets the updatedOn. + * + * The date when the control library was updated. + * + * @return the updatedOn + */ + public Date updatedOn() { + return updatedOn; + } + + /** + * Gets the updatedBy. + * + * The user who updated the control library. + * + * @return the updatedBy + */ + public String updatedBy() { + return updatedBy; + } + + /** + * Gets the latest. + * + * The latest version of the control library. + * + * @return the latest + */ + public Boolean latest() { + return latest; + } + + /** + * Gets the hierarchyEnabled. + * + * The indication of whether hierarchy is enabled for the control library. + * + * @return the hierarchyEnabled + */ + public Boolean hierarchyEnabled() { + return hierarchyEnabled; + } + + /** + * Gets the controlsCount. + * + * The number of controls. + * + * @return the controlsCount + */ + public Long controlsCount() { + return controlsCount; + } + + /** + * Gets the controlParentsCount. + * + * The number of parent controls in the control library. + * + * @return the controlParentsCount + */ + public Long controlParentsCount() { + return controlParentsCount; + } + + /** + * Gets the controls. + * + * The list of controls in a control library. + * + * @return the controls + */ + public List controls() { + return controls; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java new file mode 100644 index 00000000..5f4f9659 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java @@ -0,0 +1,718 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The replaceProfileAttachment options. + */ +public class ReplaceProfileAttachmentOptions extends GenericModel { + + /** + * The status of an attachment evaluation. + */ + public interface Status { + /** enabled. */ + String ENABLED = "enabled"; + /** disabled. */ + String DISABLED = "disabled"; + } + + /** + * The schedule of an attachment evaluation. + */ + public interface Schedule { + /** daily. */ + String DAILY = "daily"; + /** every_7_days. */ + String EVERY_7_DAYS = "every_7_days"; + /** every_30_days. */ + String EVERY_30_DAYS = "every_30_days"; + } + + protected String attachmentId; + protected String profilesId; + protected String id; + protected String profileId; + protected String accountId; + protected String instanceId; + protected List scope; + protected Date createdOn; + protected String createdBy; + protected Date updatedOn; + protected String updatedBy; + protected String status; + protected String schedule; + protected AttachmentsNotificationsPrototype notifications; + protected List attachmentParameters; + protected LastScan lastScan; + protected Date nextScanTime; + protected String name; + protected String description; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String attachmentId; + private String profilesId; + private String id; + private String profileId; + private String accountId; + private String instanceId; + private List scope; + private Date createdOn; + private String createdBy; + private Date updatedOn; + private String updatedBy; + private String status; + private String schedule; + private AttachmentsNotificationsPrototype notifications; + private List attachmentParameters; + private LastScan lastScan; + private Date nextScanTime; + private String name; + private String description; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing ReplaceProfileAttachmentOptions instance. + * + * @param replaceProfileAttachmentOptions the instance to initialize the Builder with + */ + private Builder(ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions) { + this.attachmentId = replaceProfileAttachmentOptions.attachmentId; + this.profilesId = replaceProfileAttachmentOptions.profilesId; + this.id = replaceProfileAttachmentOptions.id; + this.profileId = replaceProfileAttachmentOptions.profileId; + this.accountId = replaceProfileAttachmentOptions.accountId; + this.instanceId = replaceProfileAttachmentOptions.instanceId; + this.scope = replaceProfileAttachmentOptions.scope; + this.createdOn = replaceProfileAttachmentOptions.createdOn; + this.createdBy = replaceProfileAttachmentOptions.createdBy; + this.updatedOn = replaceProfileAttachmentOptions.updatedOn; + this.updatedBy = replaceProfileAttachmentOptions.updatedBy; + this.status = replaceProfileAttachmentOptions.status; + this.schedule = replaceProfileAttachmentOptions.schedule; + this.notifications = replaceProfileAttachmentOptions.notifications; + this.attachmentParameters = replaceProfileAttachmentOptions.attachmentParameters; + this.lastScan = replaceProfileAttachmentOptions.lastScan; + this.nextScanTime = replaceProfileAttachmentOptions.nextScanTime; + this.name = replaceProfileAttachmentOptions.name; + this.description = replaceProfileAttachmentOptions.description; + this.xCorrelationId = replaceProfileAttachmentOptions.xCorrelationId; + this.xRequestId = replaceProfileAttachmentOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param attachmentId the attachmentId + * @param profilesId the profilesId + */ + public Builder(String attachmentId, String profilesId) { + this.attachmentId = attachmentId; + this.profilesId = profilesId; + } + + /** + * Builds a ReplaceProfileAttachmentOptions. + * + * @return the new ReplaceProfileAttachmentOptions instance + */ + public ReplaceProfileAttachmentOptions build() { + return new ReplaceProfileAttachmentOptions(this); + } + + /** + * Adds an scope to scope. + * + * @param scope the new scope + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder addScope(MultiCloudScope scope) { + com.ibm.cloud.sdk.core.util.Validator.notNull(scope, + "scope cannot be null"); + if (this.scope == null) { + this.scope = new ArrayList(); + } + this.scope.add(scope); + return this; + } + + /** + * Adds an attachmentParameters to attachmentParameters. + * + * @param attachmentParameters the new attachmentParameters + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder addAttachmentParameters(AttachmentParameterPrototype attachmentParameters) { + com.ibm.cloud.sdk.core.util.Validator.notNull(attachmentParameters, + "attachmentParameters cannot be null"); + if (this.attachmentParameters == null) { + this.attachmentParameters = new ArrayList(); + } + this.attachmentParameters.add(attachmentParameters); + return this; + } + + /** + * Set the attachmentId. + * + * @param attachmentId the attachmentId + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder attachmentId(String attachmentId) { + this.attachmentId = attachmentId; + return this; + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the profileId. + * + * @param profileId the profileId + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder profileId(String profileId) { + this.profileId = profileId; + return this; + } + + /** + * Set the accountId. + * + * @param accountId the accountId + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set the instanceId. + * + * @param instanceId the instanceId + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder instanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Set the scope. + * Existing scope will be replaced. + * + * @param scope the scope + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder scope(List scope) { + this.scope = scope; + return this; + } + + /** + * Set the createdOn. + * + * @param createdOn the createdOn + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder createdOn(Date createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Set the createdBy. + * + * @param createdBy the createdBy + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Set the updatedOn. + * + * @param updatedOn the updatedOn + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder updatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + /** + * Set the updatedBy. + * + * @param updatedBy the updatedBy + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + /** + * Set the status. + * + * @param status the status + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder status(String status) { + this.status = status; + return this; + } + + /** + * Set the schedule. + * + * @param schedule the schedule + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder schedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Set the notifications. + * + * @param notifications the notifications + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder notifications(AttachmentsNotificationsPrototype notifications) { + this.notifications = notifications; + return this; + } + + /** + * Set the attachmentParameters. + * Existing attachmentParameters will be replaced. + * + * @param attachmentParameters the attachmentParameters + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder attachmentParameters(List attachmentParameters) { + this.attachmentParameters = attachmentParameters; + return this; + } + + /** + * Set the lastScan. + * + * @param lastScan the lastScan + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder lastScan(LastScan lastScan) { + this.lastScan = lastScan; + return this; + } + + /** + * Set the nextScanTime. + * + * @param nextScanTime the nextScanTime + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder nextScanTime(Date nextScanTime) { + this.nextScanTime = nextScanTime; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the attachmentItem. + * + * @param attachmentItem the attachmentItem + * @return the ReplaceProfileAttachmentOptions builder + */ + public Builder attachmentItem(AttachmentItem attachmentItem) { + this.id = attachmentItem.id(); + this.profileId = attachmentItem.profileId(); + this.accountId = attachmentItem.accountId(); + this.instanceId = attachmentItem.instanceId(); + this.scope = attachmentItem.scope(); + this.createdOn = attachmentItem.createdOn(); + this.createdBy = attachmentItem.createdBy(); + this.updatedOn = attachmentItem.updatedOn(); + this.updatedBy = attachmentItem.updatedBy(); + this.status = attachmentItem.status(); + this.schedule = attachmentItem.schedule(); + this.notifications = attachmentItem.notifications(); + this.attachmentParameters = attachmentItem.attachmentParameters(); + this.lastScan = attachmentItem.lastScan(); + this.nextScanTime = attachmentItem.nextScanTime(); + this.name = attachmentItem.name(); + this.description = attachmentItem.description(); + return this; + } + } + + protected ReplaceProfileAttachmentOptions() { } + + protected ReplaceProfileAttachmentOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, + "attachmentId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + attachmentId = builder.attachmentId; + profilesId = builder.profilesId; + id = builder.id; + profileId = builder.profileId; + accountId = builder.accountId; + instanceId = builder.instanceId; + scope = builder.scope; + createdOn = builder.createdOn; + createdBy = builder.createdBy; + updatedOn = builder.updatedOn; + updatedBy = builder.updatedBy; + status = builder.status; + schedule = builder.schedule; + notifications = builder.notifications; + attachmentParameters = builder.attachmentParameters; + lastScan = builder.lastScan; + nextScanTime = builder.nextScanTime; + name = builder.name; + description = builder.description; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a ReplaceProfileAttachmentOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the attachmentId. + * + * The attachment ID. + * + * @return the attachmentId + */ + public String attachmentId() { + return attachmentId; + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the id. + * + * The ID of the attachment. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the profileId. + * + * The ID of the profile that is specified in the attachment. + * + * @return the profileId + */ + public String profileId() { + return profileId; + } + + /** + * Gets the accountId. + * + * The account ID that is associated to the attachment. + * + * @return the accountId + */ + public String accountId() { + return accountId; + } + + /** + * Gets the instanceId. + * + * The instance ID of the account that is associated to the attachment. + * + * @return the instanceId + */ + public String instanceId() { + return instanceId; + } + + /** + * Gets the scope. + * + * The scope payload for the multi cloud feature. + * + * @return the scope + */ + public List scope() { + return scope; + } + + /** + * Gets the createdOn. + * + * The date when the attachment was created. + * + * @return the createdOn + */ + public Date createdOn() { + return createdOn; + } + + /** + * Gets the createdBy. + * + * The user who created the attachment. + * + * @return the createdBy + */ + public String createdBy() { + return createdBy; + } + + /** + * Gets the updatedOn. + * + * The date when the attachment was updated. + * + * @return the updatedOn + */ + public Date updatedOn() { + return updatedOn; + } + + /** + * Gets the updatedBy. + * + * The user who updated the attachment. + * + * @return the updatedBy + */ + public String updatedBy() { + return updatedBy; + } + + /** + * Gets the status. + * + * The status of an attachment evaluation. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the schedule. + * + * The schedule of an attachment evaluation. + * + * @return the schedule + */ + public String schedule() { + return schedule; + } + + /** + * Gets the notifications. + * + * The request payload of the attachment notifications. + * + * @return the notifications + */ + public AttachmentsNotificationsPrototype notifications() { + return notifications; + } + + /** + * Gets the attachmentParameters. + * + * The profile parameters for the attachment. + * + * @return the attachmentParameters + */ + public List attachmentParameters() { + return attachmentParameters; + } + + /** + * Gets the lastScan. + * + * The details of the last scan of an attachment. + * + * @return the lastScan + */ + public LastScan lastScan() { + return lastScan; + } + + /** + * Gets the nextScanTime. + * + * The start time of the next scan. + * + * @return the nextScanTime + */ + public Date nextScanTime() { + return nextScanTime; + } + + /** + * Gets the name. + * + * The name of the attachment. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + * The description for the attachment. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java new file mode 100644 index 00000000..678a66f9 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java @@ -0,0 +1,356 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The replaceProfile options. + */ +public class ReplaceProfileOptions extends GenericModel { + + /** + * The profile type. + */ + public interface ProfileType { + /** predefined. */ + String PREDEFINED = "predefined"; + /** custom. */ + String CUSTOM = "custom"; + } + + protected String profilesId; + protected String profileName; + protected String profileDescription; + protected String profileType; + protected List controls; + protected List defaultParameters; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String profilesId; + private String profileName; + private String profileDescription; + private String profileType; + private List controls; + private List defaultParameters; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing ReplaceProfileOptions instance. + * + * @param replaceProfileOptions the instance to initialize the Builder with + */ + private Builder(ReplaceProfileOptions replaceProfileOptions) { + this.profilesId = replaceProfileOptions.profilesId; + this.profileName = replaceProfileOptions.profileName; + this.profileDescription = replaceProfileOptions.profileDescription; + this.profileType = replaceProfileOptions.profileType; + this.controls = replaceProfileOptions.controls; + this.defaultParameters = replaceProfileOptions.defaultParameters; + this.xCorrelationId = replaceProfileOptions.xCorrelationId; + this.xRequestId = replaceProfileOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param profilesId the profilesId + * @param profileName the profileName + * @param profileDescription the profileDescription + * @param profileType the profileType + * @param controls the controls + * @param defaultParameters the defaultParameters + */ + public Builder(String profilesId, String profileName, String profileDescription, String profileType, List controls, List defaultParameters) { + this.profilesId = profilesId; + this.profileName = profileName; + this.profileDescription = profileDescription; + this.profileType = profileType; + this.controls = controls; + this.defaultParameters = defaultParameters; + } + + /** + * Builds a ReplaceProfileOptions. + * + * @return the new ReplaceProfileOptions instance + */ + public ReplaceProfileOptions build() { + return new ReplaceProfileOptions(this); + } + + /** + * Adds an controls to controls. + * + * @param controls the new controls + * @return the ReplaceProfileOptions builder + */ + public Builder addControls(ProfileControlsPrototype controls) { + com.ibm.cloud.sdk.core.util.Validator.notNull(controls, + "controls cannot be null"); + if (this.controls == null) { + this.controls = new ArrayList(); + } + this.controls.add(controls); + return this; + } + + /** + * Adds an defaultParameters to defaultParameters. + * + * @param defaultParameters the new defaultParameters + * @return the ReplaceProfileOptions builder + */ + public Builder addDefaultParameters(DefaultParametersPrototype defaultParameters) { + com.ibm.cloud.sdk.core.util.Validator.notNull(defaultParameters, + "defaultParameters cannot be null"); + if (this.defaultParameters == null) { + this.defaultParameters = new ArrayList(); + } + this.defaultParameters.add(defaultParameters); + return this; + } + + /** + * Set the profilesId. + * + * @param profilesId the profilesId + * @return the ReplaceProfileOptions builder + */ + public Builder profilesId(String profilesId) { + this.profilesId = profilesId; + return this; + } + + /** + * Set the profileName. + * + * @param profileName the profileName + * @return the ReplaceProfileOptions builder + */ + public Builder profileName(String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Set the profileDescription. + * + * @param profileDescription the profileDescription + * @return the ReplaceProfileOptions builder + */ + public Builder profileDescription(String profileDescription) { + this.profileDescription = profileDescription; + return this; + } + + /** + * Set the profileType. + * + * @param profileType the profileType + * @return the ReplaceProfileOptions builder + */ + public Builder profileType(String profileType) { + this.profileType = profileType; + return this; + } + + /** + * Set the controls. + * Existing controls will be replaced. + * + * @param controls the controls + * @return the ReplaceProfileOptions builder + */ + public Builder controls(List controls) { + this.controls = controls; + return this; + } + + /** + * Set the defaultParameters. + * Existing defaultParameters will be replaced. + * + * @param defaultParameters the defaultParameters + * @return the ReplaceProfileOptions builder + */ + public Builder defaultParameters(List defaultParameters) { + this.defaultParameters = defaultParameters; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ReplaceProfileOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ReplaceProfileOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected ReplaceProfileOptions() { } + + protected ReplaceProfileOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, + "profilesId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileName, + "profileName cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileDescription, + "profileDescription cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileType, + "profileType cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.controls, + "controls cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.defaultParameters, + "defaultParameters cannot be null"); + profilesId = builder.profilesId; + profileName = builder.profileName; + profileDescription = builder.profileDescription; + profileType = builder.profileType; + controls = builder.controls; + defaultParameters = builder.defaultParameters; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a ReplaceProfileOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the profilesId. + * + * The profile ID. + * + * @return the profilesId + */ + public String profilesId() { + return profilesId; + } + + /** + * Gets the profileName. + * + * The name of the profile. + * + * @return the profileName + */ + public String profileName() { + return profileName; + } + + /** + * Gets the profileDescription. + * + * The description of the profile. + * + * @return the profileDescription + */ + public String profileDescription() { + return profileDescription; + } + + /** + * Gets the profileType. + * + * The profile type. + * + * @return the profileType + */ + public String profileType() { + return profileType; + } + + /** + * Gets the controls. + * + * The controls that are in the profile. + * + * @return the controls + */ + public List controls() { + return controls; + } + + /** + * Gets the defaultParameters. + * + * The default parameters of the profile. + * + * @return the defaultParameters + */ + public List defaultParameters() { + return defaultParameters; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java new file mode 100644 index 00000000..b67745db --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java @@ -0,0 +1,417 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The replaceRule options. + */ +public class ReplaceRuleOptions extends GenericModel { + + /** + * The rule type (user_defined or system_defined). + */ + public interface Type { + /** user_defined. */ + String USER_DEFINED = "user_defined"; + /** system_defined. */ + String SYSTEM_DEFINED = "system_defined"; + } + + protected String ruleId; + protected String ifMatch; + protected String description; + protected Target target; + protected RequiredConfig requiredConfig; + protected String type; + protected String version; + protected Import xImport; + protected List labels; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String ruleId; + private String ifMatch; + private String description; + private Target target; + private RequiredConfig requiredConfig; + private String type; + private String version; + private Import xImport; + private List labels; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing ReplaceRuleOptions instance. + * + * @param replaceRuleOptions the instance to initialize the Builder with + */ + private Builder(ReplaceRuleOptions replaceRuleOptions) { + this.ruleId = replaceRuleOptions.ruleId; + this.ifMatch = replaceRuleOptions.ifMatch; + this.description = replaceRuleOptions.description; + this.target = replaceRuleOptions.target; + this.requiredConfig = replaceRuleOptions.requiredConfig; + this.type = replaceRuleOptions.type; + this.version = replaceRuleOptions.version; + this.xImport = replaceRuleOptions.xImport; + this.labels = replaceRuleOptions.labels; + this.xCorrelationId = replaceRuleOptions.xCorrelationId; + this.xRequestId = replaceRuleOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param ruleId the ruleId + * @param ifMatch the ifMatch + * @param description the description + * @param target the target + * @param requiredConfig the requiredConfig + */ + public Builder(String ruleId, String ifMatch, String description, Target target, RequiredConfig requiredConfig) { + this.ruleId = ruleId; + this.ifMatch = ifMatch; + this.description = description; + this.target = target; + this.requiredConfig = requiredConfig; + } + + /** + * Builds a ReplaceRuleOptions. + * + * @return the new ReplaceRuleOptions instance + */ + public ReplaceRuleOptions build() { + return new ReplaceRuleOptions(this); + } + + /** + * Adds an labels to labels. + * + * @param labels the new labels + * @return the ReplaceRuleOptions builder + */ + public Builder addLabels(String labels) { + com.ibm.cloud.sdk.core.util.Validator.notNull(labels, + "labels cannot be null"); + if (this.labels == null) { + this.labels = new ArrayList(); + } + this.labels.add(labels); + return this; + } + + /** + * Set the ruleId. + * + * @param ruleId the ruleId + * @return the ReplaceRuleOptions builder + */ + public Builder ruleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the ReplaceRuleOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the ReplaceRuleOptions builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the target. + * + * @param target the target + * @return the ReplaceRuleOptions builder + */ + public Builder target(Target target) { + this.target = target; + return this; + } + + /** + * Set the requiredConfig. + * + * @param requiredConfig the requiredConfig + * @return the ReplaceRuleOptions builder + */ + public Builder requiredConfig(RequiredConfig requiredConfig) { + this.requiredConfig = requiredConfig; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the ReplaceRuleOptions builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the version. + * + * @param version the version + * @return the ReplaceRuleOptions builder + */ + public Builder version(String version) { + this.version = version; + return this; + } + + /** + * Set the xImport. + * + * @param xImport the xImport + * @return the ReplaceRuleOptions builder + */ + public Builder xImport(Import xImport) { + this.xImport = xImport; + return this; + } + + /** + * Set the labels. + * Existing labels will be replaced. + * + * @param labels the labels + * @return the ReplaceRuleOptions builder + */ + public Builder labels(List labels) { + this.labels = labels; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the ReplaceRuleOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the ReplaceRuleOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected ReplaceRuleOptions() { } + + protected ReplaceRuleOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.ruleId, + "ruleId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.ifMatch, + "ifMatch cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.description, + "description cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, + "target cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.requiredConfig, + "requiredConfig cannot be null"); + ruleId = builder.ruleId; + ifMatch = builder.ifMatch; + description = builder.description; + target = builder.target; + requiredConfig = builder.requiredConfig; + type = builder.type; + version = builder.version; + xImport = builder.xImport; + labels = builder.labels; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a ReplaceRuleOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the ruleId. + * + * The ID of the corresponding rule. + * + * @return the ruleId + */ + public String ruleId() { + return ruleId; + } + + /** + * Gets the ifMatch. + * + * This field compares a supplied `Etag` value with the version that is stored for the requested resource. If the + * values match, the server allows the request method to continue. + * + * To find the `Etag` value, run a GET request on the resource that you want to modify, and check the response + * headers. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } + + /** + * Gets the description. + * + * The rule description. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the target. + * + * The rule target. + * + * @return the target + */ + public Target target() { + return target; + } + + /** + * Gets the requiredConfig. + * + * The required configurations. + * + * @return the requiredConfig + */ + public RequiredConfig requiredConfig() { + return requiredConfig; + } + + /** + * Gets the type. + * + * The rule type (user_defined or system_defined). + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the version. + * + * The rule version number. + * + * @return the version + */ + public String version() { + return version; + } + + /** + * Gets the xImport. + * + * The collection of import parameters. + * + * @return the xImport + */ + public Import xImport() { + return xImport; + } + + /** + * Gets the labels. + * + * The list of labels that correspond to a rule. + * + * @return the labels + */ + public List labels() { + return labels; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Report.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Report.java new file mode 100644 index 00000000..b9615fd6 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Report.java @@ -0,0 +1,151 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The report. + */ +public class Report extends GenericModel { + + protected String id; + @SerializedName("group_id") + protected String groupId; + @SerializedName("created_on") + protected String createdOn; + @SerializedName("scan_time") + protected String scanTime; + protected String type; + @SerializedName("cos_object") + protected String cosObject; + @SerializedName("instance_id") + protected String instanceId; + protected Account account; + protected ProfileInfo profile; + protected Attachment attachment; + + protected Report() { } + + /** + * Gets the id. + * + * The ID of the report. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the groupId. + * + * The group ID that is associated with the report. The group ID combines profile, scope, and attachment IDs. + * + * @return the groupId + */ + public String getGroupId() { + return groupId; + } + + /** + * Gets the createdOn. + * + * The date when the report was created. + * + * @return the createdOn + */ + public String getCreatedOn() { + return createdOn; + } + + /** + * Gets the scanTime. + * + * The date when the scan was run. + * + * @return the scanTime + */ + public String getScanTime() { + return scanTime; + } + + /** + * Gets the type. + * + * The type of the scan. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the cosObject. + * + * The Cloud Object Storage object that is associated with the report. + * + * @return the cosObject + */ + public String getCosObject() { + return cosObject; + } + + /** + * Gets the instanceId. + * + * Instance ID. + * + * @return the instanceId + */ + public String getInstanceId() { + return instanceId; + } + + /** + * Gets the account. + * + * The account that is associated with a report. + * + * @return the account + */ + public Account getAccount() { + return account; + } + + /** + * Gets the profile. + * + * The profile information. + * + * @return the profile + */ + public ProfileInfo getProfile() { + return profile; + } + + /** + * Gets the attachment. + * + * The attachment that is associated with a report. + * + * @return the attachment + */ + public Attachment getAttachment() { + return attachment; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControls.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControls.java new file mode 100644 index 00000000..c30e286b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControls.java @@ -0,0 +1,157 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The list of controls. + */ +public class ReportControls extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("compliant_count") + protected Long compliantCount; + @SerializedName("not_compliant_count") + protected Long notCompliantCount; + @SerializedName("unable_to_perform_count") + protected Long unableToPerformCount; + @SerializedName("user_evaluation_required_count") + protected Long userEvaluationRequiredCount; + @SerializedName("home_account_id") + protected String homeAccountId; + @SerializedName("report_id") + protected String reportId; + protected List controls; + + protected ReportControls() { } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of checks. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the compliantCount. + * + * The number of compliant checks. + * + * @return the compliantCount + */ + public Long getCompliantCount() { + return compliantCount; + } + + /** + * Gets the notCompliantCount. + * + * The number of checks that are not compliant. + * + * @return the notCompliantCount + */ + public Long getNotCompliantCount() { + return notCompliantCount; + } + + /** + * Gets the unableToPerformCount. + * + * The number of checks that are unable to perform. + * + * @return the unableToPerformCount + */ + public Long getUnableToPerformCount() { + return unableToPerformCount; + } + + /** + * Gets the userEvaluationRequiredCount. + * + * The number of checks that require a user evaluation. + * + * @return the userEvaluationRequiredCount + */ + public Long getUserEvaluationRequiredCount() { + return userEvaluationRequiredCount; + } + + /** + * Gets the homeAccountId. + * + * The ID of the home account. + * + * @return the homeAccountId + */ + public String getHomeAccountId() { + return homeAccountId; + } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the controls. + * + * The list of controls that are in the report. + * + * @return the controls + */ + public List getControls() { + return controls; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportEvaluationsPager.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportEvaluationsPager.java new file mode 100644 index 00000000..50ddfa44 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportEvaluationsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.util.UrlHelper; +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ReportEvaluationsPager can be used to simplify the use of the "listReportEvaluations" method. + */ +public class ReportEvaluationsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListReportEvaluationsOptions options; + protected SecurityAndComplianceCenterApi client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ReportEvaluationsPager() { } + + /** + * Constructs a new ReportEvaluationsPager instance with the specified client and options model instance. + * @param client the SecurityAndComplianceCenterApi instance to be used to invoke the "listReportEvaluations" method + * @param options the ListReportEvaluationsOptions instance to be used to invoke the "listReportEvaluations" method + */ + public ReportEvaluationsPager(SecurityAndComplianceCenterApi client, ListReportEvaluationsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Evaluation> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListReportEvaluationsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + EvaluationPage result = client.listReportEvaluations(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getEvaluations(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Evaluation> containing all results returned by the "listReportEvaluations" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatest.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatest.java new file mode 100644 index 00000000..f7a07500 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatest.java @@ -0,0 +1,91 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body of the `get_latest_reports` operation. + */ +public class ReportLatest extends GenericModel { + + @SerializedName("home_account_id") + protected String homeAccountId; + @SerializedName("controls_summary") + protected ComplianceStats controlsSummary; + @SerializedName("evaluations_summary") + protected EvalStats evaluationsSummary; + protected ComplianceScore score; + protected List reports; + + protected ReportLatest() { } + + /** + * Gets the homeAccountId. + * + * The ID of the home account. + * + * @return the homeAccountId + */ + public String getHomeAccountId() { + return homeAccountId; + } + + /** + * Gets the controlsSummary. + * + * The compliance stats. + * + * @return the controlsSummary + */ + public ComplianceStats getControlsSummary() { + return controlsSummary; + } + + /** + * Gets the evaluationsSummary. + * + * The evaluation stats. + * + * @return the evaluationsSummary + */ + public EvalStats getEvaluationsSummary() { + return evaluationsSummary; + } + + /** + * Gets the score. + * + * The compliance score. + * + * @return the score + */ + public ComplianceScore getScore() { + return score; + } + + /** + * Gets the reports. + * + * The list of reports. + * + * @return the reports + */ + public List getReports() { + return reports; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPage.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPage.java new file mode 100644 index 00000000..3892c9bf --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPage.java @@ -0,0 +1,114 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The page of reports. + */ +public class ReportPage extends GenericModel { + + @SerializedName("total_count") + protected Long totalCount; + protected Long limit; + protected String start; + protected PageHRef first; + protected PageHRef next; + @SerializedName("home_account_id") + protected String homeAccountId; + protected List reports; + + protected ReportPage() { } + + /** + * Gets the totalCount. + * + * The total number of resources that are in the collection. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the limit. + * + * The requested page limi.t. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the start. + * + * The token of the next page, when it's present. + * + * @return the start + */ + public String getStart() { + return start; + } + + /** + * Gets the first. + * + * The page reference. + * + * @return the first + */ + public PageHRef getFirst() { + return first; + } + + /** + * Gets the next. + * + * The page reference. + * + * @return the next + */ + public PageHRef getNext() { + return next; + } + + /** + * Gets the homeAccountId. + * + * The ID of the home account. + * + * @return the homeAccountId + */ + public String getHomeAccountId() { + return homeAccountId; + } + + /** + * Gets the reports. + * + * The list of reports that are on the page. + * + * @return the reports + */ + public List getReports() { + return reports; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportResourcesPager.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportResourcesPager.java new file mode 100644 index 00000000..a9a95128 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportResourcesPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.util.UrlHelper; +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ReportResourcesPager can be used to simplify the use of the "listReportResources" method. + */ +public class ReportResourcesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListReportResourcesOptions options; + protected SecurityAndComplianceCenterApi client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ReportResourcesPager() { } + + /** + * Constructs a new ReportResourcesPager instance with the specified client and options model instance. + * @param client the SecurityAndComplianceCenterApi instance to be used to invoke the "listReportResources" method + * @param options the ListReportResourcesOptions instance to be used to invoke the "listReportResources" method + */ + public ReportResourcesPager(SecurityAndComplianceCenterApi client, ListReportResourcesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Resource> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListReportResourcesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ResourcePage result = client.listReportResources(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getResources(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Resource> containing all results returned by the "listReportResources" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummary.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummary.java new file mode 100644 index 00000000..75aa8af3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummary.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The report summary. + */ +public class ReportSummary extends GenericModel { + + @SerializedName("report_id") + protected String reportId; + @SerializedName("isntance_id") + protected String isntanceId; + protected Account account; + protected ComplianceScore score; + protected ComplianceStats controls; + protected EvalStats evaluations; + protected ResourceSummary resources; + + protected ReportSummary() { } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the isntanceId. + * + * Instance ID. + * + * @return the isntanceId + */ + public String getIsntanceId() { + return isntanceId; + } + + /** + * Gets the account. + * + * The account that is associated with a report. + * + * @return the account + */ + public Account getAccount() { + return account; + } + + /** + * Gets the score. + * + * The compliance score. + * + * @return the score + */ + public ComplianceScore getScore() { + return score; + } + + /** + * Gets the controls. + * + * The compliance stats. + * + * @return the controls + */ + public ComplianceStats getControls() { + return controls; + } + + /** + * Gets the evaluations. + * + * The evaluation stats. + * + * @return the evaluations + */ + public EvalStats getEvaluations() { + return evaluations; + } + + /** + * Gets the resources. + * + * The resource summary. + * + * @return the resources + */ + public ResourceSummary getResources() { + return resources; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTags.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTags.java new file mode 100644 index 00000000..780a6c39 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTags.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body of the `get_tags` operation. + */ +public class ReportTags extends GenericModel { + + @SerializedName("report_id") + protected String reportId; + protected Tags tags; + + protected ReportTags() { } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the tags. + * + * The collection of different types of tags. + * + * @return the tags + */ + public Tags getTags() { + return tags; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPoint.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPoint.java new file mode 100644 index 00000000..ca86db49 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPoint.java @@ -0,0 +1,77 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The report violation data point. + */ +public class ReportViolationDataPoint extends GenericModel { + + @SerializedName("report_id") + protected String reportId; + @SerializedName("report_group_id") + protected String reportGroupId; + @SerializedName("scan_time") + protected String scanTime; + protected ComplianceStats controls; + + protected ReportViolationDataPoint() { } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the reportGroupId. + * + * The group ID that is associated with the report. The group ID combines profile, scope, and attachment IDs. + * + * @return the reportGroupId + */ + public String getReportGroupId() { + return reportGroupId; + } + + /** + * Gets the scanTime. + * + * The date when the scan was run. + * + * @return the scanTime + */ + public String getScanTime() { + return scanTime; + } + + /** + * Gets the controls. + * + * The compliance stats. + * + * @return the controls + */ + public ComplianceStats getControls() { + return controls; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDrift.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDrift.java new file mode 100644 index 00000000..821d1556 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDrift.java @@ -0,0 +1,67 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response body of the `get_report_violations_drift` operation. + */ +public class ReportViolationsDrift extends GenericModel { + + @SerializedName("home_account_id") + protected String homeAccountId; + @SerializedName("report_id") + protected String reportId; + @SerializedName("data_points") + protected List dataPoints; + + protected ReportViolationsDrift() { } + + /** + * Gets the homeAccountId. + * + * The ID of the home account. + * + * @return the homeAccountId + */ + public String getHomeAccountId() { + return homeAccountId; + } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the dataPoints. + * + * The list of report violations data points. + * + * @return the dataPoints + */ + public List getDataPoints() { + return dataPoints; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportsPager.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportsPager.java new file mode 100644 index 00000000..bfa73575 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportsPager.java @@ -0,0 +1,111 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.util.UrlHelper; +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ReportsPager can be used to simplify the use of the "listReports" method. + */ +public class ReportsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListReportsOptions options; + protected SecurityAndComplianceCenterApi client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ReportsPager() { } + + /** + * Constructs a new ReportsPager instance with the specified client and options model instance. + * @param client the SecurityAndComplianceCenterApi instance to be used to invoke the "listReports" method + * @param options the ListReportsOptions instance to be used to invoke the "listReports" method + */ + public ReportsPager(SecurityAndComplianceCenterApi client, ListReportsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<Report> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListReportsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ReportPage result = client.listReports(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getReports(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<Report> containing all results returned by the "listReports" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java new file mode 100644 index 00000000..8c45af75 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The required configurations. + * + * Classes which extend this class: + * - RequiredConfigRequiredConfigAnd + * - RequiredConfigRequiredConfigOr + * - RequiredConfigRequiredConfigBase + */ +public class RequiredConfig extends GenericModel { + + /** + * The operator. + */ + public interface Operator { + /** string_equals. */ + String STRING_EQUALS = "string_equals"; + /** string_not_equals. */ + String STRING_NOT_EQUALS = "string_not_equals"; + /** string_match. */ + String STRING_MATCH = "string_match"; + /** string_not_match. */ + String STRING_NOT_MATCH = "string_not_match"; + /** string_contains. */ + String STRING_CONTAINS = "string_contains"; + /** string_not_contains. */ + String STRING_NOT_CONTAINS = "string_not_contains"; + /** num_equals. */ + String NUM_EQUALS = "num_equals"; + /** num_not_equals. */ + String NUM_NOT_EQUALS = "num_not_equals"; + /** num_less_than. */ + String NUM_LESS_THAN = "num_less_than"; + /** num_less_than_equals. */ + String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; + /** num_greater_than. */ + String NUM_GREATER_THAN = "num_greater_than"; + /** num_greater_than_equals. */ + String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; + /** is_empty. */ + String IS_EMPTY = "is_empty"; + /** is_not_empty. */ + String IS_NOT_EMPTY = "is_not_empty"; + /** is_true. */ + String IS_TRUE = "is_true"; + /** is_false. */ + String IS_FALSE = "is_false"; + /** strings_in_list. */ + String STRINGS_IN_LIST = "strings_in_list"; + /** strings_allowed. */ + String STRINGS_ALLOWED = "strings_allowed"; + /** strings_required. */ + String STRINGS_REQUIRED = "strings_required"; + /** ips_in_range. */ + String IPS_IN_RANGE = "ips_in_range"; + /** ips_equals. */ + String IPS_EQUALS = "ips_equals"; + /** ips_not_equals. */ + String IPS_NOT_EQUALS = "ips_not_equals"; + /** days_less_than. */ + String DAYS_LESS_THAN = "days_less_than"; + } + + protected String description; + protected List and; + protected List or; + protected String property; + protected String operator; + protected Object value; + + protected RequiredConfig() { } + + /** + * Gets the description. + * + * The required config description. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the and. + * + * The `AND` required configurations. + * + * @return the and + */ + public List and() { + return and; + } + + /** + * Gets the or. + * + * The `OR` required configurations. + * + * @return the or + */ + public List or() { + return or; + } + + /** + * Gets the property. + * + * The property. + * + * @return the property + */ + public String property() { + return property; + } + + /** + * Gets the operator. + * + * The operator. + * + * @return the operator + */ + public String operator() { + return operator; + } + + /** + * Gets the value. + * + * Schema for any JSON type. + * + * @return the value + */ + public Object value() { + return value; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java new file mode 100644 index 00000000..4f3247ef --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * RequiredConfigItems. + * + * Classes which extend this class: + * - RequiredConfigItemsRequiredConfigOr + * - RequiredConfigItemsRequiredConfigAnd + * - RequiredConfigItemsRequiredConfigBase + */ +public class RequiredConfigItems extends GenericModel { + + /** + * The operator. + */ + public interface Operator { + /** string_equals. */ + String STRING_EQUALS = "string_equals"; + /** string_not_equals. */ + String STRING_NOT_EQUALS = "string_not_equals"; + /** string_match. */ + String STRING_MATCH = "string_match"; + /** string_not_match. */ + String STRING_NOT_MATCH = "string_not_match"; + /** string_contains. */ + String STRING_CONTAINS = "string_contains"; + /** string_not_contains. */ + String STRING_NOT_CONTAINS = "string_not_contains"; + /** num_equals. */ + String NUM_EQUALS = "num_equals"; + /** num_not_equals. */ + String NUM_NOT_EQUALS = "num_not_equals"; + /** num_less_than. */ + String NUM_LESS_THAN = "num_less_than"; + /** num_less_than_equals. */ + String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; + /** num_greater_than. */ + String NUM_GREATER_THAN = "num_greater_than"; + /** num_greater_than_equals. */ + String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; + /** is_empty. */ + String IS_EMPTY = "is_empty"; + /** is_not_empty. */ + String IS_NOT_EMPTY = "is_not_empty"; + /** is_true. */ + String IS_TRUE = "is_true"; + /** is_false. */ + String IS_FALSE = "is_false"; + /** strings_in_list. */ + String STRINGS_IN_LIST = "strings_in_list"; + /** strings_allowed. */ + String STRINGS_ALLOWED = "strings_allowed"; + /** strings_required. */ + String STRINGS_REQUIRED = "strings_required"; + /** ips_in_range. */ + String IPS_IN_RANGE = "ips_in_range"; + /** ips_equals. */ + String IPS_EQUALS = "ips_equals"; + /** ips_not_equals. */ + String IPS_NOT_EQUALS = "ips_not_equals"; + /** days_less_than. */ + String DAYS_LESS_THAN = "days_less_than"; + } + + protected String description; + protected List or; + protected List and; + protected String property; + protected String operator; + protected Object value; + + protected RequiredConfigItems() { } + + /** + * Gets the description. + * + * The required config description. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the or. + * + * The `OR` required configurations. + * + * @return the or + */ + public List or() { + return or; + } + + /** + * Gets the and. + * + * The `AND` required configurations. + * + * @return the and + */ + public List and() { + return and; + } + + /** + * Gets the property. + * + * The property. + * + * @return the property + */ + public String property() { + return property; + } + + /** + * Gets the operator. + * + * The operator. + * + * @return the operator + */ + public String operator() { + return operator; + } + + /** + * Gets the value. + * + * Schema for any JSON type. + * + * @return the value + */ + public Object value() { + return value; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAnd.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAnd.java new file mode 100644 index 00000000..86889ed2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAnd.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * RequiredConfigItemsRequiredConfigAnd. + */ +public class RequiredConfigItemsRequiredConfigAnd extends RequiredConfigItems { + + + /** + * Builder. + */ + public static class Builder { + private String description; + private List and; + + /** + * Instantiates a new Builder from an existing RequiredConfigItemsRequiredConfigAnd instance. + * + * @param requiredConfigItemsRequiredConfigAnd the instance to initialize the Builder with + */ + public Builder(RequiredConfigItems requiredConfigItemsRequiredConfigAnd) { + this.description = requiredConfigItemsRequiredConfigAnd.description; + this.and = requiredConfigItemsRequiredConfigAnd.and; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a RequiredConfigItemsRequiredConfigAnd. + * + * @return the new RequiredConfigItemsRequiredConfigAnd instance + */ + public RequiredConfigItemsRequiredConfigAnd build() { + return new RequiredConfigItemsRequiredConfigAnd(this); + } + + /** + * Adds an and to and. + * + * @param and the new and + * @return the RequiredConfigItemsRequiredConfigAnd builder + */ + public Builder addAnd(RequiredConfigItems and) { + com.ibm.cloud.sdk.core.util.Validator.notNull(and, + "and cannot be null"); + if (this.and == null) { + this.and = new ArrayList(); + } + this.and.add(and); + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the RequiredConfigItemsRequiredConfigAnd builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the and. + * Existing and will be replaced. + * + * @param and the and + * @return the RequiredConfigItemsRequiredConfigAnd builder + */ + public Builder and(List and) { + this.and = and; + return this; + } + } + + protected RequiredConfigItemsRequiredConfigAnd() { } + + protected RequiredConfigItemsRequiredConfigAnd(Builder builder) { + description = builder.description; + and = builder.and; + } + + /** + * New builder. + * + * @return a RequiredConfigItemsRequiredConfigAnd builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBase.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBase.java new file mode 100644 index 00000000..f6bb1329 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBase.java @@ -0,0 +1,187 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +/** + * The required configuration base object. + */ +public class RequiredConfigItemsRequiredConfigBase extends RequiredConfigItems { + + /** + * The operator. + */ + public interface Operator { + /** string_equals. */ + String STRING_EQUALS = "string_equals"; + /** string_not_equals. */ + String STRING_NOT_EQUALS = "string_not_equals"; + /** string_match. */ + String STRING_MATCH = "string_match"; + /** string_not_match. */ + String STRING_NOT_MATCH = "string_not_match"; + /** string_contains. */ + String STRING_CONTAINS = "string_contains"; + /** string_not_contains. */ + String STRING_NOT_CONTAINS = "string_not_contains"; + /** num_equals. */ + String NUM_EQUALS = "num_equals"; + /** num_not_equals. */ + String NUM_NOT_EQUALS = "num_not_equals"; + /** num_less_than. */ + String NUM_LESS_THAN = "num_less_than"; + /** num_less_than_equals. */ + String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; + /** num_greater_than. */ + String NUM_GREATER_THAN = "num_greater_than"; + /** num_greater_than_equals. */ + String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; + /** is_empty. */ + String IS_EMPTY = "is_empty"; + /** is_not_empty. */ + String IS_NOT_EMPTY = "is_not_empty"; + /** is_true. */ + String IS_TRUE = "is_true"; + /** is_false. */ + String IS_FALSE = "is_false"; + /** strings_in_list. */ + String STRINGS_IN_LIST = "strings_in_list"; + /** strings_allowed. */ + String STRINGS_ALLOWED = "strings_allowed"; + /** strings_required. */ + String STRINGS_REQUIRED = "strings_required"; + /** ips_in_range. */ + String IPS_IN_RANGE = "ips_in_range"; + /** ips_equals. */ + String IPS_EQUALS = "ips_equals"; + /** ips_not_equals. */ + String IPS_NOT_EQUALS = "ips_not_equals"; + /** days_less_than. */ + String DAYS_LESS_THAN = "days_less_than"; + } + + + /** + * Builder. + */ + public static class Builder { + private String description; + private String property; + private String operator; + private Object value; + + /** + * Instantiates a new Builder from an existing RequiredConfigItemsRequiredConfigBase instance. + * + * @param requiredConfigItemsRequiredConfigBase the instance to initialize the Builder with + */ + public Builder(RequiredConfigItems requiredConfigItemsRequiredConfigBase) { + this.description = requiredConfigItemsRequiredConfigBase.description; + this.property = requiredConfigItemsRequiredConfigBase.property; + this.operator = requiredConfigItemsRequiredConfigBase.operator; + this.value = requiredConfigItemsRequiredConfigBase.value; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param property the property + * @param operator the operator + */ + public Builder(String property, String operator) { + this.property = property; + this.operator = operator; + } + + /** + * Builds a RequiredConfigItemsRequiredConfigBase. + * + * @return the new RequiredConfigItemsRequiredConfigBase instance + */ + public RequiredConfigItemsRequiredConfigBase build() { + return new RequiredConfigItemsRequiredConfigBase(this); + } + + /** + * Set the description. + * + * @param description the description + * @return the RequiredConfigItemsRequiredConfigBase builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the property. + * + * @param property the property + * @return the RequiredConfigItemsRequiredConfigBase builder + */ + public Builder property(String property) { + this.property = property; + return this; + } + + /** + * Set the operator. + * + * @param operator the operator + * @return the RequiredConfigItemsRequiredConfigBase builder + */ + public Builder operator(String operator) { + this.operator = operator; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the RequiredConfigItemsRequiredConfigBase builder + */ + public Builder value(Object value) { + this.value = value; + return this; + } + } + + protected RequiredConfigItemsRequiredConfigBase() { } + + protected RequiredConfigItemsRequiredConfigBase(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.property, + "property cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operator, + "operator cannot be null"); + description = builder.description; + property = builder.property; + operator = builder.operator; + value = builder.value; + } + + /** + * New builder. + * + * @return a RequiredConfigItemsRequiredConfigBase builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOr.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOr.java new file mode 100644 index 00000000..cce73931 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOr.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * The `OR` required configurations. + */ +public class RequiredConfigItemsRequiredConfigOr extends RequiredConfigItems { + + + /** + * Builder. + */ + public static class Builder { + private String description; + private List or; + + /** + * Instantiates a new Builder from an existing RequiredConfigItemsRequiredConfigOr instance. + * + * @param requiredConfigItemsRequiredConfigOr the instance to initialize the Builder with + */ + public Builder(RequiredConfigItems requiredConfigItemsRequiredConfigOr) { + this.description = requiredConfigItemsRequiredConfigOr.description; + this.or = requiredConfigItemsRequiredConfigOr.or; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a RequiredConfigItemsRequiredConfigOr. + * + * @return the new RequiredConfigItemsRequiredConfigOr instance + */ + public RequiredConfigItemsRequiredConfigOr build() { + return new RequiredConfigItemsRequiredConfigOr(this); + } + + /** + * Adds an or to or. + * + * @param or the new or + * @return the RequiredConfigItemsRequiredConfigOr builder + */ + public Builder addOr(RequiredConfigItems or) { + com.ibm.cloud.sdk.core.util.Validator.notNull(or, + "or cannot be null"); + if (this.or == null) { + this.or = new ArrayList(); + } + this.or.add(or); + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the RequiredConfigItemsRequiredConfigOr builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the or. + * Existing or will be replaced. + * + * @param or the or + * @return the RequiredConfigItemsRequiredConfigOr builder + */ + public Builder or(List or) { + this.or = or; + return this; + } + } + + protected RequiredConfigItemsRequiredConfigOr() { } + + protected RequiredConfigItemsRequiredConfigOr(Builder builder) { + description = builder.description; + or = builder.or; + } + + /** + * New builder. + * + * @return a RequiredConfigItemsRequiredConfigOr builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAnd.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAnd.java new file mode 100644 index 00000000..4f37e79d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAnd.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * RequiredConfigRequiredConfigAnd. + */ +public class RequiredConfigRequiredConfigAnd extends RequiredConfig { + + + /** + * Builder. + */ + public static class Builder { + private String description; + private List and; + + /** + * Instantiates a new Builder from an existing RequiredConfigRequiredConfigAnd instance. + * + * @param requiredConfigRequiredConfigAnd the instance to initialize the Builder with + */ + public Builder(RequiredConfig requiredConfigRequiredConfigAnd) { + this.description = requiredConfigRequiredConfigAnd.description; + this.and = requiredConfigRequiredConfigAnd.and; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a RequiredConfigRequiredConfigAnd. + * + * @return the new RequiredConfigRequiredConfigAnd instance + */ + public RequiredConfigRequiredConfigAnd build() { + return new RequiredConfigRequiredConfigAnd(this); + } + + /** + * Adds an and to and. + * + * @param and the new and + * @return the RequiredConfigRequiredConfigAnd builder + */ + public Builder addAnd(RequiredConfigItems and) { + com.ibm.cloud.sdk.core.util.Validator.notNull(and, + "and cannot be null"); + if (this.and == null) { + this.and = new ArrayList(); + } + this.and.add(and); + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the RequiredConfigRequiredConfigAnd builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the and. + * Existing and will be replaced. + * + * @param and the and + * @return the RequiredConfigRequiredConfigAnd builder + */ + public Builder and(List and) { + this.and = and; + return this; + } + } + + protected RequiredConfigRequiredConfigAnd() { } + + protected RequiredConfigRequiredConfigAnd(Builder builder) { + description = builder.description; + and = builder.and; + } + + /** + * New builder. + * + * @return a RequiredConfigRequiredConfigAnd builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBase.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBase.java new file mode 100644 index 00000000..8ed728b4 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBase.java @@ -0,0 +1,187 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +/** + * The required configuration base object. + */ +public class RequiredConfigRequiredConfigBase extends RequiredConfig { + + /** + * The operator. + */ + public interface Operator { + /** string_equals. */ + String STRING_EQUALS = "string_equals"; + /** string_not_equals. */ + String STRING_NOT_EQUALS = "string_not_equals"; + /** string_match. */ + String STRING_MATCH = "string_match"; + /** string_not_match. */ + String STRING_NOT_MATCH = "string_not_match"; + /** string_contains. */ + String STRING_CONTAINS = "string_contains"; + /** string_not_contains. */ + String STRING_NOT_CONTAINS = "string_not_contains"; + /** num_equals. */ + String NUM_EQUALS = "num_equals"; + /** num_not_equals. */ + String NUM_NOT_EQUALS = "num_not_equals"; + /** num_less_than. */ + String NUM_LESS_THAN = "num_less_than"; + /** num_less_than_equals. */ + String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; + /** num_greater_than. */ + String NUM_GREATER_THAN = "num_greater_than"; + /** num_greater_than_equals. */ + String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; + /** is_empty. */ + String IS_EMPTY = "is_empty"; + /** is_not_empty. */ + String IS_NOT_EMPTY = "is_not_empty"; + /** is_true. */ + String IS_TRUE = "is_true"; + /** is_false. */ + String IS_FALSE = "is_false"; + /** strings_in_list. */ + String STRINGS_IN_LIST = "strings_in_list"; + /** strings_allowed. */ + String STRINGS_ALLOWED = "strings_allowed"; + /** strings_required. */ + String STRINGS_REQUIRED = "strings_required"; + /** ips_in_range. */ + String IPS_IN_RANGE = "ips_in_range"; + /** ips_equals. */ + String IPS_EQUALS = "ips_equals"; + /** ips_not_equals. */ + String IPS_NOT_EQUALS = "ips_not_equals"; + /** days_less_than. */ + String DAYS_LESS_THAN = "days_less_than"; + } + + + /** + * Builder. + */ + public static class Builder { + private String description; + private String property; + private String operator; + private Object value; + + /** + * Instantiates a new Builder from an existing RequiredConfigRequiredConfigBase instance. + * + * @param requiredConfigRequiredConfigBase the instance to initialize the Builder with + */ + public Builder(RequiredConfig requiredConfigRequiredConfigBase) { + this.description = requiredConfigRequiredConfigBase.description; + this.property = requiredConfigRequiredConfigBase.property; + this.operator = requiredConfigRequiredConfigBase.operator; + this.value = requiredConfigRequiredConfigBase.value; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param property the property + * @param operator the operator + */ + public Builder(String property, String operator) { + this.property = property; + this.operator = operator; + } + + /** + * Builds a RequiredConfigRequiredConfigBase. + * + * @return the new RequiredConfigRequiredConfigBase instance + */ + public RequiredConfigRequiredConfigBase build() { + return new RequiredConfigRequiredConfigBase(this); + } + + /** + * Set the description. + * + * @param description the description + * @return the RequiredConfigRequiredConfigBase builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the property. + * + * @param property the property + * @return the RequiredConfigRequiredConfigBase builder + */ + public Builder property(String property) { + this.property = property; + return this; + } + + /** + * Set the operator. + * + * @param operator the operator + * @return the RequiredConfigRequiredConfigBase builder + */ + public Builder operator(String operator) { + this.operator = operator; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the RequiredConfigRequiredConfigBase builder + */ + public Builder value(Object value) { + this.value = value; + return this; + } + } + + protected RequiredConfigRequiredConfigBase() { } + + protected RequiredConfigRequiredConfigBase(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.property, + "property cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operator, + "operator cannot be null"); + description = builder.description; + property = builder.property; + operator = builder.operator; + value = builder.value; + } + + /** + * New builder. + * + * @return a RequiredConfigRequiredConfigBase builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOr.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOr.java new file mode 100644 index 00000000..dbacdc0e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOr.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * The `OR` required configurations. + */ +public class RequiredConfigRequiredConfigOr extends RequiredConfig { + + + /** + * Builder. + */ + public static class Builder { + private String description; + private List or; + + /** + * Instantiates a new Builder from an existing RequiredConfigRequiredConfigOr instance. + * + * @param requiredConfigRequiredConfigOr the instance to initialize the Builder with + */ + public Builder(RequiredConfig requiredConfigRequiredConfigOr) { + this.description = requiredConfigRequiredConfigOr.description; + this.or = requiredConfigRequiredConfigOr.or; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a RequiredConfigRequiredConfigOr. + * + * @return the new RequiredConfigRequiredConfigOr instance + */ + public RequiredConfigRequiredConfigOr build() { + return new RequiredConfigRequiredConfigOr(this); + } + + /** + * Adds an or to or. + * + * @param or the new or + * @return the RequiredConfigRequiredConfigOr builder + */ + public Builder addOr(RequiredConfigItems or) { + com.ibm.cloud.sdk.core.util.Validator.notNull(or, + "or cannot be null"); + if (this.or == null) { + this.or = new ArrayList(); + } + this.or.add(or); + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the RequiredConfigRequiredConfigOr builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the or. + * Existing or will be replaced. + * + * @param or the or + * @return the RequiredConfigRequiredConfigOr builder + */ + public Builder or(List or) { + this.or = or; + return this; + } + } + + protected RequiredConfigRequiredConfigOr() { } + + protected RequiredConfigRequiredConfigOr(Builder builder) { + description = builder.description; + or = builder.or; + } + + /** + * New builder. + * + * @return a RequiredConfigRequiredConfigOr builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Resource.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Resource.java new file mode 100644 index 00000000..f17751a2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Resource.java @@ -0,0 +1,192 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The resource. + */ +public class Resource extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + @SerializedName("report_id") + protected String reportId; + protected String id; + @SerializedName("resource_name") + protected String resourceName; + @SerializedName("component_id") + protected String componentId; + protected String environment; + protected Account account; + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("pass_count") + protected Long passCount; + @SerializedName("failure_count") + protected Long failureCount; + @SerializedName("error_count") + protected Long errorCount; + @SerializedName("completed_count") + protected Long completedCount; + + protected Resource() { } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the id. + * + * The resource CRN. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the resourceName. + * + * The resource name. + * + * @return the resourceName + */ + public String getResourceName() { + return resourceName; + } + + /** + * Gets the componentId. + * + * The ID of the component. + * + * @return the componentId + */ + public String getComponentId() { + return componentId; + } + + /** + * Gets the environment. + * + * The environment. + * + * @return the environment + */ + public String getEnvironment() { + return environment; + } + + /** + * Gets the account. + * + * The account that is associated with a report. + * + * @return the account + */ + public Account getAccount() { + return account; + } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of evaluations. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the passCount. + * + * The number of passed evaluations. + * + * @return the passCount + */ + public Long getPassCount() { + return passCount; + } + + /** + * Gets the failureCount. + * + * The number of failed evaluations. + * + * @return the failureCount + */ + public Long getFailureCount() { + return failureCount; + } + + /** + * Gets the errorCount. + * + * The number of evaluations that started, but did not finish, and ended with errors. + * + * @return the errorCount + */ + public Long getErrorCount() { + return errorCount; + } + + /** + * Gets the completedCount. + * + * The total number of completed evaluations. + * + * @return the completedCount + */ + public Long getCompletedCount() { + return completedCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePage.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePage.java new file mode 100644 index 00000000..c5a90175 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePage.java @@ -0,0 +1,127 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The page of resource evaluation summaries. + */ +public class ResourcePage extends GenericModel { + + @SerializedName("total_count") + protected Long totalCount; + protected Long limit; + protected String start; + protected PageHRef first; + protected PageHRef next; + @SerializedName("home_account_id") + protected String homeAccountId; + @SerializedName("report_id") + protected String reportId; + protected List resources; + + protected ResourcePage() { } + + /** + * Gets the totalCount. + * + * The total number of resources that are in the collection. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the limit. + * + * The requested page limi.t. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the start. + * + * The token of the next page, when it's present. + * + * @return the start + */ + public String getStart() { + return start; + } + + /** + * Gets the first. + * + * The page reference. + * + * @return the first + */ + public PageHRef getFirst() { + return first; + } + + /** + * Gets the next. + * + * The page reference. + * + * @return the next + */ + public PageHRef getNext() { + return next; + } + + /** + * Gets the homeAccountId. + * + * The ID of the home account. + * + * @return the homeAccountId + */ + public String getHomeAccountId() { + return homeAccountId; + } + + /** + * Gets the reportId. + * + * The ID of the report. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the resources. + * + * The list of resource evaluation summaries that are on the page. + * + * @return the resources + */ + public List getResources() { + return resources; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummary.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummary.java new file mode 100644 index 00000000..9778dd23 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummary.java @@ -0,0 +1,132 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The resource summary. + */ +public class ResourceSummary extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("compliant_count") + protected Long compliantCount; + @SerializedName("not_compliant_count") + protected Long notCompliantCount; + @SerializedName("unable_to_perform_count") + protected Long unableToPerformCount; + @SerializedName("user_evaluation_required_count") + protected Long userEvaluationRequiredCount; + @SerializedName("top_failed") + protected List topFailed; + + protected ResourceSummary() { } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of checks. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the compliantCount. + * + * The number of compliant checks. + * + * @return the compliantCount + */ + public Long getCompliantCount() { + return compliantCount; + } + + /** + * Gets the notCompliantCount. + * + * The number of checks that are not compliant. + * + * @return the notCompliantCount + */ + public Long getNotCompliantCount() { + return notCompliantCount; + } + + /** + * Gets the unableToPerformCount. + * + * The number of checks that are unable to perform. + * + * @return the unableToPerformCount + */ + public Long getUnableToPerformCount() { + return unableToPerformCount; + } + + /** + * Gets the userEvaluationRequiredCount. + * + * The number of checks that require a user evaluation. + * + * @return the userEvaluationRequiredCount + */ + public Long getUserEvaluationRequiredCount() { + return userEvaluationRequiredCount; + } + + /** + * Gets the topFailed. + * + * The top 10 resources that have the most failures. + * + * @return the topFailed + */ + public List getTopFailed() { + return topFailed; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItem.java new file mode 100644 index 00000000..ea26550b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItem.java @@ -0,0 +1,177 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The resource summary item. + */ +public class ResourceSummaryItem extends GenericModel { + + /** + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + */ + public interface Status { + /** compliant. */ + String COMPLIANT = "compliant"; + /** not_compliant. */ + String NOT_COMPLIANT = "not_compliant"; + /** unable_to_perform. */ + String UNABLE_TO_PERFORM = "unable_to_perform"; + /** user_evaluation_required. */ + String USER_EVALUATION_REQUIRED = "user_evaluation_required"; + } + + protected String name; + protected String id; + protected String service; + protected Tags tags; + protected String account; + protected String status; + @SerializedName("total_count") + protected Long totalCount; + @SerializedName("pass_count") + protected Long passCount; + @SerializedName("failure_count") + protected Long failureCount; + @SerializedName("error_count") + protected Long errorCount; + @SerializedName("completed_count") + protected Long completedCount; + + protected ResourceSummaryItem() { } + + /** + * Gets the name. + * + * The resource name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the id. + * + * The resource ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the service. + * + * The service that is managing the resource. + * + * @return the service + */ + public String getService() { + return service; + } + + /** + * Gets the tags. + * + * The collection of different types of tags. + * + * @return the tags + */ + public Tags getTags() { + return tags; + } + + /** + * Gets the account. + * + * The account that owns the resource. + * + * @return the account + */ + public String getAccount() { + return account; + } + + /** + * Gets the status. + * + * The allowed values of an aggregated status for controls, specifications, assessments, and resources. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the totalCount. + * + * The total number of evaluations. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the passCount. + * + * The number of passed evaluations. + * + * @return the passCount + */ + public Long getPassCount() { + return passCount; + } + + /** + * Gets the failureCount. + * + * The number of failed evaluations. + * + * @return the failureCount + */ + public Long getFailureCount() { + return failureCount; + } + + /** + * Gets the errorCount. + * + * The number of evaluations that started, but did not finish, and ended with errors. + * + * @return the errorCount + */ + public Long getErrorCount() { + return errorCount; + } + + /** + * Gets the completedCount. + * + * The total number of completed evaluations. + * + * @return the completedCount + */ + public Long getCompletedCount() { + return completedCount; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Rule.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Rule.java new file mode 100644 index 00000000..7e6f852c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Rule.java @@ -0,0 +1,202 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The rule response that corresponds to an account instance. + */ +public class Rule extends GenericModel { + + /** + * The rule type (allowable values are `user_defined` or `system_defined`). + */ + public interface Type { + /** user_defined. */ + String USER_DEFINED = "user_defined"; + /** system_defined. */ + String SYSTEM_DEFINED = "system_defined"; + } + + @SerializedName("created_on") + protected Date createdOn; + @SerializedName("created_by") + protected String createdBy; + @SerializedName("updated_on") + protected Date updatedOn; + @SerializedName("updated_by") + protected String updatedBy; + protected String id; + @SerializedName("account_id") + protected String accountId; + protected String description; + protected String type; + protected String version; + @SerializedName("import") + protected Import xImport; + protected Target target; + @SerializedName("required_config") + protected RequiredConfig requiredConfig; + protected List labels; + + protected Rule() { } + + /** + * Gets the createdOn. + * + * The date when the rule was created. + * + * @return the createdOn + */ + public Date getCreatedOn() { + return createdOn; + } + + /** + * Gets the createdBy. + * + * The user who created the rule. + * + * @return the createdBy + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * Gets the updatedOn. + * + * The date when the rule was modified. + * + * @return the updatedOn + */ + public Date getUpdatedOn() { + return updatedOn; + } + + /** + * Gets the updatedBy. + * + * The user who modified the rule. + * + * @return the updatedBy + */ + public String getUpdatedBy() { + return updatedBy; + } + + /** + * Gets the id. + * + * The rule ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the accountId. + * + * The account ID. + * + * @return the accountId + */ + public String getAccountId() { + return accountId; + } + + /** + * Gets the description. + * + * The details of a rule's response. + * + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * Gets the type. + * + * The rule type (allowable values are `user_defined` or `system_defined`). + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the version. + * + * The version number of a rule. + * + * @return the version + */ + public String getVersion() { + return version; + } + + /** + * Gets the xImport. + * + * The collection of import parameters. + * + * @return the xImport + */ + public Import getXImport() { + return xImport; + } + + /** + * Gets the target. + * + * The rule target. + * + * @return the target + */ + public Target getTarget() { + return target; + } + + /** + * Gets the requiredConfig. + * + * The required configurations. + * + * @return the requiredConfig + */ + public RequiredConfig getRequiredConfig() { + return requiredConfig; + } + + /** + * Gets the labels. + * + * The list of labels. + * + * @return the labels + */ + public List getLabels() { + return labels; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfo.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfo.java new file mode 100644 index 00000000..88324a3b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfo.java @@ -0,0 +1,153 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The rule. + */ +public class RuleInfo extends GenericModel { + + protected String id; + protected String type; + protected String description; + protected String version; + @SerializedName("account_id") + protected String accountId; + @SerializedName("created_on") + protected String createdOn; + @SerializedName("created_by") + protected String createdBy; + @SerializedName("updated_on") + protected String updatedOn; + @SerializedName("updated_by") + protected String updatedBy; + protected List labels; + + protected RuleInfo() { } + + /** + * Gets the id. + * + * The rule ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the type. + * + * The rule type. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the description. + * + * The rule description. + * + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * Gets the version. + * + * The rule version. + * + * @return the version + */ + public String getVersion() { + return version; + } + + /** + * Gets the accountId. + * + * The rule account ID. + * + * @return the accountId + */ + public String getAccountId() { + return accountId; + } + + /** + * Gets the createdOn. + * + * The date when the rule was created. + * + * @return the createdOn + */ + public String getCreatedOn() { + return createdOn; + } + + /** + * Gets the createdBy. + * + * The ID of the user who created the rule. + * + * @return the createdBy + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * Gets the updatedOn. + * + * The date when the rule was updated. + * + * @return the updatedOn + */ + public String getUpdatedOn() { + return updatedOn; + } + + /** + * Gets the updatedBy. + * + * The ID of the user who updated the rule. + * + * @return the updatedBy + */ + public String getUpdatedBy() { + return updatedBy; + } + + /** + * Gets the labels. + * + * The rule labels. + * + * @return the labels + */ + public List getLabels() { + return labels; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBase.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBase.java new file mode 100644 index 00000000..9511b90d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBase.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Page common fields. + */ +public class RulesPageBase extends GenericModel { + + protected Long limit; + @SerializedName("total_count") + protected Long totalCount; + protected PageHRefFirst first; + protected PageHRefNext next; + protected List rules; + + protected RulesPageBase() { } + + /** + * Gets the limit. + * + * The requested page limit. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the totalCount. + * + * The total number of resources in the collection. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + + /** + * Gets the first. + * + * A page reference. + * + * @return the first + */ + public PageHRefFirst getFirst() { + return first; + } + + /** + * Gets the next. + * + * A page reference. + * + * @return the next + */ + public PageHRefNext getNext() { + return next; + } + + /** + * Gets the rules. + * + * The collection of rules that correspond to an account instance. Maximum of 100/500 custom rules per + * stand-alone/enterprise account. + * + * @return the rules + */ + public List getRules() { + return rules; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Scan.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Scan.java new file mode 100644 index 00000000..da473b5a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Scan.java @@ -0,0 +1,160 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The response schema for creating a scan. + */ +public class Scan extends GenericModel { + + /** + * The status of the scan. + */ + public interface Status { + /** completed. */ + String COMPLETED = "completed"; + /** in_progress. */ + String IN_PROGRESS = "in_progress"; + } + + /** + * The type of scan. + */ + public interface ScanType { + /** ondemand. */ + String ONDEMAND = "ondemand"; + /** scheduled. */ + String SCHEDULED = "scheduled"; + } + + protected String id; + @SerializedName("account_id") + protected String accountId; + @SerializedName("attachment_id") + protected String attachmentId; + @SerializedName("report_id") + protected String reportId; + protected String status; + @SerializedName("last_scan_time") + protected String lastScanTime; + @SerializedName("next_scan_time") + protected String nextScanTime; + @SerializedName("scan_type") + protected String scanType; + protected Long occurence; + + protected Scan() { } + + /** + * Gets the id. + * + * The scan ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the accountId. + * + * The account ID. + * + * @return the accountId + */ + public String getAccountId() { + return accountId; + } + + /** + * Gets the attachmentId. + * + * The attachment ID of a profile. + * + * @return the attachmentId + */ + public String getAttachmentId() { + return attachmentId; + } + + /** + * Gets the reportId. + * + * The report ID. + * + * @return the reportId + */ + public String getReportId() { + return reportId; + } + + /** + * Gets the status. + * + * The status of the scan. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the lastScanTime. + * + * The last scan time. + * + * @return the lastScanTime + */ + public String getLastScanTime() { + return lastScanTime; + } + + /** + * Gets the nextScanTime. + * + * The next scan time. + * + * @return the nextScanTime + */ + public String getNextScanTime() { + return nextScanTime; + } + + /** + * Gets the scanType. + * + * The type of scan. + * + * @return the scanType + */ + public String getScanType() { + return scanType; + } + + /** + * Gets the occurence. + * + * The occurrence of the scan. + * + * @return the occurence + */ + public Long getOccurence() { + return occurence; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopeProperty.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopeProperty.java new file mode 100644 index 00000000..d2fdcac5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopeProperty.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The properties that are supported for scoping by this attachment. + */ +public class ScopeProperty extends GenericModel { + + protected String name; + protected String value; + + protected ScopeProperty() { } + + /** + * Gets the name. + * + * The property name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the value. + * + * The property value. + * + * @return the value + */ + public String getValue() { + return value; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Settings.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Settings.java new file mode 100644 index 00000000..1f4ae4ea --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Settings.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The settings. + */ +public class Settings extends GenericModel { + + @SerializedName("event_notifications") + protected EventNotifications eventNotifications; + @SerializedName("object_storage") + protected ObjectStorage objectStorage; + + /** + * Builder. + */ + public static class Builder { + private EventNotifications eventNotifications; + private ObjectStorage objectStorage; + + /** + * Instantiates a new Builder from an existing Settings instance. + * + * @param settings the instance to initialize the Builder with + */ + private Builder(Settings settings) { + this.eventNotifications = settings.eventNotifications; + this.objectStorage = settings.objectStorage; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a Settings. + * + * @return the new Settings instance + */ + public Settings build() { + return new Settings(this); + } + + /** + * Set the eventNotifications. + * + * @param eventNotifications the eventNotifications + * @return the Settings builder + */ + public Builder eventNotifications(EventNotifications eventNotifications) { + this.eventNotifications = eventNotifications; + return this; + } + + /** + * Set the objectStorage. + * + * @param objectStorage the objectStorage + * @return the Settings builder + */ + public Builder objectStorage(ObjectStorage objectStorage) { + this.objectStorage = objectStorage; + return this; + } + } + + protected Settings() { } + + protected Settings(Builder builder) { + eventNotifications = builder.eventNotifications; + objectStorage = builder.objectStorage; + } + + /** + * New builder. + * + * @return a Settings builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the eventNotifications. + * + * The Event Notifications settings. + * + * @return the eventNotifications + */ + public EventNotifications eventNotifications() { + return eventNotifications; + } + + /** + * Gets the objectStorage. + * + * The Cloud Object Storage settings. + * + * @return the objectStorage + */ + public ObjectStorage objectStorage() { + return objectStorage; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Tags.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Tags.java new file mode 100644 index 00000000..650cee17 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Tags.java @@ -0,0 +1,63 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The collection of different types of tags. + */ +public class Tags extends GenericModel { + + protected List user; + protected List access; + protected List service; + + protected Tags() { } + + /** + * Gets the user. + * + * The collection of user tags. + * + * @return the user + */ + public List getUser() { + return user; + } + + /** + * Gets the access. + * + * The collection of access tags. + * + * @return the access + */ + public List getAccess() { + return access; + } + + /** + * Gets the service. + * + * The collection of service tags. + * + * @return the service + */ + public List getService() { + return service; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java new file mode 100644 index 00000000..06193702 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java @@ -0,0 +1,210 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The rule target. + */ +public class Target extends GenericModel { + + @SerializedName("service_name") + protected String serviceName; + @SerializedName("service_display_name") + protected String serviceDisplayName; + @SerializedName("resource_kind") + protected String resourceKind; + @SerializedName("additional_target_attributes") + protected List additionalTargetAttributes; + + /** + * Builder. + */ + public static class Builder { + private String serviceName; + private String serviceDisplayName; + private String resourceKind; + private List additionalTargetAttributes; + + /** + * Instantiates a new Builder from an existing Target instance. + * + * @param target the instance to initialize the Builder with + */ + private Builder(Target target) { + this.serviceName = target.serviceName; + this.serviceDisplayName = target.serviceDisplayName; + this.resourceKind = target.resourceKind; + this.additionalTargetAttributes = target.additionalTargetAttributes; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param serviceName the serviceName + * @param resourceKind the resourceKind + */ + public Builder(String serviceName, String resourceKind) { + this.serviceName = serviceName; + this.resourceKind = resourceKind; + } + + /** + * Builds a Target. + * + * @return the new Target instance + */ + public Target build() { + return new Target(this); + } + + /** + * Adds an additionalTargetAttributes to additionalTargetAttributes. + * + * @param additionalTargetAttributes the new additionalTargetAttributes + * @return the Target builder + */ + public Builder addAdditionalTargetAttributes(AdditionalTargetAttribute additionalTargetAttributes) { + com.ibm.cloud.sdk.core.util.Validator.notNull(additionalTargetAttributes, + "additionalTargetAttributes cannot be null"); + if (this.additionalTargetAttributes == null) { + this.additionalTargetAttributes = new ArrayList(); + } + this.additionalTargetAttributes.add(additionalTargetAttributes); + return this; + } + + /** + * Set the serviceName. + * + * @param serviceName the serviceName + * @return the Target builder + */ + public Builder serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Set the serviceDisplayName. + * + * @param serviceDisplayName the serviceDisplayName + * @return the Target builder + */ + public Builder serviceDisplayName(String serviceDisplayName) { + this.serviceDisplayName = serviceDisplayName; + return this; + } + + /** + * Set the resourceKind. + * + * @param resourceKind the resourceKind + * @return the Target builder + */ + public Builder resourceKind(String resourceKind) { + this.resourceKind = resourceKind; + return this; + } + + /** + * Set the additionalTargetAttributes. + * Existing additionalTargetAttributes will be replaced. + * + * @param additionalTargetAttributes the additionalTargetAttributes + * @return the Target builder + */ + public Builder additionalTargetAttributes(List additionalTargetAttributes) { + this.additionalTargetAttributes = additionalTargetAttributes; + return this; + } + } + + protected Target() { } + + protected Target(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.serviceName, + "serviceName cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resourceKind, + "resourceKind cannot be null"); + serviceName = builder.serviceName; + serviceDisplayName = builder.serviceDisplayName; + resourceKind = builder.resourceKind; + additionalTargetAttributes = builder.additionalTargetAttributes; + } + + /** + * New builder. + * + * @return a Target builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the serviceName. + * + * The target service name. + * + * @return the serviceName + */ + public String serviceName() { + return serviceName; + } + + /** + * Gets the serviceDisplayName. + * + * The display name of the target service. + * + * @return the serviceDisplayName + */ + public String serviceDisplayName() { + return serviceDisplayName; + } + + /** + * Gets the resourceKind. + * + * The target resource kind. + * + * @return the resourceKind + */ + public String resourceKind() { + return resourceKind; + } + + /** + * Gets the additionalTargetAttributes. + * + * The list of targets supported properties. + * + * @return the additionalTargetAttributes + */ + public List additionalTargetAttributes() { + return additionalTargetAttributes; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfo.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfo.java new file mode 100644 index 00000000..7a3c9bd0 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfo.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The evaluation target. + */ +public class TargetInfo extends GenericModel { + + protected String id; + @SerializedName("account_id") + protected String accountId; + @SerializedName("resource_crn") + protected String resourceCrn; + @SerializedName("resource_name") + protected String resourceName; + @SerializedName("service_name") + protected String serviceName; + + protected TargetInfo() { } + + /** + * Gets the id. + * + * The target ID. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the accountId. + * + * The target account ID. + * + * @return the accountId + */ + public String getAccountId() { + return accountId; + } + + /** + * Gets the resourceCrn. + * + * The target resource CRN. + * + * @return the resourceCrn + */ + public String getResourceCrn() { + return resourceCrn; + } + + /** + * Gets the resourceName. + * + * The target resource name. + * + * @return the resourceName + */ + public String getResourceName() { + return resourceName; + } + + /** + * Gets the serviceName. + * + * The target service name. + * + * @return the serviceName + */ + public String getServiceName() { + return serviceName; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEvent.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEvent.java new file mode 100644 index 00000000..70226060 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEvent.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The details of a test event response. + */ +public class TestEvent extends GenericModel { + + protected Boolean success; + + protected TestEvent() { } + + /** + * Gets the success. + * + * The indication of whether the event was received by Event Notifications. + * + * @return the success + */ + public Boolean isSuccess() { + return success; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java new file mode 100644 index 00000000..270d946c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java @@ -0,0 +1,243 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Map; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The updateProviderTypeInstance options. + */ +public class UpdateProviderTypeInstanceOptions extends GenericModel { + + protected String providerTypeId; + protected String providerTypeInstanceId; + protected String name; + protected Map attributes; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private String providerTypeId; + private String providerTypeInstanceId; + private String name; + private Map attributes; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing UpdateProviderTypeInstanceOptions instance. + * + * @param updateProviderTypeInstanceOptions the instance to initialize the Builder with + */ + private Builder(UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptions) { + this.providerTypeId = updateProviderTypeInstanceOptions.providerTypeId; + this.providerTypeInstanceId = updateProviderTypeInstanceOptions.providerTypeInstanceId; + this.name = updateProviderTypeInstanceOptions.name; + this.attributes = updateProviderTypeInstanceOptions.attributes; + this.xCorrelationId = updateProviderTypeInstanceOptions.xCorrelationId; + this.xRequestId = updateProviderTypeInstanceOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param providerTypeId the providerTypeId + * @param providerTypeInstanceId the providerTypeInstanceId + */ + public Builder(String providerTypeId, String providerTypeInstanceId) { + this.providerTypeId = providerTypeId; + this.providerTypeInstanceId = providerTypeInstanceId; + } + + /** + * Builds a UpdateProviderTypeInstanceOptions. + * + * @return the new UpdateProviderTypeInstanceOptions instance + */ + public UpdateProviderTypeInstanceOptions build() { + return new UpdateProviderTypeInstanceOptions(this); + } + + /** + * Set the providerTypeId. + * + * @param providerTypeId the providerTypeId + * @return the UpdateProviderTypeInstanceOptions builder + */ + public Builder providerTypeId(String providerTypeId) { + this.providerTypeId = providerTypeId; + return this; + } + + /** + * Set the providerTypeInstanceId. + * + * @param providerTypeInstanceId the providerTypeInstanceId + * @return the UpdateProviderTypeInstanceOptions builder + */ + public Builder providerTypeInstanceId(String providerTypeInstanceId) { + this.providerTypeInstanceId = providerTypeInstanceId; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the UpdateProviderTypeInstanceOptions builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the attributes. + * + * @param attributes the attributes + * @return the UpdateProviderTypeInstanceOptions builder + */ + public Builder attributes(Map attributes) { + this.attributes = attributes; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the UpdateProviderTypeInstanceOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the UpdateProviderTypeInstanceOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + } + + protected UpdateProviderTypeInstanceOptions() { } + + protected UpdateProviderTypeInstanceOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeId, + "providerTypeId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeInstanceId, + "providerTypeInstanceId cannot be empty"); + providerTypeId = builder.providerTypeId; + providerTypeInstanceId = builder.providerTypeInstanceId; + name = builder.name; + attributes = builder.attributes; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a UpdateProviderTypeInstanceOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerTypeId. + * + * The provider type ID. + * + * @return the providerTypeId + */ + public String providerTypeId() { + return providerTypeId; + } + + /** + * Gets the providerTypeInstanceId. + * + * The provider type instance ID. + * + * @return the providerTypeInstanceId + */ + public String providerTypeInstanceId() { + return providerTypeInstanceId; + } + + /** + * Gets the name. + * + * The provider type instance name. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the attributes. + * + * The attributes for connecting to the provider type instance. + * + * @return the attributes + */ + public Map attributes() { + return attributes; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this headers is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptions.java new file mode 100644 index 00000000..aceba84e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptions.java @@ -0,0 +1,186 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The updateSettings options. + */ +public class UpdateSettingsOptions extends GenericModel { + + protected EventNotifications eventNotifications; + protected ObjectStorage objectStorage; + protected String xCorrelationId; + protected String xRequestId; + + /** + * Builder. + */ + public static class Builder { + private EventNotifications eventNotifications; + private ObjectStorage objectStorage; + private String xCorrelationId; + private String xRequestId; + + /** + * Instantiates a new Builder from an existing UpdateSettingsOptions instance. + * + * @param updateSettingsOptions the instance to initialize the Builder with + */ + private Builder(UpdateSettingsOptions updateSettingsOptions) { + this.eventNotifications = updateSettingsOptions.eventNotifications; + this.objectStorage = updateSettingsOptions.objectStorage; + this.xCorrelationId = updateSettingsOptions.xCorrelationId; + this.xRequestId = updateSettingsOptions.xRequestId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a UpdateSettingsOptions. + * + * @return the new UpdateSettingsOptions instance + */ + public UpdateSettingsOptions build() { + return new UpdateSettingsOptions(this); + } + + /** + * Set the eventNotifications. + * + * @param eventNotifications the eventNotifications + * @return the UpdateSettingsOptions builder + */ + public Builder eventNotifications(EventNotifications eventNotifications) { + this.eventNotifications = eventNotifications; + return this; + } + + /** + * Set the objectStorage. + * + * @param objectStorage the objectStorage + * @return the UpdateSettingsOptions builder + */ + public Builder objectStorage(ObjectStorage objectStorage) { + this.objectStorage = objectStorage; + return this; + } + + /** + * Set the xCorrelationId. + * + * @param xCorrelationId the xCorrelationId + * @return the UpdateSettingsOptions builder + */ + public Builder xCorrelationId(String xCorrelationId) { + this.xCorrelationId = xCorrelationId; + return this; + } + + /** + * Set the xRequestId. + * + * @param xRequestId the xRequestId + * @return the UpdateSettingsOptions builder + */ + public Builder xRequestId(String xRequestId) { + this.xRequestId = xRequestId; + return this; + } + + /** + * Set the settings. + * + * @param settings the settings + * @return the UpdateSettingsOptions builder + */ + public Builder settings(Settings settings) { + this.eventNotifications = settings.eventNotifications(); + this.objectStorage = settings.objectStorage(); + return this; + } + } + + protected UpdateSettingsOptions() { } + + protected UpdateSettingsOptions(Builder builder) { + eventNotifications = builder.eventNotifications; + objectStorage = builder.objectStorage; + xCorrelationId = builder.xCorrelationId; + xRequestId = builder.xRequestId; + } + + /** + * New builder. + * + * @return a UpdateSettingsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the eventNotifications. + * + * The Event Notifications settings. + * + * @return the eventNotifications + */ + public EventNotifications eventNotifications() { + return eventNotifications; + } + + /** + * Gets the objectStorage. + * + * The Cloud Object Storage settings. + * + * @return the objectStorage + */ + public ObjectStorage objectStorage() { + return objectStorage; + } + + /** + * Gets the xCorrelationId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is used for downstream requests and retries of those requests. If a value of + * this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xCorrelationId + */ + public String xCorrelationId() { + return xCorrelationId; + } + + /** + * Gets the xRequestId. + * + * The supplied or generated value of this header is logged for a request, and repeated in a response header for the + * corresponding response. The same value is not used for downstream requests and retries of those requests. If a + * value of this header is not supplied in a request, the service generates a random (version 4) UUID. + * + * @return the xRequestId + */ + public String xRequestId() { + return xRequestId; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/package-info.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/package-info.java new file mode 100644 index 00000000..7388da39 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/package-info.java @@ -0,0 +1,16 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +/** + * Security and Compliance Center API v3. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java new file mode 100644 index 00000000..52f0c1de --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java @@ -0,0 +1,1916 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3; + +import com.ibm.cloud.sdk.core.http.Response; +import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.CredentialUtils; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Attachment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsAccountPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceScore; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrariesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryDelete; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecificationWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlsInControlLib; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateScanOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DefaultParametersPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalDetails; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Evaluation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvaluationPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EventNotifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetLatestReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeByIdOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypesInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportControlsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportEvaluationOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportSummaryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportTagsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportViolationsDriftOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LabelType; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LastScan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsAccountOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListControlLibrariesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProfilesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypeInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportEvaluationsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportResourcesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListRulesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ObjectStorage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRef; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PostTestEventOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Profile; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControlsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfilesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Report; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportEvaluationsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportLatest; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportResourcesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportTags; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationDataPoint; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfig; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItems; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourcePage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummaryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RuleInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RulesPageBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Scan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Settings; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import com.ibm.cloud.security_and_compliance_center_api.test.SdkIntegrationTestBase; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Integration test class for the SecurityAndComplianceCenterApi service. + */ +public class SecurityAndComplianceCenterApiIT extends SdkIntegrationTestBase { + public SecurityAndComplianceCenterApi service = null; + public static Map config = null; + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // Variables to hold link values + String accountIdForReportLink = null; + String attachmentIdForReportLink = null; + String attachmentIdLink = null; + String controlLibraryIdLink = null; + String eTagLink = null; + String eventNotificationsCrnForUpdateSettingsLink = null; + String groupIdForReportLink = null; + String objectStorageBucketForUpdateSettingsLink = null; + String objectStorageCrnForUpdateSettingsLink = null; + String objectStorageLocationForUpdateSettingsLink = null; + String profileIdForReportLink = null; + String profileIdLink = null; + String providerTypeIdLink = null; + String providerTypeInstanceIdLink = null; + String reportIdForReportLink = null; + String ruleIdLink = null; + String typeForReportLink = null; + + /** + * This method provides our config filename to the base class. + */ + + public String getConfigFilename() { + return "../../security_and_compliance_center_api_v3.env"; + } + + @BeforeClass + public void constructService() { + // Ask super if we should skip the tests. + if (skipTests()) { + return; + } + + service = SecurityAndComplianceCenterApi.newInstance(); + assertNotNull(service); + assertNotNull(service.getServiceUrl()); + + // Load up our test-specific config properties. + config = CredentialUtils.getServiceProperties(SecurityAndComplianceCenterApi.DEFAULT_SERVICE_NAME); + assertNotNull(config); + assertFalse(config.isEmpty()); + assertEquals(service.getServiceUrl(), config.get("URL")); + + service.enableRetries(4, 30); + + System.out.println("Setup complete."); + } + + @Test + public void testGetSettings() throws Exception { + try { + GetSettingsOptions getSettingsOptions = new GetSettingsOptions.Builder() + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getSettings(getSettingsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Settings settingsResult = response.getResult(); + + assertNotNull(settingsResult); + eventNotificationsCrnForUpdateSettingsLink = settingsResult.eventNotifications().instanceCrn(); + objectStorageCrnForUpdateSettingsLink = settingsResult.objectStorage().instanceCrn(); + objectStorageBucketForUpdateSettingsLink = settingsResult.objectStorage().bucket(); + objectStorageLocationForUpdateSettingsLink = settingsResult.objectStorage().bucketLocation(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetSettings" }) + public void testCreateRule() throws Exception { + try { + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("location") + .operator("string_equals") + .value("us-east") + .build(); + + Target targetModel = new Target.Builder() + .serviceName("cloud-object-storage") + .serviceDisplayName("testString") + .resourceKind("bucket") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + + RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .description("testString") + .property("hard_quota") + .operator("num_equals") + .value("${hard_quota}") + .build(); + + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("The Cloud Object Storage rule.") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + + Parameter parameterModel = new Parameter.Builder() + .name("hard_quota") + .displayName("The Cloud Object Storage bucket quota.") + .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") + .type("numeric") + .build(); + + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + + CreateRuleOptions createRuleOptions = new CreateRuleOptions.Builder() + .description("Example rule") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .type("user_defined") + .version("1.0.0") + .xImport(importModel) + .labels(java.util.Arrays.asList()) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.createRule(createRuleOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + Rule ruleResult = response.getResult(); + + assertNotNull(ruleResult); + ruleIdLink = ruleResult.getId(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateRule" }) + public void testGetRule() throws Exception { + try { + GetRuleOptions getRuleOptions = new GetRuleOptions.Builder() + .ruleId(ruleIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getRule(getRuleOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Rule ruleResult = response.getResult(); + + assertNotNull(ruleResult); + eTagLink = response.getHeaders().values("ETag").get(0); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateRule" }) + public void testGetLatestReports() throws Exception { + try { + GetLatestReportsOptions getLatestReportsOptions = new GetLatestReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .sort("profile_name") + .build(); + + // Invoke operation + Response response = service.getLatestReports(getLatestReportsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ReportLatest reportLatestResult = response.getResult(); + + assertNotNull(reportLatestResult); + accountIdForReportLink = reportLatestResult.getReports().get(0).getAccount().getId(); + reportIdForReportLink = reportLatestResult.getReports().get(0).getId(); + attachmentIdForReportLink = reportLatestResult.getReports().get(0).getAttachment().getId(); + groupIdForReportLink = reportLatestResult.getReports().get(0).getGroupId(); + profileIdForReportLink = reportLatestResult.getReports().get(0).getProfile().getId(); + typeForReportLink = reportLatestResult.getReports().get(0).getType(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetLatestReports" }) + public void testUpdateSettings() throws Exception { + try { + EventNotifications eventNotificationsModel = new EventNotifications.Builder() + .instanceCrn(eventNotificationsCrnForUpdateSettingsLink) + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") + .sourceName("compliance") + .build(); + + ObjectStorage objectStorageModel = new ObjectStorage.Builder() + .instanceCrn(objectStorageCrnForUpdateSettingsLink) + .bucket(objectStorageBucketForUpdateSettingsLink) + .bucketLocation(objectStorageLocationForUpdateSettingsLink) + .bucketEndpoint("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + + UpdateSettingsOptions updateSettingsOptions = new UpdateSettingsOptions.Builder() + .eventNotifications(eventNotificationsModel) + .objectStorage(objectStorageModel) + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.updateSettings(updateSettingsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + + Settings settingsResult = response.getResult(); + + //assertNotNull(settingsResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + // @Test(dependsOnMethods = { "testUpdateSettings" }) + // public void testPostTestEvent() throws Exception { + // try { + // PostTestEventOptions postTestEventOptions = new PostTestEventOptions.Builder() + // .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + // .xRequestId("testString") + // .build(); + + // // Invoke operation + // Response response = service.postTestEvent(postTestEventOptions).execute(); + // // Validate response + // assertNotNull(response); + // assertEquals(response.getStatusCode(), 202); + + // TestEvent testEventResult = response.getResult(); + + // assertNotNull(testEventResult); + // } catch (ServiceResponseException e) { + // fail(String.format("Service returned status code %d: %s%nError details: %s", + // e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + // } + // } + + @Test(dependsOnMethods = { "testUpdateSettings" }) + public void testCreateCustomControlLibrary() throws Exception { + try { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("session_invalidation_in_seconds") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .parameterValue("public") + .build(); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameterCount(Long.valueOf("38")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .responsibility("user") + .componentId("iam-identity") + .componenetName("testString") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessmentsCount(Long.valueOf("38")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") + .build(); + + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlParent("") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + + CreateCustomControlLibraryOptions createCustomControlLibraryOptions = new CreateCustomControlLibraryOptions.Builder() + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .controlLibraryVersion("1.0.0") + .latest(true) + .controlsCount(Long.valueOf("38")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.createCustomControlLibrary(createCustomControlLibraryOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + ControlLibrary controlLibraryResult = response.getResult(); + + assertNotNull(controlLibraryResult); + controlLibraryIdLink = controlLibraryResult.id(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateCustomControlLibrary" }) + public void testListControlLibraries() throws Exception { + try { + ListControlLibrariesOptions listControlLibrariesOptions = new ListControlLibrariesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("1")) + .controlLibraryType("custom") + .build(); + + + // Invoke operation + Response response = service.listControlLibraries(listControlLibrariesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ControlLibraryCollection controlLibraryCollectionResult = response.getResult(); + + assertNotNull(controlLibraryCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListControlLibraries" }) + public void testListControlLibrariesWithPager() throws Exception { + try { + ListControlLibrariesOptions options = new ListControlLibrariesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .controlLibraryType("custom") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + ControlLibrariesPager pager = new ControlLibrariesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new ControlLibrariesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListControlLibraries" }) + public void testGetControlLibrary() throws Exception { + try { + GetControlLibraryOptions getControlLibraryOptions = new GetControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getControlLibrary(getControlLibraryOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ControlLibrary controlLibraryResult = response.getResult(); + + assertNotNull(controlLibraryResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetControlLibrary" }) + public void testReplaceCustomControlLibrary() throws Exception { + try { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("session_invalidation_in_seconds") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .parameterValue("public") + .build(); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameterCount(Long.valueOf("38")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .responsibility("user") + .componentId("iam-identity") + .componenetName("testString") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessmentsCount(Long.valueOf("38")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") + .build(); + + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlParent("") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + + ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions = new ReplaceCustomControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) + .id("testString") + .accountId(config.get("ACCOUNTID")) + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .controlLibraryVersion("1.1.0") + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .latest(true) + .hierarchyEnabled(true) + .controlsCount(Long.valueOf("38")) + .controlParentsCount(Long.valueOf("38")) + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.replaceCustomControlLibrary(replaceCustomControlLibraryOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ControlLibrary controlLibraryResult = response.getResult(); + + assertNotNull(controlLibraryResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testReplaceCustomControlLibrary" }) + public void testCreateProfile() throws Exception { + try { + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId(controlLibraryIdLink) + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .build(); + + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + CreateProfileOptions createProfileOptions = new CreateProfileOptions.Builder() + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.createProfile(createProfileOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + Profile profileResult = response.getResult(); + + assertNotNull(profileResult); + profileIdLink = profileResult.getId(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateProfile" }) + public void testListProfiles() throws Exception { + try { + ListProfilesOptions listProfilesOptions = new ListProfilesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("1")) + .profileType("custom") + .build(); + + // Invoke operation + Response response = service.listProfiles(listProfilesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ProfileCollection profileCollectionResult = response.getResult(); + + assertNotNull(profileCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListProfiles" }) + public void testListProfilesWithPager() throws Exception { + try { + ListProfilesOptions options = new ListProfilesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .profileType("custom") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + ProfilesPager pager = new ProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new ProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListProfiles" }) + public void testGetProfile() throws Exception { + try { + GetProfileOptions getProfileOptions = new GetProfileOptions.Builder() + .profilesId(profileIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getProfile(getProfileOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Profile profileResult = response.getResult(); + + assertNotNull(profileResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetProfile" }) + public void testReplaceProfile() throws Exception { + try { + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId(controlLibraryIdLink) + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .build(); + + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + ReplaceProfileOptions replaceProfileOptions = new ReplaceProfileOptions.Builder() + .profilesId(profileIdLink) + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.replaceProfile(replaceProfileOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Profile profileResult = response.getResult(); + + assertNotNull(profileResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testReplaceProfile" }) + public void testListRules() throws Exception { + try { + ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .type("system_defined") + .search("testString") + .serviceName("testString") + .build(); + + // Invoke operation + Response response = service.listRules(listRulesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + RulesPageBase rulesPageBaseResult = response.getResult(); + + assertNotNull(rulesPageBaseResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListRules" }) + public void testReplaceRule() throws Exception { + try { + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("location") + .operator("string_equals") + .value("us-south") + .build(); + + Target targetModel = new Target.Builder() + .serviceName("cloud-object-storage") + .serviceDisplayName("Cloud Object Storage") + .resourceKind("bucket") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + + RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .description("testString") + .property("hard_quota") + .operator("num_equals") + .value("${hard_quota}") + .build(); + + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("The Cloud Object Storage rule.") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + + Parameter parameterModel = new Parameter.Builder() + .name("hard_quota") + .displayName("The Cloud Object Storage bucket quota.") + .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") + .type("numeric") + .build(); + + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + + ReplaceRuleOptions replaceRuleOptions = new ReplaceRuleOptions.Builder() + .ruleId(ruleIdLink) + .ifMatch(eTagLink) + .description("Example rule") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .type("user_defined") + .version("1.0.1") + .xImport(importModel) + .labels(java.util.Arrays.asList()) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.replaceRule(replaceRuleOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Rule ruleResult = response.getResult(); + + assertNotNull(ruleResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testReplaceRule" }) + public void testCreateAttachment() throws Exception { + try { + PropertyItem propertyScopeId = new PropertyItem.Builder() + .name("scope_id") + .value(config.get("ACCOUNTID")) + .build(); + + PropertyItem propertyScopeType = new PropertyItem.Builder() + .name("scope_type") + .value("account") + .build(); + + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyScopeId,propertyScopeType)) + .build(); + + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() + .id("130003ea8bfa43c5aacea07a86da3000") + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .build(); + + CreateAttachmentOptions createAttachmentOptions = new CreateAttachmentOptions.Builder() + .profilesId(profileIdLink) + .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.createAttachment(createAttachmentOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + AttachmentPrototype attachmentPrototypeResult = response.getResult(); + + assertNotNull(attachmentPrototypeResult); + attachmentIdLink = attachmentPrototypeResult.attachments().get(0).id(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateAttachment" }) + public void testListAttachments() throws Exception { + try { + ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() + .profilesId(profileIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("1")) + .build(); + + // Invoke operation + Response response = service.listAttachments(listAttachmentsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AttachmentCollection attachmentCollectionResult = response.getResult(); + + assertNotNull(attachmentCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListAttachments" }) + public void testListAttachmentsWithPager() throws Exception { + try { + ListAttachmentsOptions options = new ListAttachmentsOptions.Builder() + .profilesId(profileIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + AttachmentsPager pager = new AttachmentsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new AttachmentsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListAttachments" }) + public void testGetProfileAttachment() throws Exception { + try { + GetProfileAttachmentOptions getProfileAttachmentOptions = new GetProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profilesId(profileIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getProfileAttachment(getProfileAttachmentOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AttachmentItem attachmentItemResult = response.getResult(); + + assertNotNull(attachmentItemResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetProfileAttachment" }) + public void testReplaceProfileAttachment() throws Exception { + try { + PropertyItem propertyScopeId = new PropertyItem.Builder() + .name("scope_id") + .value(config.get("ACCOUNTID")) + .build(); + + PropertyItem propertyScopeType = new PropertyItem.Builder() + .name("scope_type") + .value("account") + .build(); + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyScopeId,propertyScopeType)) + .build(); + + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + LastScan lastScanModel = new LastScan.Builder() + .id("e8a39d25-0051-4328-8462-988ad321f49a") + .status("in_progress") + .time(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + + ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions = new ReplaceProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profilesId(profileIdLink) + .id("testString") + .profileId(profileIdLink) + .accountId(config.get("ACCOUNTID")) + .instanceId(config.get("INSTANCEID")) + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .lastScan(lastScanModel) + .nextScanTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.replaceProfileAttachment(replaceProfileAttachmentOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AttachmentItem attachmentItemResult = response.getResult(); + + assertNotNull(attachmentItemResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testReplaceProfileAttachment" }) + public void testCreateScan() throws Exception { + try { + CreateScanOptions createScanOptions = new CreateScanOptions.Builder() + .attachmentId(config.get("ATTACHMENTID")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.createScan(createScanOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + Scan scanResult = response.getResult(); + + assertNotNull(scanResult); + } catch (ServiceResponseException e) { + if(e.getMessage() != null && e.getMessage().contains("Another scan is currently in progress.")){ + return; + } + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateScan" }) + public void testListAttachmentsAccount() throws Exception { + try { + ListAttachmentsAccountOptions listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("1")) + .build(); + + // Invoke operation + Response response = service.listAttachmentsAccount(listAttachmentsAccountOptions).execute(); + + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AttachmentCollection attachmentCollectionResult = response.getResult(); + + assertNotNull(attachmentCollectionResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListAttachmentsAccount" }) + public void testListAttachmentsAccountWithPager() throws Exception { + try { + ListAttachmentsAccountOptions options = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("1")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + AttachmentsAccountPager pager = new AttachmentsAccountPager(service, options); + if(pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + + assertNotNull(allResults); + assertFalse(allResults.isEmpty()); + + assertEquals(allResults.size(),1); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListAttachmentsAccount" }) + public void testListReports() throws Exception { + try { + ListReportsOptions listReportsOptions = new ListReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .attachmentId(attachmentIdForReportLink) + .groupId(groupIdForReportLink) + .profileId(profileIdForReportLink) + .type(typeForReportLink) + .limit(Long.valueOf("1")) + .sort("profile_name") + .build(); + + // Invoke operation + Response response = service.listReports(listReportsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ReportPage reportPageResult = response.getResult(); + + assertNotNull(reportPageResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListReports" }) + public void testListReportsWithPager() throws Exception { + try { + ListReportsOptions options = new ListReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .attachmentId(attachmentIdForReportLink) + .groupId(groupIdForReportLink) + .profileId(profileIdForReportLink) + .type(typeForReportLink) + .limit(Long.valueOf("10")) + .sort("profile_name") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + ReportsPager pager = new ReportsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new ReportsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListReports" }) + public void testGetReport() throws Exception { + try { + GetReportOptions getReportOptions = new GetReportOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getReport(getReportOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Report reportResult = response.getResult(); + + assertNotNull(reportResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetReport" }) + public void testGetReportSummary() throws Exception { + try { + GetReportSummaryOptions getReportSummaryOptions = new GetReportSummaryOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getReportSummary(getReportSummaryOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ReportSummary reportSummaryResult = response.getResult(); + + assertNotNull(reportSummaryResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetReportSummary" }) + public void testGetReportEvaluation() throws Exception { + try { + GetReportEvaluationOptions getReportEvaluationOptions = new GetReportEvaluationOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .excludeSummary(true) + .build(); + + // Invoke operation + Response response = service.getReportEvaluation(getReportEvaluationOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + InputStream inputStreamResult = response.getResult(); + + assertNotNull(inputStreamResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetReportEvaluation" }) + public void testGetReportControls() throws Exception { + try { + GetReportControlsOptions getReportControlsOptions = new GetReportControlsOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .controlId("testString") + .controlName("testString") + .controlDescription("testString") + .controlCategory("testString") + .status("compliant") + .sort("control_name") + .build(); + + // Invoke operation + Response response = service.getReportControls(getReportControlsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ReportControls reportControlsResult = response.getResult(); + + assertNotNull(reportControlsResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetReportControls" }) + public void testListReportEvaluations() throws Exception { + try { + ListReportEvaluationsOptions listReportEvaluationsOptions = new ListReportEvaluationsOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .assessmentId("testString") + .componentId("testString") + .targetId("testString") + .targetName("testString") + .status("failure") + .limit(Long.valueOf("1")) + .build(); + + // Invoke operation + Response response = service.listReportEvaluations(listReportEvaluationsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + EvaluationPage evaluationPageResult = response.getResult(); + + assertNotNull(evaluationPageResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListReportEvaluations" }) + public void testListReportEvaluationsWithPager() throws Exception { + try { + ListReportEvaluationsOptions options = new ListReportEvaluationsOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .status("failure") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + ReportEvaluationsPager pager = new ReportEvaluationsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + + // Test getAll(); + pager = new ReportEvaluationsPager(service, options); + List allItems = pager.getAll(); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListReportEvaluationsWithPager" }) + public void testListReportResources() throws Exception { + try { + ListReportResourcesOptions listReportResourcesOptions = new ListReportResourcesOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .id("testString") + .resourceName("testString") + .accountId(accountIdForReportLink) + .componentId("testString") + .status("compliant") + .sort("account_id") + .limit(Long.valueOf("1")) + .build(); + + // Invoke operation + Response response = service.listReportResources(listReportResourcesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ResourcePage resourcePageResult = response.getResult(); + + assertNotNull(resourcePageResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListReportResources" }) + public void testListReportResourcesWithPager() throws Exception { + try { + ListReportResourcesOptions options = new ListReportResourcesOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .accountId(accountIdForReportLink) + .status("compliant") + .sort("account_id") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + ReportResourcesPager pager = new ReportResourcesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + + // Test getAll(); + pager = new ReportResourcesPager(service, options); + List allItems = pager.getAll(); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListReportResources" }) + public void testGetReportTags() throws Exception { + try { + GetReportTagsOptions getReportTagsOptions = new GetReportTagsOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getReportTags(getReportTagsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ReportTags reportTagsResult = response.getResult(); + + assertNotNull(reportTagsResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetReportTags" }) + public void testGetReportViolationsDrift() throws Exception { + try { + GetReportViolationsDriftOptions getReportViolationsDriftOptions = new GetReportViolationsDriftOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId("testString") + .xRequestId("testString") + .scanTimeDuration(Long.valueOf("0")) + .build(); + + // Invoke operation + Response response = service.getReportViolationsDrift(getReportViolationsDriftOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ReportViolationsDrift reportViolationsDriftResult = response.getResult(); + + assertNotNull(reportViolationsDriftResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetReportViolationsDrift" }) + public void testListProviderTypes() throws Exception { + try { + ListProviderTypesOptions listProviderTypesOptions = new ListProviderTypesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.listProviderTypes(listProviderTypesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ProviderTypesCollection providerTypesCollectionResult = response.getResult(); + + assertNotNull(providerTypesCollectionResult); + providerTypeIdLink = providerTypesCollectionResult.getProviderTypes().get(0).getId(); + + for(ProviderTypeItem providerTypeItem: providerTypesCollectionResult.getProviderTypes()){ + if(providerTypeItem.getName().equals("workload-protection")){ + providerTypeIdLink = providerTypeItem.getId(); + break; + } + } + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListProviderTypes" }) + public void testGetProviderTypeById() throws Exception { + try { + GetProviderTypeByIdOptions getProviderTypeByIdOptions = new GetProviderTypeByIdOptions.Builder() + .providerTypeId(providerTypeIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getProviderTypeById(getProviderTypeByIdOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ProviderTypeItem providerTypeItemResult = response.getResult(); + + assertNotNull(providerTypeItemResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetProviderTypeById" }) + public void testListProviderTypeInstances() throws Exception { + try { + ListProviderTypeInstancesOptions listProviderTypeInstancesOptions = new ListProviderTypeInstancesOptions.Builder() + .providerTypeId(providerTypeIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.listProviderTypeInstances(listProviderTypeInstancesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ProviderTypeInstancesResponse providerTypeInstancesResponseResult = response.getResult(); + + assertNotNull(providerTypeInstancesResponseResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListProviderTypeInstances" }) + public void testCreateProviderTypeInstance() throws Exception { + try { + CreateProviderTypeInstanceOptions createProviderTypeInstanceOptions = new CreateProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .name("workload-protection-instance-1") + .attributes(java.util.Collections.singletonMap("wp_crn", "crn:v1:staging:public:sysdig-secure:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:0df4004c-fb74-483b-97be-dd9bd35af4d8::")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.createProviderTypeInstance(createProviderTypeInstanceOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + ProviderTypeInstanceItem providerTypeInstanceItemResult = response.getResult(); + + assertNotNull(providerTypeInstanceItemResult); + providerTypeInstanceIdLink = providerTypeInstanceItemResult.getId(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateProviderTypeInstance" }) + public void testGetProviderTypeInstance() throws Exception { + try { + GetProviderTypeInstanceOptions getProviderTypeInstanceOptions = new GetProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .providerTypeInstanceId(providerTypeInstanceIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getProviderTypeInstance(getProviderTypeInstanceOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ProviderTypeInstanceItem providerTypeInstanceItemResult = response.getResult(); + + assertNotNull(providerTypeInstanceItemResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetProviderTypeInstance" }) + public void testUpdateProviderTypeInstance() throws Exception { + try { + UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptions = new UpdateProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .providerTypeInstanceId(providerTypeInstanceIdLink) + .name("workload-protection-instance-1") + .attributes(java.util.Collections.singletonMap("wp_crn", "crn:v1:staging:public:sysdig-secure:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:0df4004c-fb74-483b-97be-dd9bd35af4d8::")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.updateProviderTypeInstance(updateProviderTypeInstanceOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ProviderTypeInstanceItem providerTypeInstanceItemResult = response.getResult(); + + assertNotNull(providerTypeInstanceItemResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testUpdateProviderTypeInstance" }) + public void testGetProviderTypesInstances() throws Exception { + try { + GetProviderTypesInstancesOptions getProviderTypesInstancesOptions = new GetProviderTypesInstancesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.getProviderTypesInstances(getProviderTypesInstancesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ProviderTypesInstancesResponse providerTypesInstancesResponseResult = response.getResult(); + + assertNotNull(providerTypesInstancesResponseResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetProviderTypesInstances" }) + public void testDeleteProfileAttachment() throws Exception { + try { + DeleteProfileAttachmentOptions deleteProfileAttachmentOptions = new DeleteProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profilesId(profileIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.deleteProfileAttachment(deleteProfileAttachmentOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + AttachmentItem attachmentItemResult = response.getResult(); + + assertNotNull(attachmentItemResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + + @Test(dependsOnMethods = { "testDeleteProfileAttachment" }) + public void testDeleteCustomProfile() throws Exception { + try { + DeleteCustomProfileOptions deleteCustomProfileOptions = new DeleteCustomProfileOptions.Builder() + .profilesId(profileIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.deleteCustomProfile(deleteCustomProfileOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Profile profileResult = response.getResult(); + + assertNotNull(profileResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testDeleteCustomProfile" }) + public void testDeleteCustomControlLibrary() throws Exception { + try { + DeleteCustomControlLibraryOptions deleteCustomControlLibraryOptions = new DeleteCustomControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.deleteCustomControlLibrary(deleteCustomControlLibraryOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ControlLibraryDelete controlLibraryDeleteResult = response.getResult(); + + assertNotNull(controlLibraryDeleteResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testDeleteCustomControlLibrary" }) + public void testDeleteRule() throws Exception { + try { + DeleteRuleOptions deleteRuleOptions = new DeleteRuleOptions.Builder() + .ruleId(ruleIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.deleteRule(deleteRuleOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + + @Test(dependsOnMethods = { "testDeleteProfileAttachment" }) + public void testDeleteProviderTypeInstance() throws Exception { + try { + DeleteProviderTypeInstanceOptions deleteProviderTypeInstanceOptions = new DeleteProviderTypeInstanceOptions.Builder() + .providerTypeId(providerTypeIdLink) + .providerTypeInstanceId(providerTypeInstanceIdLink) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.deleteProviderTypeInstance(deleteProviderTypeInstanceOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @AfterClass + public void tearDown() { + // Add any clean up logic here + System.out.println("Clean up complete."); + } + } diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java new file mode 100644 index 00000000..1e83cc8f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java @@ -0,0 +1,3475 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3; + +import com.ibm.cloud.sdk.core.http.Response; +import com.ibm.cloud.sdk.core.security.Authenticator; +import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.SecurityAndComplianceCenterApi; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Attachment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsAccountPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceScore; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrariesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryDelete; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecificationWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlsInControlLib; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateScanOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DefaultParametersPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalDetails; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Evaluation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvaluationPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EventNotifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetLatestReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeByIdOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypesInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportControlsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportEvaluationOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportSummaryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportTagsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportViolationsDriftOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LabelType; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LastScan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsAccountOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListControlLibrariesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProfilesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypeInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportEvaluationsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportResourcesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListRulesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ObjectStorage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRef; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PostTestEventOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Profile; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControlsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfilesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Report; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportEvaluationsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportLatest; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportResourcesPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportTags; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationDataPoint; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfig; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItems; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourcePage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummaryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RuleInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RulesPageBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Scan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Settings; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SecurityAndComplianceCenterApi service. + */ +public class SecurityAndComplianceCenterApiTest { + + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + protected MockWebServer server; + protected SecurityAndComplianceCenterApi securityAndComplianceCenterApiService; + + // Construct the service with a null authenticator (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testConstructorWithNullAuthenticator() throws Throwable { + final String serviceName = "testService"; + new SecurityAndComplianceCenterApi(serviceName, null); + } + + // Construct the service URL using the default server variable values + @Test + public void testConstructServiceURLwithDefaultValues() throws Throwable { + String defaultFormattedUrl = "https://us-south.compliance.cloud.ibm.com/instances/instance_id/v3"; + String constructedUrl = SecurityAndComplianceCenterApi.constructServiceUrl(null); + assertEquals(constructedUrl, defaultFormattedUrl); + } + + // Construct the service URL with an invalid server variable name (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testConstructServiceURLWithInvalidVariable() throws Throwable { + Map variables = new HashMap<>(); + variables.put("invalid_variable_name", "value"); + + SecurityAndComplianceCenterApi.constructServiceUrl(variables); + } + + // Test the getSettings operation with a valid options model parameter + @Test + public void testGetSettingsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"event_notifications\": {\"instance_crn\": \"crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"source_id\": \"crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::\", \"source_description\": \"This source is used for integration with IBM Cloud Security and Compliance Center.\", \"source_name\": \"compliance\"}, \"object_storage\": {\"instance_crn\": \"instanceCrn\", \"bucket\": \"bucket\", \"bucket_location\": \"bucketLocation\", \"bucket_endpoint\": \"bucketEndpoint\", \"updated_on\": \"2019-01-01T12:00:00.000Z\"}}"; + String getSettingsPath = "/settings"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetSettingsOptions model + GetSettingsOptions getSettingsOptionsModel = new GetSettingsOptions.Builder() + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + + // Invoke getSettings() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getSettings(getSettingsOptionsModel).execute(); + assertNotNull(response); + Settings responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getSettingsPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getSettings operation with and without retries enabled + @Test + public void testGetSettingsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetSettingsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetSettingsWOptions(); + } + + // Test the updateSettings operation with a valid options model parameter + @Test + public void testUpdateSettingsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"event_notifications\": {\"instance_crn\": \"crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"source_id\": \"crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::\", \"source_description\": \"This source is used for integration with IBM Cloud Security and Compliance Center.\", \"source_name\": \"compliance\"}, \"object_storage\": {\"instance_crn\": \"instanceCrn\", \"bucket\": \"bucket\", \"bucket_location\": \"bucketLocation\", \"bucket_endpoint\": \"bucketEndpoint\", \"updated_on\": \"2019-01-01T12:00:00.000Z\"}}"; + String updateSettingsPath = "/settings"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the EventNotifications model + EventNotifications eventNotificationsModel = new EventNotifications.Builder() + .instanceCrn("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") + .sourceName("compliance") + .build(); + + // Construct an instance of the ObjectStorage model + ObjectStorage objectStorageModel = new ObjectStorage.Builder() + .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .bucket("px-scan-results") + .bucketLocation("us-south") + .bucketEndpoint("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + + // Construct an instance of the UpdateSettingsOptions model + UpdateSettingsOptions updateSettingsOptionsModel = new UpdateSettingsOptions.Builder() + .eventNotifications(eventNotificationsModel) + .objectStorage(objectStorageModel) + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + + // Invoke updateSettings() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.updateSettings(updateSettingsOptionsModel).execute(); + assertNotNull(response); + Settings responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateSettingsPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the updateSettings operation with and without retries enabled + @Test + public void testUpdateSettingsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testUpdateSettingsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testUpdateSettingsWOptions(); + } + + // Test the postTestEvent operation with a valid options model parameter + @Test + public void testPostTestEventWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"success\": false}"; + String postTestEventPath = "/test_event"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the PostTestEventOptions model + PostTestEventOptions postTestEventOptionsModel = new PostTestEventOptions.Builder() + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + + // Invoke postTestEvent() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.postTestEvent(postTestEventOptionsModel).execute(); + assertNotNull(response); + TestEvent responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, postTestEventPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the postTestEvent operation with and without retries enabled + @Test + public void testPostTestEventWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testPostTestEventWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testPostTestEventWOptions(); + } + + // Test the listControlLibraries operation with a valid options model parameter + @Test + public void testListControlLibrariesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"total_count\": 1, \"limit\": 20, \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\", \"start\": \"start\"}, \"control_libraries\": [{\"id\": \"id\", \"account_id\": \"accountId\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"controlLibraryType\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"version_group_label\": \"versionGroupLabel\", \"control_library_version\": \"controlLibraryVersion\", \"latest\": true, \"controls_count\": 13}]}"; + String listControlLibrariesPath = "/control_libraries"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListControlLibrariesOptions model + ListControlLibrariesOptions listControlLibrariesOptionsModel = new ListControlLibrariesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .controlLibraryType("custom") + .start("testString") + .build(); + + // Invoke listControlLibraries() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listControlLibraries(listControlLibrariesOptionsModel).execute(); + assertNotNull(response); + ControlLibraryCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listControlLibrariesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("50")); + assertEquals(query.get("control_library_type"), "custom"); + assertEquals(query.get("start"), "testString"); + } + + // Test the listControlLibraries operation with and without retries enabled + @Test + public void testListControlLibrariesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListControlLibrariesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListControlLibrariesWOptions(); + } + + // Test the listControlLibraries operation using the ControlLibrariesPager.getNext() method + @Test + public void testListControlLibrariesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"control_libraries\":[{\"id\":\"id\",\"account_id\":\"accountId\",\"control_library_name\":\"controlLibraryName\",\"control_library_description\":\"controlLibraryDescription\",\"control_library_type\":\"controlLibraryType\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"version_group_label\":\"versionGroupLabel\",\"control_library_version\":\"controlLibraryVersion\",\"latest\":true,\"controls_count\":13}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"control_libraries\":[{\"id\":\"id\",\"account_id\":\"accountId\",\"control_library_name\":\"controlLibraryName\",\"control_library_description\":\"controlLibraryDescription\",\"control_library_type\":\"controlLibraryType\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"version_group_label\":\"versionGroupLabel\",\"control_library_version\":\"controlLibraryVersion\",\"latest\":true,\"controls_count\":13}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListControlLibrariesOptions listControlLibrariesOptions = new ListControlLibrariesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .controlLibraryType("custom") + .build(); + + List allResults = new ArrayList<>(); + ControlLibrariesPager pager = new ControlLibrariesPager(securityAndComplianceCenterApiService, listControlLibrariesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listControlLibraries operation using the ControlLibrariesPager.getAll() method + @Test + public void testListControlLibrariesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"control_libraries\":[{\"id\":\"id\",\"account_id\":\"accountId\",\"control_library_name\":\"controlLibraryName\",\"control_library_description\":\"controlLibraryDescription\",\"control_library_type\":\"controlLibraryType\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"version_group_label\":\"versionGroupLabel\",\"control_library_version\":\"controlLibraryVersion\",\"latest\":true,\"controls_count\":13}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"control_libraries\":[{\"id\":\"id\",\"account_id\":\"accountId\",\"control_library_name\":\"controlLibraryName\",\"control_library_description\":\"controlLibraryDescription\",\"control_library_type\":\"controlLibraryType\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"version_group_label\":\"versionGroupLabel\",\"control_library_version\":\"controlLibraryVersion\",\"latest\":true,\"controls_count\":13}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListControlLibrariesOptions listControlLibrariesOptions = new ListControlLibrariesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .controlLibraryType("custom") + .build(); + + ControlLibrariesPager pager = new ControlLibrariesPager(securityAndComplianceCenterApiService, listControlLibrariesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createCustomControlLibrary operation with a valid options model parameter + @Test + public void testCreateCustomControlLibraryWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; + String createCustomControlLibraryPath = "/control_libraries"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the ParameterInfo model + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("session_invalidation_in_seconds") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .parameterValue("public") + .build(); + + // Construct an instance of the Implementation model + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameterCount(Long.valueOf("26")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + + // Construct an instance of the ControlSpecifications model + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .responsibility("user") + .componentId("iam-identity") + .componenetName("testString") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessmentsCount(Long.valueOf("26")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + + // Construct an instance of the ControlDocs model + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") + .build(); + + // Construct an instance of the ControlsInControlLib model + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlParent("testString") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + + // Construct an instance of the CreateCustomControlLibraryOptions model + CreateCustomControlLibraryOptions createCustomControlLibraryOptionsModel = new CreateCustomControlLibraryOptions.Builder() + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .versionGroupLabel("33fc7b80-0fa5-4f16-bbba-1f293f660f0d") + .controlLibraryVersion("1.0.0") + .latest(true) + .controlsCount(Long.valueOf("26")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke createCustomControlLibrary() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.createCustomControlLibrary(createCustomControlLibraryOptionsModel).execute(); + assertNotNull(response); + ControlLibrary responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createCustomControlLibraryPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the createCustomControlLibrary operation with and without retries enabled + @Test + public void testCreateCustomControlLibraryWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testCreateCustomControlLibraryWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testCreateCustomControlLibraryWOptions(); + } + + // Test the createCustomControlLibrary operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateCustomControlLibraryNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.createCustomControlLibrary(null).execute(); + } + + // Test the deleteCustomControlLibrary operation with a valid options model parameter + @Test + public void testDeleteCustomControlLibraryWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"deleted\": \"deleted\"}"; + String deleteCustomControlLibraryPath = "/control_libraries/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteCustomControlLibraryOptions model + DeleteCustomControlLibraryOptions deleteCustomControlLibraryOptionsModel = new DeleteCustomControlLibraryOptions.Builder() + .controlLibrariesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke deleteCustomControlLibrary() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.deleteCustomControlLibrary(deleteCustomControlLibraryOptionsModel).execute(); + assertNotNull(response); + ControlLibraryDelete responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteCustomControlLibraryPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the deleteCustomControlLibrary operation with and without retries enabled + @Test + public void testDeleteCustomControlLibraryWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testDeleteCustomControlLibraryWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testDeleteCustomControlLibraryWOptions(); + } + + // Test the deleteCustomControlLibrary operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteCustomControlLibraryNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.deleteCustomControlLibrary(null).execute(); + } + + // Test the getControlLibrary operation with a valid options model parameter + @Test + public void testGetControlLibraryWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; + String getControlLibraryPath = "/control_libraries/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetControlLibraryOptions model + GetControlLibraryOptions getControlLibraryOptionsModel = new GetControlLibraryOptions.Builder() + .controlLibrariesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getControlLibrary() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getControlLibrary(getControlLibraryOptionsModel).execute(); + assertNotNull(response); + ControlLibrary responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getControlLibraryPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getControlLibrary operation with and without retries enabled + @Test + public void testGetControlLibraryWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetControlLibraryWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetControlLibraryWOptions(); + } + + // Test the getControlLibrary operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetControlLibraryNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getControlLibrary(null).execute(); + } + + // Test the replaceCustomControlLibrary operation with a valid options model parameter + @Test + public void testReplaceCustomControlLibraryWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; + String replaceCustomControlLibraryPath = "/control_libraries/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ParameterInfo model + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("session_invalidation_in_seconds") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .parameterValue("public") + .build(); + + // Construct an instance of the Implementation model + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameterCount(Long.valueOf("26")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + + // Construct an instance of the ControlSpecifications model + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .responsibility("user") + .componentId("iam-identity") + .componenetName("testString") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessmentsCount(Long.valueOf("26")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + + // Construct an instance of the ControlDocs model + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") + .build(); + + // Construct an instance of the ControlsInControlLib model + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlParent("testString") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + + // Construct an instance of the ReplaceCustomControlLibraryOptions model + ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptionsModel = new ReplaceCustomControlLibraryOptions.Builder() + .controlLibrariesId("testString") + .id("testString") + .accountId("testString") + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .versionGroupLabel("testString") + .controlLibraryVersion("1.1.0") + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .latest(true) + .hierarchyEnabled(true) + .controlsCount(Long.valueOf("26")) + .controlParentsCount(Long.valueOf("26")) + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke replaceCustomControlLibrary() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.replaceCustomControlLibrary(replaceCustomControlLibraryOptionsModel).execute(); + assertNotNull(response); + ControlLibrary responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PUT"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, replaceCustomControlLibraryPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the replaceCustomControlLibrary operation with and without retries enabled + @Test + public void testReplaceCustomControlLibraryWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testReplaceCustomControlLibraryWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testReplaceCustomControlLibraryWOptions(); + } + + // Test the replaceCustomControlLibrary operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceCustomControlLibraryNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.replaceCustomControlLibrary(null).execute(); + } + + // Test the listProfiles operation with a valid options model parameter + @Test + public void testListProfilesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"total_count\": 1, \"limit\": 20, \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\", \"start\": \"start\"}, \"profiles\": [{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"profileType\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"versionGroupLabel\", \"latest\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"attachments_count\": 16}]}"; + String listProfilesPath = "/profiles"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListProfilesOptions model + ListProfilesOptions listProfilesOptionsModel = new ListProfilesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .profileType("custom") + .start("testString") + .build(); + + // Invoke listProfiles() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listProfiles(listProfilesOptionsModel).execute(); + assertNotNull(response); + ProfileCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listProfilesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("profile_type"), "custom"); + assertEquals(query.get("start"), "testString"); + } + + // Test the listProfiles operation with and without retries enabled + @Test + public void testListProfilesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListProfilesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListProfilesWOptions(); + } + + // Test the listProfiles operation using the ProfilesPager.getNext() method + @Test + public void testListProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"id\":\"id\",\"profile_name\":\"profileName\",\"profile_description\":\"profileDescription\",\"profile_type\":\"profileType\",\"profile_version\":\"profileVersion\",\"version_group_label\":\"versionGroupLabel\",\"latest\":true,\"created_by\":\"createdBy\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"controls_count\":13,\"attachments_count\":16}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"id\":\"id\",\"profile_name\":\"profileName\",\"profile_description\":\"profileDescription\",\"profile_type\":\"profileType\",\"profile_version\":\"profileVersion\",\"version_group_label\":\"versionGroupLabel\",\"latest\":true,\"created_by\":\"createdBy\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"controls_count\":13,\"attachments_count\":16}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListProfilesOptions listProfilesOptions = new ListProfilesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .profileType("custom") + .build(); + + List allResults = new ArrayList<>(); + ProfilesPager pager = new ProfilesPager(securityAndComplianceCenterApiService, listProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listProfiles operation using the ProfilesPager.getAll() method + @Test + public void testListProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"id\":\"id\",\"profile_name\":\"profileName\",\"profile_description\":\"profileDescription\",\"profile_type\":\"profileType\",\"profile_version\":\"profileVersion\",\"version_group_label\":\"versionGroupLabel\",\"latest\":true,\"created_by\":\"createdBy\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"controls_count\":13,\"attachments_count\":16}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"id\":\"id\",\"profile_name\":\"profileName\",\"profile_description\":\"profileDescription\",\"profile_type\":\"profileType\",\"profile_version\":\"profileVersion\",\"version_group_label\":\"versionGroupLabel\",\"latest\":true,\"created_by\":\"createdBy\",\"created_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"controls_count\":13,\"attachments_count\":16}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListProfilesOptions listProfilesOptions = new ListProfilesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .profileType("custom") + .build(); + + ProfilesPager pager = new ProfilesPager(securityAndComplianceCenterApiService, listProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createProfile operation with a valid options model parameter + @Test + public void testCreateProfileWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String createProfilePath = "/profiles"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the ProfileControlsPrototype model + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId("e98a56ff-dc24-41d4-9875-1e188e2da6cd") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .build(); + + // Construct an instance of the DefaultParametersPrototype model + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + // Construct an instance of the CreateProfileOptions model + CreateProfileOptions createProfileOptionsModel = new CreateProfileOptions.Builder() + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke createProfile() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.createProfile(createProfileOptionsModel).execute(); + assertNotNull(response); + Profile responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createProfilePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the createProfile operation with and without retries enabled + @Test + public void testCreateProfileWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testCreateProfileWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testCreateProfileWOptions(); + } + + // Test the createProfile operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateProfileNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.createProfile(null).execute(); + } + + // Test the deleteCustomProfile operation with a valid options model parameter + @Test + public void testDeleteCustomProfileWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String deleteCustomProfilePath = "/profiles/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteCustomProfileOptions model + DeleteCustomProfileOptions deleteCustomProfileOptionsModel = new DeleteCustomProfileOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke deleteCustomProfile() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.deleteCustomProfile(deleteCustomProfileOptionsModel).execute(); + assertNotNull(response); + Profile responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteCustomProfilePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the deleteCustomProfile operation with and without retries enabled + @Test + public void testDeleteCustomProfileWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testDeleteCustomProfileWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testDeleteCustomProfileWOptions(); + } + + // Test the deleteCustomProfile operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteCustomProfileNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.deleteCustomProfile(null).execute(); + } + + // Test the getProfile operation with a valid options model parameter + @Test + public void testGetProfileWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String getProfilePath = "/profiles/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetProfileOptions model + GetProfileOptions getProfileOptionsModel = new GetProfileOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getProfile() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getProfile(getProfileOptionsModel).execute(); + assertNotNull(response); + Profile responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getProfilePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getProfile operation with and without retries enabled + @Test + public void testGetProfileWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetProfileWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetProfileWOptions(); + } + + // Test the getProfile operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProfileNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getProfile(null).execute(); + } + + // Test the replaceProfile operation with a valid options model parameter + @Test + public void testReplaceProfileWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String replaceProfilePath = "/profiles/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ProfileControlsPrototype model + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId("e98a56ff-dc24-41d4-9875-1e188e2da6cd") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .build(); + + // Construct an instance of the DefaultParametersPrototype model + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + // Construct an instance of the ReplaceProfileOptions model + ReplaceProfileOptions replaceProfileOptionsModel = new ReplaceProfileOptions.Builder() + .profilesId("testString") + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke replaceProfile() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.replaceProfile(replaceProfileOptionsModel).execute(); + assertNotNull(response); + Profile responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PUT"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, replaceProfilePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the replaceProfile operation with and without retries enabled + @Test + public void testReplaceProfileWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testReplaceProfileWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testReplaceProfileWOptions(); + } + + // Test the replaceProfile operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceProfileNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.replaceProfile(null).execute(); + } + + // Test the listRules operation with a valid options model parameter + @Test + public void testListRulesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"limit\": 50, \"total_count\": 230, \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\", \"start\": \"start\"}, \"rules\": [{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}]}"; + String listRulesPath = "/rules"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListRulesOptions model + ListRulesOptions listRulesOptionsModel = new ListRulesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .type("system_defined") + .search("testString") + .serviceName("testString") + .build(); + + // Invoke listRules() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listRules(listRulesOptionsModel).execute(); + assertNotNull(response); + RulesPageBase responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listRulesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("type"), "system_defined"); + assertEquals(query.get("search"), "testString"); + assertEquals(query.get("service_name"), "testString"); + } + + // Test the listRules operation with and without retries enabled + @Test + public void testListRulesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListRulesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListRulesWOptions(); + } + + // Test the createRule operation with a valid options model parameter + @Test + public void testCreateRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}"; + String createRulePath = "/rules"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the AdditionalTargetAttribute model + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("location") + .operator("string_equals") + .value("us-east") + .build(); + + // Construct an instance of the Target model + Target targetModel = new Target.Builder() + .serviceName("cloud-object-storage") + .serviceDisplayName("testString") + .resourceKind("bucket") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + + // Construct an instance of the RequiredConfigItemsRequiredConfigBase model + RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .description("testString") + .property("hard_quota") + .operator("num_equals") + .value("${hard_quota}") + .build(); + + // Construct an instance of the RequiredConfigRequiredConfigAnd model + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("The Cloud Object Storage rule.") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + + // Construct an instance of the Parameter model + Parameter parameterModel = new Parameter.Builder() + .name("hard_quota") + .displayName("The Cloud Object Storage bucket quota.") + .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") + .type("numeric") + .build(); + + // Construct an instance of the Import model + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + + // Construct an instance of the CreateRuleOptions model + CreateRuleOptions createRuleOptionsModel = new CreateRuleOptions.Builder() + .description("Example rule") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .type("user_defined") + .version("1.0.0") + .xImport(importModel) + .labels(java.util.Arrays.asList()) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke createRule() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.createRule(createRuleOptionsModel).execute(); + assertNotNull(response); + Rule responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createRulePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the createRule operation with and without retries enabled + @Test + public void testCreateRuleWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testCreateRuleWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testCreateRuleWOptions(); + } + + // Test the createRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.createRule(null).execute(); + } + + // Test the deleteRule operation with a valid options model parameter + @Test + public void testDeleteRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteRulePath = "/rules/testString"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteRuleOptions model + DeleteRuleOptions deleteRuleOptionsModel = new DeleteRuleOptions.Builder() + .ruleId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke deleteRule() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.deleteRule(deleteRuleOptionsModel).execute(); + assertNotNull(response); + Void responseObj = response.getResult(); + assertNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteRulePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the deleteRule operation with and without retries enabled + @Test + public void testDeleteRuleWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testDeleteRuleWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testDeleteRuleWOptions(); + } + + // Test the deleteRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.deleteRule(null).execute(); + } + + // Test the getRule operation with a valid options model parameter + @Test + public void testGetRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}"; + String getRulePath = "/rules/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetRuleOptions model + GetRuleOptions getRuleOptionsModel = new GetRuleOptions.Builder() + .ruleId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getRule() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getRule(getRuleOptionsModel).execute(); + assertNotNull(response); + Rule responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getRulePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getRule operation with and without retries enabled + @Test + public void testGetRuleWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetRuleWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetRuleWOptions(); + } + + // Test the getRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getRule(null).execute(); + } + + // Test the replaceRule operation with a valid options model parameter + @Test + public void testReplaceRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}"; + String replaceRulePath = "/rules/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the AdditionalTargetAttribute model + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("location") + .operator("string_equals") + .value("us-south") + .build(); + + // Construct an instance of the Target model + Target targetModel = new Target.Builder() + .serviceName("cloud-object-storage") + .serviceDisplayName("Cloud Object Storage") + .resourceKind("bucket") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + + // Construct an instance of the RequiredConfigItemsRequiredConfigBase model + RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .description("testString") + .property("hard_quota") + .operator("num_equals") + .value("${hard_quota}") + .build(); + + // Construct an instance of the RequiredConfigRequiredConfigAnd model + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("The Cloud Object Storage rule.") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + + // Construct an instance of the Parameter model + Parameter parameterModel = new Parameter.Builder() + .name("hard_quota") + .displayName("The Cloud Object Storage bucket quota.") + .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") + .type("numeric") + .build(); + + // Construct an instance of the Import model + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + + // Construct an instance of the ReplaceRuleOptions model + ReplaceRuleOptions replaceRuleOptionsModel = new ReplaceRuleOptions.Builder() + .ruleId("testString") + .ifMatch("testString") + .description("Example rule") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .type("user_defined") + .version("1.0.1") + .xImport(importModel) + .labels(java.util.Arrays.asList()) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke replaceRule() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.replaceRule(replaceRuleOptionsModel).execute(); + assertNotNull(response); + Rule responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PUT"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, replaceRulePath); + // Verify header parameters + assertEquals(request.getHeader("If-Match"), "testString"); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the replaceRule operation with and without retries enabled + @Test + public void testReplaceRuleWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testReplaceRuleWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testReplaceRuleWOptions(); + } + + // Test the replaceRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.replaceRule(null).execute(); + } + + // Test the listAttachments operation with a valid options model parameter + @Test + public void testListAttachmentsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"total_count\": 1, \"limit\": 20, \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\", \"start\": \"start\"}, \"attachments\": [{\"id\": \"130003ea8bfa43c5aacea07a86da3000\", \"profile_id\": \"7ec45986-54fc-4b66-a303-d9577b078c65\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"instance_id\": \"edf9524f-406c-412c-acbb-ee371a5cabda\", \"scope\": [{\"environment\": \"environment\", \"properties\": [{\"name\": \"name\", \"value\": \"value\"}]}], \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"status\": \"enabled\", \"schedule\": \"daily\", \"notifications\": {\"enabled\": false, \"controls\": {\"threshold_limit\": 14, \"failed_control_ids\": [\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}}, \"attachment_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_value\": \"parameterValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}], \"last_scan\": {\"id\": \"e8a39d25-0051-4328-8462-988ad321f49a\", \"status\": \"in_progress\", \"time\": \"2019-01-01T12:00:00.000Z\"}, \"next_scan_time\": \"2019-01-01T12:00:00.000Z\", \"name\": \"account-130003ea8bfa43c5aacea07a86da3000\", \"description\": \"Test description\"}]}"; + String listAttachmentsPath = "/profiles/testString/attachments"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListAttachmentsOptions model + ListAttachmentsOptions listAttachmentsOptionsModel = new ListAttachmentsOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .start("testString") + .build(); + + // Invoke listAttachments() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listAttachments(listAttachmentsOptionsModel).execute(); + assertNotNull(response); + AttachmentCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listAttachmentsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("start"), "testString"); + } + + // Test the listAttachments operation with and without retries enabled + @Test + public void testListAttachmentsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListAttachmentsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListAttachmentsWOptions(); + } + + // Test the listAttachments operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListAttachmentsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.listAttachments(null).execute(); + } + + // Test the listAttachments operation using the AttachmentsPager.getNext() method + @Test + public void testListAttachmentsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + AttachmentsPager pager = new AttachmentsPager(securityAndComplianceCenterApiService, listAttachmentsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listAttachments operation using the AttachmentsPager.getAll() method + @Test + public void testListAttachmentsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .build(); + + AttachmentsPager pager = new AttachmentsPager(securityAndComplianceCenterApiService, listAttachmentsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createAttachment operation with a valid options model parameter + @Test + public void testCreateAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"profile_id\": \"profileId\", \"attachments\": [{\"id\": \"130003ea8bfa43c5aacea07a86da3000\", \"name\": \"account-130003ea8bfa43c5aacea07a86da3000\", \"description\": \"Test description\", \"scope\": [{\"environment\": \"environment\", \"properties\": [{\"name\": \"name\", \"value\": \"value\"}]}], \"status\": \"enabled\", \"schedule\": \"daily\", \"notifications\": {\"enabled\": false, \"controls\": {\"threshold_limit\": 14, \"failed_control_ids\": [\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}}, \"attachment_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_value\": \"parameterValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}]}"; + String createAttachmentPath = "/profiles/testString/attachments"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the PropertyItem model + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("scope_id") + .value("cg3335893hh1428692d6747cf300yeb5") + .build(); + + // Construct an instance of the MultiCloudScope model + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + + // Construct an instance of the FailedControls model + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + + // Construct an instance of the AttachmentsNotificationsPrototype model + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + + // Construct an instance of the AttachmentParameterPrototype model + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + // Construct an instance of the AttachmentsPrototype model + AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() + .id("130003ea8bfa43c5aacea07a86da3000") + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .build(); + + // Construct an instance of the CreateAttachmentOptions model + CreateAttachmentOptions createAttachmentOptionsModel = new CreateAttachmentOptions.Builder() + .profilesId("testString") + .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) + .profileId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke createAttachment() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.createAttachment(createAttachmentOptionsModel).execute(); + assertNotNull(response); + AttachmentPrototype responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createAttachmentPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the createAttachment operation with and without retries enabled + @Test + public void testCreateAttachmentWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testCreateAttachmentWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testCreateAttachmentWOptions(); + } + + // Test the createAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.createAttachment(null).execute(); + } + + // Test the deleteProfileAttachment operation with a valid options model parameter + @Test + public void testDeleteProfileAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"130003ea8bfa43c5aacea07a86da3000\", \"profile_id\": \"7ec45986-54fc-4b66-a303-d9577b078c65\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"instance_id\": \"edf9524f-406c-412c-acbb-ee371a5cabda\", \"scope\": [{\"environment\": \"environment\", \"properties\": [{\"name\": \"name\", \"value\": \"value\"}]}], \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"status\": \"enabled\", \"schedule\": \"daily\", \"notifications\": {\"enabled\": false, \"controls\": {\"threshold_limit\": 14, \"failed_control_ids\": [\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}}, \"attachment_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_value\": \"parameterValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}], \"last_scan\": {\"id\": \"e8a39d25-0051-4328-8462-988ad321f49a\", \"status\": \"in_progress\", \"time\": \"2019-01-01T12:00:00.000Z\"}, \"next_scan_time\": \"2019-01-01T12:00:00.000Z\", \"name\": \"account-130003ea8bfa43c5aacea07a86da3000\", \"description\": \"Test description\"}"; + String deleteProfileAttachmentPath = "/profiles/testString/attachments/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteProfileAttachmentOptions model + DeleteProfileAttachmentOptions deleteProfileAttachmentOptionsModel = new DeleteProfileAttachmentOptions.Builder() + .attachmentId("testString") + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke deleteProfileAttachment() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.deleteProfileAttachment(deleteProfileAttachmentOptionsModel).execute(); + assertNotNull(response); + AttachmentItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteProfileAttachmentPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the deleteProfileAttachment operation with and without retries enabled + @Test + public void testDeleteProfileAttachmentWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testDeleteProfileAttachmentWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testDeleteProfileAttachmentWOptions(); + } + + // Test the deleteProfileAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteProfileAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.deleteProfileAttachment(null).execute(); + } + + // Test the getProfileAttachment operation with a valid options model parameter + @Test + public void testGetProfileAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"130003ea8bfa43c5aacea07a86da3000\", \"profile_id\": \"7ec45986-54fc-4b66-a303-d9577b078c65\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"instance_id\": \"edf9524f-406c-412c-acbb-ee371a5cabda\", \"scope\": [{\"environment\": \"environment\", \"properties\": [{\"name\": \"name\", \"value\": \"value\"}]}], \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"status\": \"enabled\", \"schedule\": \"daily\", \"notifications\": {\"enabled\": false, \"controls\": {\"threshold_limit\": 14, \"failed_control_ids\": [\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}}, \"attachment_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_value\": \"parameterValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}], \"last_scan\": {\"id\": \"e8a39d25-0051-4328-8462-988ad321f49a\", \"status\": \"in_progress\", \"time\": \"2019-01-01T12:00:00.000Z\"}, \"next_scan_time\": \"2019-01-01T12:00:00.000Z\", \"name\": \"account-130003ea8bfa43c5aacea07a86da3000\", \"description\": \"Test description\"}"; + String getProfileAttachmentPath = "/profiles/testString/attachments/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetProfileAttachmentOptions model + GetProfileAttachmentOptions getProfileAttachmentOptionsModel = new GetProfileAttachmentOptions.Builder() + .attachmentId("testString") + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getProfileAttachment() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getProfileAttachment(getProfileAttachmentOptionsModel).execute(); + assertNotNull(response); + AttachmentItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getProfileAttachmentPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getProfileAttachment operation with and without retries enabled + @Test + public void testGetProfileAttachmentWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetProfileAttachmentWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetProfileAttachmentWOptions(); + } + + // Test the getProfileAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProfileAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getProfileAttachment(null).execute(); + } + + // Test the replaceProfileAttachment operation with a valid options model parameter + @Test + public void testReplaceProfileAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"130003ea8bfa43c5aacea07a86da3000\", \"profile_id\": \"7ec45986-54fc-4b66-a303-d9577b078c65\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"instance_id\": \"edf9524f-406c-412c-acbb-ee371a5cabda\", \"scope\": [{\"environment\": \"environment\", \"properties\": [{\"name\": \"name\", \"value\": \"value\"}]}], \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"status\": \"enabled\", \"schedule\": \"daily\", \"notifications\": {\"enabled\": false, \"controls\": {\"threshold_limit\": 14, \"failed_control_ids\": [\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}}, \"attachment_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_value\": \"parameterValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}], \"last_scan\": {\"id\": \"e8a39d25-0051-4328-8462-988ad321f49a\", \"status\": \"in_progress\", \"time\": \"2019-01-01T12:00:00.000Z\"}, \"next_scan_time\": \"2019-01-01T12:00:00.000Z\", \"name\": \"account-130003ea8bfa43c5aacea07a86da3000\", \"description\": \"Test description\"}"; + String replaceProfileAttachmentPath = "/profiles/testString/attachments/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the PropertyItem model + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("scope_id") + .value("cg3335893hh1428692d6747cf300yeb5") + .build(); + + // Construct an instance of the MultiCloudScope model + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + + // Construct an instance of the FailedControls model + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + + // Construct an instance of the AttachmentsNotificationsPrototype model + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + + // Construct an instance of the AttachmentParameterPrototype model + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + + // Construct an instance of the LastScan model + LastScan lastScanModel = new LastScan.Builder() + .id("e8a39d25-0051-4328-8462-988ad321f49a") + .status("in_progress") + .time(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + + // Construct an instance of the ReplaceProfileAttachmentOptions model + ReplaceProfileAttachmentOptions replaceProfileAttachmentOptionsModel = new ReplaceProfileAttachmentOptions.Builder() + .attachmentId("testString") + .profilesId("testString") + .id("testString") + .profileId("testString") + .accountId("testString") + .instanceId("testString") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .lastScan(lastScanModel) + .nextScanTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke replaceProfileAttachment() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.replaceProfileAttachment(replaceProfileAttachmentOptionsModel).execute(); + assertNotNull(response); + AttachmentItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PUT"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, replaceProfileAttachmentPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the replaceProfileAttachment operation with and without retries enabled + @Test + public void testReplaceProfileAttachmentWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testReplaceProfileAttachmentWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testReplaceProfileAttachmentWOptions(); + } + + // Test the replaceProfileAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceProfileAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.replaceProfileAttachment(null).execute(); + } + + // Test the createScan operation with a valid options model parameter + @Test + public void testCreateScanWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"id\", \"account_id\": \"accountId\", \"attachment_id\": \"attachmentId\", \"report_id\": \"reportId\", \"status\": \"completed\", \"last_scan_time\": \"lastScanTime\", \"next_scan_time\": \"nextScanTime\", \"scan_type\": \"ondemand\", \"occurence\": 9}"; + String createScanPath = "/scans"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the CreateScanOptions model + CreateScanOptions createScanOptionsModel = new CreateScanOptions.Builder() + .attachmentId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke createScan() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.createScan(createScanOptionsModel).execute(); + assertNotNull(response); + Scan responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createScanPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the createScan operation with and without retries enabled + @Test + public void testCreateScanWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testCreateScanWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testCreateScanWOptions(); + } + + // Test the createScan operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateScanNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.createScan(null).execute(); + } + + // Test the listAttachmentsAccount operation with a valid options model parameter + @Test + public void testListAttachmentsAccountWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"total_count\": 1, \"limit\": 20, \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\", \"start\": \"start\"}, \"attachments\": [{\"id\": \"130003ea8bfa43c5aacea07a86da3000\", \"profile_id\": \"7ec45986-54fc-4b66-a303-d9577b078c65\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"instance_id\": \"edf9524f-406c-412c-acbb-ee371a5cabda\", \"scope\": [{\"environment\": \"environment\", \"properties\": [{\"name\": \"name\", \"value\": \"value\"}]}], \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"status\": \"enabled\", \"schedule\": \"daily\", \"notifications\": {\"enabled\": false, \"controls\": {\"threshold_limit\": 14, \"failed_control_ids\": [\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}}, \"attachment_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_value\": \"parameterValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}], \"last_scan\": {\"id\": \"e8a39d25-0051-4328-8462-988ad321f49a\", \"status\": \"in_progress\", \"time\": \"2019-01-01T12:00:00.000Z\"}, \"next_scan_time\": \"2019-01-01T12:00:00.000Z\", \"name\": \"account-130003ea8bfa43c5aacea07a86da3000\", \"description\": \"Test description\"}]}"; + String listAttachmentsAccountPath = "/attachments"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListAttachmentsAccountOptions model + ListAttachmentsAccountOptions listAttachmentsAccountOptionsModel = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .start("testString") + .build(); + + // Invoke listAttachmentsAccount() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listAttachmentsAccount(listAttachmentsAccountOptionsModel).execute(); + assertNotNull(response); + AttachmentCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listAttachmentsAccountPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("start"), "testString"); + } + + // Test the listAttachmentsAccount operation with and without retries enabled + @Test + public void testListAttachmentsAccountWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListAttachmentsAccountWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListAttachmentsAccountWOptions(); + } + + // Test the listAttachmentsAccount operation using the AttachmentsAccountPager.getNext() method + @Test + public void testListAttachmentsAccountWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListAttachmentsAccountOptions listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + AttachmentsAccountPager pager = new AttachmentsAccountPager(securityAndComplianceCenterApiService, listAttachmentsAccountOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listAttachmentsAccount operation using the AttachmentsAccountPager.getAll() method + @Test + public void testListAttachmentsAccountWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"start\":\"1\"},\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"attachments\":[{\"id\":\"130003ea8bfa43c5aacea07a86da3000\",\"profile_id\":\"7ec45986-54fc-4b66-a303-d9577b078c65\",\"account_id\":\"130003ea8bfa43c5aacea07a86da3000\",\"instance_id\":\"edf9524f-406c-412c-acbb-ee371a5cabda\",\"scope\":[{\"environment\":\"environment\",\"properties\":[{\"name\":\"name\",\"value\":\"value\"}]}],\"created_on\":\"2019-01-01T12:00:00.000Z\",\"created_by\":\"createdBy\",\"updated_on\":\"2019-01-01T12:00:00.000Z\",\"updated_by\":\"updatedBy\",\"status\":\"enabled\",\"schedule\":\"daily\",\"notifications\":{\"enabled\":false,\"controls\":{\"threshold_limit\":14,\"failed_control_ids\":[\"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\"]}},\"attachment_parameters\":[{\"assessment_type\":\"assessmentType\",\"assessment_id\":\"assessmentId\",\"parameter_name\":\"parameterName\",\"parameter_value\":\"parameterValue\",\"parameter_display_name\":\"parameterDisplayName\",\"parameter_type\":\"string\"}],\"last_scan\":{\"id\":\"e8a39d25-0051-4328-8462-988ad321f49a\",\"status\":\"in_progress\",\"time\":\"2019-01-01T12:00:00.000Z\"},\"next_scan_time\":\"2019-01-01T12:00:00.000Z\",\"name\":\"account-130003ea8bfa43c5aacea07a86da3000\",\"description\":\"Test description\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListAttachmentsAccountOptions listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) + .build(); + + AttachmentsAccountPager pager = new AttachmentsAccountPager(securityAndComplianceCenterApiService, listAttachmentsAccountOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getLatestReports operation with a valid options model parameter + @Test + public void testGetLatestReportsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"home_account_id\": \"homeAccountId\", \"controls_summary\": {\"status\": \"compliant\", \"total_count\": 150, \"compliant_count\": 130, \"not_compliant_count\": 5, \"unable_to_perform_count\": 5, \"user_evaluation_required_count\": 10}, \"evaluations_summary\": {\"status\": \"compliant\", \"total_count\": 140, \"pass_count\": 123, \"failure_count\": 12, \"error_count\": 5, \"completed_count\": 135}, \"score\": {\"passed\": 1, \"total_count\": 4, \"percent\": 25}, \"reports\": [{\"id\": \"44a5-a292-32114fa73558\", \"group_id\": \"55b6-b3A4-432250b84669\", \"created_on\": \"2022-08-15T12:30:01Z\", \"scan_time\": \"2022-08-15T12:30:01Z\", \"type\": \"scheduled\", \"cos_object\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/531fc3e28bfc43c5a2cea07786d93f5c:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:b1a8f3da-49d2-4966-ae83-a8d02bc2aac7\", \"instance_id\": \"84644a08-31b6-4988-b504-49a46ca69ccd\", \"account\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"NIST\", \"type\": \"account_type\"}, \"profile\": {\"id\": \"44a5-a292-32114fa73558\", \"name\": \"IBM FS Cloud\", \"version\": \"0.1\"}, \"attachment\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"resource group - Default\", \"description\": \"Scoped to the Default resource group\", \"schedule\": \"daily\", \"scope\": [{\"id\": \"ca0941aa-b7e2-43a3-9794-1b3d322474d9\", \"environment\": \"ibm-cloud\", \"properties\": [{\"name\": \"scope_id\", \"value\": \"18d32a4430e54c81a6668952609763b2\"}]}]}}]}"; + String getLatestReportsPath = "/reports/latest"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetLatestReportsOptions model + GetLatestReportsOptions getLatestReportsOptionsModel = new GetLatestReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .sort("profile_name") + .build(); + + // Invoke getLatestReports() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getLatestReports(getLatestReportsOptionsModel).execute(); + assertNotNull(response); + ReportLatest responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getLatestReportsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("sort"), "profile_name"); + } + + // Test the getLatestReports operation with and without retries enabled + @Test + public void testGetLatestReportsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetLatestReportsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetLatestReportsWOptions(); + } + + // Test the listReports operation with a valid options model parameter + @Test + public void testListReportsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"total_count\": 230, \"limit\": 50, \"start\": \"start\", \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\"}, \"home_account_id\": \"homeAccountId\", \"reports\": [{\"id\": \"44a5-a292-32114fa73558\", \"group_id\": \"55b6-b3A4-432250b84669\", \"created_on\": \"2022-08-15T12:30:01Z\", \"scan_time\": \"2022-08-15T12:30:01Z\", \"type\": \"scheduled\", \"cos_object\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/531fc3e28bfc43c5a2cea07786d93f5c:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:b1a8f3da-49d2-4966-ae83-a8d02bc2aac7\", \"instance_id\": \"84644a08-31b6-4988-b504-49a46ca69ccd\", \"account\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"NIST\", \"type\": \"account_type\"}, \"profile\": {\"id\": \"44a5-a292-32114fa73558\", \"name\": \"IBM FS Cloud\", \"version\": \"0.1\"}, \"attachment\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"resource group - Default\", \"description\": \"Scoped to the Default resource group\", \"schedule\": \"daily\", \"scope\": [{\"id\": \"ca0941aa-b7e2-43a3-9794-1b3d322474d9\", \"environment\": \"ibm-cloud\", \"properties\": [{\"name\": \"scope_id\", \"value\": \"18d32a4430e54c81a6668952609763b2\"}]}]}}]}"; + String listReportsPath = "/reports"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListReportsOptions model + ListReportsOptions listReportsOptionsModel = new ListReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .attachmentId("testString") + .groupId("testString") + .profileId("testString") + .type("scheduled") + .start("testString") + .limit(Long.valueOf("10")) + .sort("profile_name") + .build(); + + // Invoke listReports() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listReports(listReportsOptionsModel).execute(); + assertNotNull(response); + ReportPage responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listReportsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("attachment_id"), "testString"); + assertEquals(query.get("group_id"), "testString"); + assertEquals(query.get("profile_id"), "testString"); + assertEquals(query.get("type"), "scheduled"); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("sort"), "profile_name"); + } + + // Test the listReports operation with and without retries enabled + @Test + public void testListReportsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListReportsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListReportsWOptions(); + } + + // Test the listReports operation using the ReportsPager.getNext() method + @Test + public void testListReportsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reports\":[{\"id\":\"44a5-a292-32114fa73558\",\"group_id\":\"55b6-b3A4-432250b84669\",\"created_on\":\"2022-08-15T12:30:01Z\",\"scan_time\":\"2022-08-15T12:30:01Z\",\"type\":\"scheduled\",\"cos_object\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/531fc3e28bfc43c5a2cea07786d93f5c:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:b1a8f3da-49d2-4966-ae83-a8d02bc2aac7\",\"instance_id\":\"84644a08-31b6-4988-b504-49a46ca69ccd\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"profile\":{\"id\":\"44a5-a292-32114fa73558\",\"name\":\"IBM FS Cloud\",\"version\":\"0.1\"},\"attachment\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"resource group - Default\",\"description\":\"Scoped to the Default resource group\",\"schedule\":\"daily\",\"scope\":[{\"id\":\"ca0941aa-b7e2-43a3-9794-1b3d322474d9\",\"environment\":\"ibm-cloud\",\"properties\":[{\"name\":\"scope_id\",\"value\":\"18d32a4430e54c81a6668952609763b2\"}]}]}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reports\":[{\"id\":\"44a5-a292-32114fa73558\",\"group_id\":\"55b6-b3A4-432250b84669\",\"created_on\":\"2022-08-15T12:30:01Z\",\"scan_time\":\"2022-08-15T12:30:01Z\",\"type\":\"scheduled\",\"cos_object\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/531fc3e28bfc43c5a2cea07786d93f5c:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:b1a8f3da-49d2-4966-ae83-a8d02bc2aac7\",\"instance_id\":\"84644a08-31b6-4988-b504-49a46ca69ccd\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"profile\":{\"id\":\"44a5-a292-32114fa73558\",\"name\":\"IBM FS Cloud\",\"version\":\"0.1\"},\"attachment\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"resource group - Default\",\"description\":\"Scoped to the Default resource group\",\"schedule\":\"daily\",\"scope\":[{\"id\":\"ca0941aa-b7e2-43a3-9794-1b3d322474d9\",\"environment\":\"ibm-cloud\",\"properties\":[{\"name\":\"scope_id\",\"value\":\"18d32a4430e54c81a6668952609763b2\"}]}]}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListReportsOptions listReportsOptions = new ListReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .attachmentId("testString") + .groupId("testString") + .profileId("testString") + .type("scheduled") + .limit(Long.valueOf("10")) + .sort("profile_name") + .build(); + + List allResults = new ArrayList<>(); + ReportsPager pager = new ReportsPager(securityAndComplianceCenterApiService, listReportsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listReports operation using the ReportsPager.getAll() method + @Test + public void testListReportsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reports\":[{\"id\":\"44a5-a292-32114fa73558\",\"group_id\":\"55b6-b3A4-432250b84669\",\"created_on\":\"2022-08-15T12:30:01Z\",\"scan_time\":\"2022-08-15T12:30:01Z\",\"type\":\"scheduled\",\"cos_object\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/531fc3e28bfc43c5a2cea07786d93f5c:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:b1a8f3da-49d2-4966-ae83-a8d02bc2aac7\",\"instance_id\":\"84644a08-31b6-4988-b504-49a46ca69ccd\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"profile\":{\"id\":\"44a5-a292-32114fa73558\",\"name\":\"IBM FS Cloud\",\"version\":\"0.1\"},\"attachment\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"resource group - Default\",\"description\":\"Scoped to the Default resource group\",\"schedule\":\"daily\",\"scope\":[{\"id\":\"ca0941aa-b7e2-43a3-9794-1b3d322474d9\",\"environment\":\"ibm-cloud\",\"properties\":[{\"name\":\"scope_id\",\"value\":\"18d32a4430e54c81a6668952609763b2\"}]}]}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reports\":[{\"id\":\"44a5-a292-32114fa73558\",\"group_id\":\"55b6-b3A4-432250b84669\",\"created_on\":\"2022-08-15T12:30:01Z\",\"scan_time\":\"2022-08-15T12:30:01Z\",\"type\":\"scheduled\",\"cos_object\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/531fc3e28bfc43c5a2cea07786d93f5c:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:b1a8f3da-49d2-4966-ae83-a8d02bc2aac7\",\"instance_id\":\"84644a08-31b6-4988-b504-49a46ca69ccd\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"profile\":{\"id\":\"44a5-a292-32114fa73558\",\"name\":\"IBM FS Cloud\",\"version\":\"0.1\"},\"attachment\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"resource group - Default\",\"description\":\"Scoped to the Default resource group\",\"schedule\":\"daily\",\"scope\":[{\"id\":\"ca0941aa-b7e2-43a3-9794-1b3d322474d9\",\"environment\":\"ibm-cloud\",\"properties\":[{\"name\":\"scope_id\",\"value\":\"18d32a4430e54c81a6668952609763b2\"}]}]}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListReportsOptions listReportsOptions = new ListReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .attachmentId("testString") + .groupId("testString") + .profileId("testString") + .type("scheduled") + .limit(Long.valueOf("10")) + .sort("profile_name") + .build(); + + ReportsPager pager = new ReportsPager(securityAndComplianceCenterApiService, listReportsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getReport operation with a valid options model parameter + @Test + public void testGetReportWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"44a5-a292-32114fa73558\", \"group_id\": \"55b6-b3A4-432250b84669\", \"created_on\": \"2022-08-15T12:30:01Z\", \"scan_time\": \"2022-08-15T12:30:01Z\", \"type\": \"scheduled\", \"cos_object\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/531fc3e28bfc43c5a2cea07786d93f5c:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:b1a8f3da-49d2-4966-ae83-a8d02bc2aac7\", \"instance_id\": \"84644a08-31b6-4988-b504-49a46ca69ccd\", \"account\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"NIST\", \"type\": \"account_type\"}, \"profile\": {\"id\": \"44a5-a292-32114fa73558\", \"name\": \"IBM FS Cloud\", \"version\": \"0.1\"}, \"attachment\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"resource group - Default\", \"description\": \"Scoped to the Default resource group\", \"schedule\": \"daily\", \"scope\": [{\"id\": \"ca0941aa-b7e2-43a3-9794-1b3d322474d9\", \"environment\": \"ibm-cloud\", \"properties\": [{\"name\": \"scope_id\", \"value\": \"18d32a4430e54c81a6668952609763b2\"}]}]}}"; + String getReportPath = "/reports/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReportOptions model + GetReportOptions getReportOptionsModel = new GetReportOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getReport() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getReport(getReportOptionsModel).execute(); + assertNotNull(response); + Report responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReportPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getReport operation with and without retries enabled + @Test + public void testGetReportWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetReportWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetReportWOptions(); + } + + // Test the getReport operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getReport(null).execute(); + } + + // Test the getReportSummary operation with a valid options model parameter + @Test + public void testGetReportSummaryWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"report_id\": \"30b434b3-cb08-4845-af10-7a8fc682b6a8\", \"isntance_id\": \"84644a08-31b6-4988-b504-49a46ca69ccd\", \"account\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"NIST\", \"type\": \"account_type\"}, \"score\": {\"passed\": 1, \"total_count\": 4, \"percent\": 25}, \"controls\": {\"status\": \"compliant\", \"total_count\": 150, \"compliant_count\": 130, \"not_compliant_count\": 5, \"unable_to_perform_count\": 5, \"user_evaluation_required_count\": 10}, \"evaluations\": {\"status\": \"compliant\", \"total_count\": 140, \"pass_count\": 123, \"failure_count\": 12, \"error_count\": 5, \"completed_count\": 135}, \"resources\": {\"status\": \"compliant\", \"total_count\": 150, \"compliant_count\": 130, \"not_compliant_count\": 5, \"unable_to_perform_count\": 5, \"user_evaluation_required_count\": 10, \"top_failed\": [{\"name\": \"my-bucket\", \"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"service\": \"cloud-object-storage\", \"tags\": {\"user\": [\"user\"], \"access\": [\"access\"], \"service\": [\"service\"]}, \"account\": \"59bcbfa6ea2f006b4ed7094c1a08dcdd\", \"status\": \"compliant\", \"total_count\": 140, \"pass_count\": 123, \"failure_count\": 12, \"error_count\": 5, \"completed_count\": 135}]}}"; + String getReportSummaryPath = "/reports/testString/summary"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReportSummaryOptions model + GetReportSummaryOptions getReportSummaryOptionsModel = new GetReportSummaryOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getReportSummary() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getReportSummary(getReportSummaryOptionsModel).execute(); + assertNotNull(response); + ReportSummary responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReportSummaryPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getReportSummary operation with and without retries enabled + @Test + public void testGetReportSummaryWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetReportSummaryWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetReportSummaryWOptions(); + } + + // Test the getReportSummary operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportSummaryNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getReportSummary(null).execute(); + } + + // Test the getReportEvaluation operation with a valid options model parameter + @Test + public void testGetReportEvaluationWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "This is a mock binary response."; + String getReportEvaluationPath = "/reports/testString/download"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/csv") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReportEvaluationOptions model + GetReportEvaluationOptions getReportEvaluationOptionsModel = new GetReportEvaluationOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .excludeSummary(true) + .build(); + + // Invoke getReportEvaluation() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getReportEvaluation(getReportEvaluationOptionsModel).execute(); + assertNotNull(response); + InputStream responseObj = response.getResult(); + assertNotNull(responseObj); + responseObj.close(); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReportEvaluationPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(Boolean.valueOf(query.get("exclude_summary")), Boolean.valueOf(true)); + } + + // Test the getReportEvaluation operation with and without retries enabled + @Test + public void testGetReportEvaluationWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetReportEvaluationWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetReportEvaluationWOptions(); + } + + // Test the getReportEvaluation operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportEvaluationNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getReportEvaluation(null).execute(); + } + + // Test the getReportControls operation with a valid options model parameter + @Test + public void testGetReportControlsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"status\": \"compliant\", \"total_count\": 150, \"compliant_count\": 130, \"not_compliant_count\": 5, \"unable_to_perform_count\": 5, \"user_evaluation_required_count\": 10, \"home_account_id\": \"homeAccountId\", \"report_id\": \"reportId\", \"controls\": [{\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"control_library_id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"control_library_version\": \"v1.2.3\", \"control_name\": \"Password Management\", \"control_description\": \"Password Management\", \"control_category\": \"Access Control\", \"control_path\": \"AC-2(a)\", \"control_specifications\": [{\"control_specification_id\": \"18d32a4430e54c81a6668952609763b2\", \"component_id\": \"cloud-object_storage\", \"control_specification_description\": \"Check whether Cloud Object Storage is accessible only by using private endpoints\", \"environment\": \"ibm cloud\", \"responsibility\": \"user\", \"assessments\": [{\"assessment_id\": \"382c2b06-e6b2-43ee-b189-c1c7743b67ee\", \"assessment_type\": \"ibm-cloud-rule\", \"assessment_method\": \"ibm-cloud-rule\", \"assessment_description\": \"Check whether Cloud Object Storage is accessible only by using private endpoints\", \"parameter_count\": 1, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}], \"status\": \"compliant\", \"total_count\": 150, \"compliant_count\": 130, \"not_compliant_count\": 5, \"unable_to_perform_count\": 5, \"user_evaluation_required_count\": 10}], \"status\": \"compliant\", \"total_count\": 150, \"compliant_count\": 130, \"not_compliant_count\": 5, \"unable_to_perform_count\": 5, \"user_evaluation_required_count\": 10}]}"; + String getReportControlsPath = "/reports/testString/controls"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReportControlsOptions model + GetReportControlsOptions getReportControlsOptionsModel = new GetReportControlsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .controlId("testString") + .controlName("testString") + .controlDescription("testString") + .controlCategory("testString") + .status("compliant") + .sort("control_name") + .build(); + + // Invoke getReportControls() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getReportControls(getReportControlsOptionsModel).execute(); + assertNotNull(response); + ReportControls responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReportControlsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("control_id"), "testString"); + assertEquals(query.get("control_name"), "testString"); + assertEquals(query.get("control_description"), "testString"); + assertEquals(query.get("control_category"), "testString"); + assertEquals(query.get("status"), "compliant"); + assertEquals(query.get("sort"), "control_name"); + } + + // Test the getReportControls operation with and without retries enabled + @Test + public void testGetReportControlsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetReportControlsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetReportControlsWOptions(); + } + + // Test the getReportControls operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportControlsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getReportControls(null).execute(); + } + + // Test the getReportRule operation with a valid options model parameter + @Test + public void testGetReportRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"rule-7b0560a4-df94-4629-bb76-680f3155ddda\", \"type\": \"user_defined/system_defined\", \"description\": \"rule\", \"version\": \"1.2.3\", \"account_id\": \"59bcbfa6ea2f006b4ed7094c1a08dcdd\", \"created_on\": \"2022-08-15T12:30:01Z\", \"created_by\": \"IBMid-12345\", \"updated_on\": \"2022-08-15T12:30:01Z\", \"updated_by\": \"IBMid-12345\", \"labels\": [\"labels\"]}"; + String getReportRulePath = "/reports/testString/rules/rule-8d444f8c-fd1d-48de-bcaa-f43732568761"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReportRuleOptions model + GetReportRuleOptions getReportRuleOptionsModel = new GetReportRuleOptions.Builder() + .reportId("testString") + .ruleId("rule-8d444f8c-fd1d-48de-bcaa-f43732568761") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getReportRule() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getReportRule(getReportRuleOptionsModel).execute(); + assertNotNull(response); + RuleInfo responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReportRulePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getReportRule operation with and without retries enabled + @Test + public void testGetReportRuleWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetReportRuleWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetReportRuleWOptions(); + } + + // Test the getReportRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getReportRule(null).execute(); + } + + // Test the listReportEvaluations operation with a valid options model parameter + @Test + public void testListReportEvaluationsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"total_count\": 230, \"limit\": 50, \"start\": \"start\", \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\"}, \"home_account_id\": \"homeAccountId\", \"report_id\": \"reportId\", \"evaluations\": [{\"home_account_id\": \"be200c80cabc456e91139e4152327456\", \"report_id\": \"44a5-a292-32114fa73558\", \"control_id\": \"28016c95-b389-447f-8a05-eabe1ad7fd24\", \"component_id\": \"cloud-object_storage\", \"assessment\": {\"assessment_id\": \"382c2b06-e6b2-43ee-b189-c1c7743b67ee\", \"assessment_type\": \"ibm-cloud-rule\", \"assessment_method\": \"ibm-cloud-rule\", \"assessment_description\": \"Check whether Cloud Object Storage is accessible only by using private endpoints\", \"parameter_count\": 1, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}, \"evaluate_time\": \"2022-06-30T11:03:44.630150782Z\", \"target\": {\"id\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\", \"account_id\": \"59bcbfa6ea2f006b4ed7094c1a08dcdd\", \"resource_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\", \"resource_name\": \"mybucket\", \"service_name\": \"cloud-object-storage\"}, \"status\": \"failure\", \"reason\": \"One or more conditions in rule rule-7b0560a4-df94-4629-bb76-680f3155ddda were not met\", \"details\": {\"properties\": [{\"property\": \"allowed_network\", \"property_description\": \"A description for this property\", \"operator\": \"string_equals\", \"expected_value\": \"anyValue\", \"found_value\": \"anyValue\"}]}}]}"; + String listReportEvaluationsPath = "/reports/testString/evaluations"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListReportEvaluationsOptions model + ListReportEvaluationsOptions listReportEvaluationsOptionsModel = new ListReportEvaluationsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .assessmentId("testString") + .componentId("testString") + .targetId("testString") + .targetName("testString") + .status("failure") + .start("testString") + .limit(Long.valueOf("10")) + .build(); + + // Invoke listReportEvaluations() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listReportEvaluations(listReportEvaluationsOptionsModel).execute(); + assertNotNull(response); + EvaluationPage responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listReportEvaluationsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("assessment_id"), "testString"); + assertEquals(query.get("component_id"), "testString"); + assertEquals(query.get("target_id"), "testString"); + assertEquals(query.get("target_name"), "testString"); + assertEquals(query.get("status"), "failure"); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + } + + // Test the listReportEvaluations operation with and without retries enabled + @Test + public void testListReportEvaluationsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListReportEvaluationsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListReportEvaluationsWOptions(); + } + + // Test the listReportEvaluations operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListReportEvaluationsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.listReportEvaluations(null).execute(); + } + + // Test the listReportEvaluations operation using the ReportEvaluationsPager.getNext() method + @Test + public void testListReportEvaluationsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"evaluations\":[{\"home_account_id\":\"be200c80cabc456e91139e4152327456\",\"report_id\":\"44a5-a292-32114fa73558\",\"control_id\":\"28016c95-b389-447f-8a05-eabe1ad7fd24\",\"component_id\":\"cloud-object_storage\",\"assessment\":{\"assessment_id\":\"382c2b06-e6b2-43ee-b189-c1c7743b67ee\",\"assessment_type\":\"ibm-cloud-rule\",\"assessment_method\":\"ibm-cloud-rule\",\"assessment_description\":\"Check whether Cloud Object Storage is accessible only by using private endpoints\",\"parameter_count\":1,\"parameters\":[{\"parameter_name\":\"location\",\"parameter_display_name\":\"Location\",\"parameter_type\":\"string\",\"parameter_value\":\"anyValue\"}]},\"evaluate_time\":\"2022-06-30T11:03:44.630150782Z\",\"target\":{\"id\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"account_id\":\"59bcbfa6ea2f006b4ed7094c1a08dcdd\",\"resource_crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"resource_name\":\"mybucket\",\"service_name\":\"cloud-object-storage\"},\"status\":\"failure\",\"reason\":\"One or more conditions in rule rule-7b0560a4-df94-4629-bb76-680f3155ddda were not met\",\"details\":{\"properties\":[{\"property\":\"allowed_network\",\"property_description\":\"A description for this property\",\"operator\":\"string_equals\",\"expected_value\":\"anyValue\",\"found_value\":\"anyValue\"}]}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"evaluations\":[{\"home_account_id\":\"be200c80cabc456e91139e4152327456\",\"report_id\":\"44a5-a292-32114fa73558\",\"control_id\":\"28016c95-b389-447f-8a05-eabe1ad7fd24\",\"component_id\":\"cloud-object_storage\",\"assessment\":{\"assessment_id\":\"382c2b06-e6b2-43ee-b189-c1c7743b67ee\",\"assessment_type\":\"ibm-cloud-rule\",\"assessment_method\":\"ibm-cloud-rule\",\"assessment_description\":\"Check whether Cloud Object Storage is accessible only by using private endpoints\",\"parameter_count\":1,\"parameters\":[{\"parameter_name\":\"location\",\"parameter_display_name\":\"Location\",\"parameter_type\":\"string\",\"parameter_value\":\"anyValue\"}]},\"evaluate_time\":\"2022-06-30T11:03:44.630150782Z\",\"target\":{\"id\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"account_id\":\"59bcbfa6ea2f006b4ed7094c1a08dcdd\",\"resource_crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"resource_name\":\"mybucket\",\"service_name\":\"cloud-object-storage\"},\"status\":\"failure\",\"reason\":\"One or more conditions in rule rule-7b0560a4-df94-4629-bb76-680f3155ddda were not met\",\"details\":{\"properties\":[{\"property\":\"allowed_network\",\"property_description\":\"A description for this property\",\"operator\":\"string_equals\",\"expected_value\":\"anyValue\",\"found_value\":\"anyValue\"}]}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListReportEvaluationsOptions listReportEvaluationsOptions = new ListReportEvaluationsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .assessmentId("testString") + .componentId("testString") + .targetId("testString") + .targetName("testString") + .status("failure") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + ReportEvaluationsPager pager = new ReportEvaluationsPager(securityAndComplianceCenterApiService, listReportEvaluationsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listReportEvaluations operation using the ReportEvaluationsPager.getAll() method + @Test + public void testListReportEvaluationsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"evaluations\":[{\"home_account_id\":\"be200c80cabc456e91139e4152327456\",\"report_id\":\"44a5-a292-32114fa73558\",\"control_id\":\"28016c95-b389-447f-8a05-eabe1ad7fd24\",\"component_id\":\"cloud-object_storage\",\"assessment\":{\"assessment_id\":\"382c2b06-e6b2-43ee-b189-c1c7743b67ee\",\"assessment_type\":\"ibm-cloud-rule\",\"assessment_method\":\"ibm-cloud-rule\",\"assessment_description\":\"Check whether Cloud Object Storage is accessible only by using private endpoints\",\"parameter_count\":1,\"parameters\":[{\"parameter_name\":\"location\",\"parameter_display_name\":\"Location\",\"parameter_type\":\"string\",\"parameter_value\":\"anyValue\"}]},\"evaluate_time\":\"2022-06-30T11:03:44.630150782Z\",\"target\":{\"id\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"account_id\":\"59bcbfa6ea2f006b4ed7094c1a08dcdd\",\"resource_crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"resource_name\":\"mybucket\",\"service_name\":\"cloud-object-storage\"},\"status\":\"failure\",\"reason\":\"One or more conditions in rule rule-7b0560a4-df94-4629-bb76-680f3155ddda were not met\",\"details\":{\"properties\":[{\"property\":\"allowed_network\",\"property_description\":\"A description for this property\",\"operator\":\"string_equals\",\"expected_value\":\"anyValue\",\"found_value\":\"anyValue\"}]}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"evaluations\":[{\"home_account_id\":\"be200c80cabc456e91139e4152327456\",\"report_id\":\"44a5-a292-32114fa73558\",\"control_id\":\"28016c95-b389-447f-8a05-eabe1ad7fd24\",\"component_id\":\"cloud-object_storage\",\"assessment\":{\"assessment_id\":\"382c2b06-e6b2-43ee-b189-c1c7743b67ee\",\"assessment_type\":\"ibm-cloud-rule\",\"assessment_method\":\"ibm-cloud-rule\",\"assessment_description\":\"Check whether Cloud Object Storage is accessible only by using private endpoints\",\"parameter_count\":1,\"parameters\":[{\"parameter_name\":\"location\",\"parameter_display_name\":\"Location\",\"parameter_type\":\"string\",\"parameter_value\":\"anyValue\"}]},\"evaluate_time\":\"2022-06-30T11:03:44.630150782Z\",\"target\":{\"id\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"account_id\":\"59bcbfa6ea2f006b4ed7094c1a08dcdd\",\"resource_crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:mybucket\",\"resource_name\":\"mybucket\",\"service_name\":\"cloud-object-storage\"},\"status\":\"failure\",\"reason\":\"One or more conditions in rule rule-7b0560a4-df94-4629-bb76-680f3155ddda were not met\",\"details\":{\"properties\":[{\"property\":\"allowed_network\",\"property_description\":\"A description for this property\",\"operator\":\"string_equals\",\"expected_value\":\"anyValue\",\"found_value\":\"anyValue\"}]}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListReportEvaluationsOptions listReportEvaluationsOptions = new ListReportEvaluationsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .assessmentId("testString") + .componentId("testString") + .targetId("testString") + .targetName("testString") + .status("failure") + .limit(Long.valueOf("10")) + .build(); + + ReportEvaluationsPager pager = new ReportEvaluationsPager(securityAndComplianceCenterApiService, listReportEvaluationsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the listReportResources operation with a valid options model parameter + @Test + public void testListReportResourcesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"total_count\": 230, \"limit\": 50, \"start\": \"start\", \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\"}, \"home_account_id\": \"homeAccountId\", \"report_id\": \"reportId\", \"resources\": [{\"report_id\": \"30b434b3-cb08-4845-af10-7a8fc682b6a8\", \"id\": \"crn:v1:bluemix:public:kms:us-south:a/5af747ca19a8a278b1b6e4eec20df507:03502a50-4ea9-463c-80e5-e27ed838cdb6::\", \"resource_name\": \"jeff's key\", \"component_id\": \"cloud-object_storage\", \"environment\": \"ibm cloud\", \"account\": {\"id\": \"531fc3e28bfc43c5a2cea07786d93f5c\", \"name\": \"NIST\", \"type\": \"account_type\"}, \"status\": \"compliant\", \"total_count\": 140, \"pass_count\": 123, \"failure_count\": 12, \"error_count\": 5, \"completed_count\": 135}]}"; + String listReportResourcesPath = "/reports/testString/resources"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListReportResourcesOptions model + ListReportResourcesOptions listReportResourcesOptionsModel = new ListReportResourcesOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .id("testString") + .resourceName("testString") + .accountId("testString") + .componentId("testString") + .status("compliant") + .sort("account_id") + .start("testString") + .limit(Long.valueOf("10")) + .build(); + + // Invoke listReportResources() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listReportResources(listReportResourcesOptionsModel).execute(); + assertNotNull(response); + ResourcePage responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listReportResourcesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("id"), "testString"); + assertEquals(query.get("resource_name"), "testString"); + assertEquals(query.get("account_id"), "testString"); + assertEquals(query.get("component_id"), "testString"); + assertEquals(query.get("status"), "compliant"); + assertEquals(query.get("sort"), "account_id"); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + } + + // Test the listReportResources operation with and without retries enabled + @Test + public void testListReportResourcesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListReportResourcesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListReportResourcesWOptions(); + } + + // Test the listReportResources operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListReportResourcesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.listReportResources(null).execute(); + } + + // Test the listReportResources operation using the ReportResourcesPager.getNext() method + @Test + public void testListReportResourcesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"resources\":[{\"report_id\":\"30b434b3-cb08-4845-af10-7a8fc682b6a8\",\"id\":\"crn:v1:bluemix:public:kms:us-south:a/5af747ca19a8a278b1b6e4eec20df507:03502a50-4ea9-463c-80e5-e27ed838cdb6::\",\"resource_name\":\"jeff's key\",\"component_id\":\"cloud-object_storage\",\"environment\":\"ibm cloud\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"status\":\"compliant\",\"total_count\":140,\"pass_count\":123,\"failure_count\":12,\"error_count\":5,\"completed_count\":135}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"resources\":[{\"report_id\":\"30b434b3-cb08-4845-af10-7a8fc682b6a8\",\"id\":\"crn:v1:bluemix:public:kms:us-south:a/5af747ca19a8a278b1b6e4eec20df507:03502a50-4ea9-463c-80e5-e27ed838cdb6::\",\"resource_name\":\"jeff's key\",\"component_id\":\"cloud-object_storage\",\"environment\":\"ibm cloud\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"status\":\"compliant\",\"total_count\":140,\"pass_count\":123,\"failure_count\":12,\"error_count\":5,\"completed_count\":135}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListReportResourcesOptions listReportResourcesOptions = new ListReportResourcesOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .id("testString") + .resourceName("testString") + .accountId("testString") + .componentId("testString") + .status("compliant") + .sort("account_id") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + ReportResourcesPager pager = new ReportResourcesPager(securityAndComplianceCenterApiService, listReportResourcesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listReportResources operation using the ReportResourcesPager.getAll() method + @Test + public void testListReportResourcesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"resources\":[{\"report_id\":\"30b434b3-cb08-4845-af10-7a8fc682b6a8\",\"id\":\"crn:v1:bluemix:public:kms:us-south:a/5af747ca19a8a278b1b6e4eec20df507:03502a50-4ea9-463c-80e5-e27ed838cdb6::\",\"resource_name\":\"jeff's key\",\"component_id\":\"cloud-object_storage\",\"environment\":\"ibm cloud\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"status\":\"compliant\",\"total_count\":140,\"pass_count\":123,\"failure_count\":12,\"error_count\":5,\"completed_count\":135}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"resources\":[{\"report_id\":\"30b434b3-cb08-4845-af10-7a8fc682b6a8\",\"id\":\"crn:v1:bluemix:public:kms:us-south:a/5af747ca19a8a278b1b6e4eec20df507:03502a50-4ea9-463c-80e5-e27ed838cdb6::\",\"resource_name\":\"jeff's key\",\"component_id\":\"cloud-object_storage\",\"environment\":\"ibm cloud\",\"account\":{\"id\":\"531fc3e28bfc43c5a2cea07786d93f5c\",\"name\":\"NIST\",\"type\":\"account_type\"},\"status\":\"compliant\",\"total_count\":140,\"pass_count\":123,\"failure_count\":12,\"error_count\":5,\"completed_count\":135}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListReportResourcesOptions listReportResourcesOptions = new ListReportResourcesOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .id("testString") + .resourceName("testString") + .accountId("testString") + .componentId("testString") + .status("compliant") + .sort("account_id") + .limit(Long.valueOf("10")) + .build(); + + ReportResourcesPager pager = new ReportResourcesPager(securityAndComplianceCenterApiService, listReportResourcesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getReportTags operation with a valid options model parameter + @Test + public void testGetReportTagsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"report_id\": \"reportId\", \"tags\": {\"user\": [\"user\"], \"access\": [\"access\"], \"service\": [\"service\"]}}"; + String getReportTagsPath = "/reports/testString/tags"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReportTagsOptions model + GetReportTagsOptions getReportTagsOptionsModel = new GetReportTagsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getReportTags() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getReportTags(getReportTagsOptionsModel).execute(); + assertNotNull(response); + ReportTags responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReportTagsPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getReportTags operation with and without retries enabled + @Test + public void testGetReportTagsWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetReportTagsWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetReportTagsWOptions(); + } + + // Test the getReportTags operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportTagsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getReportTags(null).execute(); + } + + // Test the getReportViolationsDrift operation with a valid options model parameter + @Test + public void testGetReportViolationsDriftWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"home_account_id\": \"homeAccountId\", \"report_id\": \"reportId\", \"data_points\": [{\"report_id\": \"30b434b3-cb08-4845-af10-7a8fc682b6a8\", \"report_group_id\": \"55b6-b3A4-432250b84669\", \"scan_time\": \"2022-08-15T12:30:01Z\", \"controls\": {\"status\": \"compliant\", \"total_count\": 150, \"compliant_count\": 130, \"not_compliant_count\": 5, \"unable_to_perform_count\": 5, \"user_evaluation_required_count\": 10}}]}"; + String getReportViolationsDriftPath = "/reports/testString/violations_drift"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReportViolationsDriftOptions model + GetReportViolationsDriftOptions getReportViolationsDriftOptionsModel = new GetReportViolationsDriftOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .scanTimeDuration(Long.valueOf("0")) + .build(); + + // Invoke getReportViolationsDrift() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getReportViolationsDrift(getReportViolationsDriftOptionsModel).execute(); + assertNotNull(response); + ReportViolationsDrift responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReportViolationsDriftPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(Long.valueOf(query.get("scan_time_duration")), Long.valueOf("0")); + } + + // Test the getReportViolationsDrift operation with and without retries enabled + @Test + public void testGetReportViolationsDriftWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetReportViolationsDriftWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetReportViolationsDriftWOptions(); + } + + // Test the getReportViolationsDrift operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportViolationsDriftNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getReportViolationsDrift(null).execute(); + } + + // Test the listProviderTypes operation with a valid options model parameter + @Test + public void testListProviderTypesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"provider_types\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection\", \"description\": \"Security and Compliance Center Workload Protection helps you accelerate your Kubernetes and cloud adoption by addressing security and regulatory compliance. Easily identify vulnerabilities, check compliance, block threats and respond faster at every stage of the container and Kubernetes lifecycle.\", \"s2s_enabled\": true, \"instance_limit\": 1, \"mode\": \"PULL\", \"data_type\": \"com.sysdig.secure.results\", \"icon\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBkYXRhLW5hbWU9IkJ1aWxkIGljb24gaGVyZSIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSItMjgxMS4xOTgiIHgyPSItMjgxNC4xOTgiIHkxPSI1NTcuNTE3IiB5Mj0iNTU3LjUxNyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyODMxLjE5OCAtNTQyLjAxNykiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLW9wYWNpdHk9IjAiLz48c3RvcCBvZmZzZXQ9Ii44Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgeGxpbms6aHJlZj0iI2EiIGlkPSJiIiB4MT0iLTgwNi4xOTgiIHgyPSItNzk5LjE5OCIgeTE9Ii0yNDE0LjQ4MSIgeTI9Ii0yNDE0LjQ4MSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4MjUuMTk4IDI0MjguOTgxKSIvPjxsaW5lYXJHcmFkaWVudCB4bGluazpocmVmPSIjYSIgaWQ9ImMiIHgxPSItODEwLjE5OCIgeDI9Ii03OTguMTk4IiB5MT0iLTI0MTkuOTgxIiB5Mj0iLTI0MTkuOTgxIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDgzMi4xOTggMjQzMi45ODEpIi8+PGxpbmVhckdyYWRpZW50IGlkPSJlIiB4MT0iLTI1MTQiIHgyPSItMjQ4MiIgeTE9Ii0yNDgyIiB5Mj0iLTI1MTQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMjUxNCAtMjQ4MikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLWNvbG9yPSIjMDhiZGJhIi8+PHN0b3Agb2Zmc2V0PSIuOSIgc3RvcC1jb2xvcj0iIzBmNjJmZSIvPjwvbGluZWFyR3JhZGllbnQ+PG1hc2sgaWQ9ImQiIHdpZHRoPSIyOS4wMTciIGhlaWdodD0iMjcuOTk2IiB4PSIxLjk4MyIgeT0iMiIgZGF0YS1uYW1lPSJtYXNrIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMjkuOTc2IDE2YzAtMy43MzktMS40NTYtNy4yNTUtNC4xMDEtOS44OTlTMTkuNzE1IDIgMTUuOTc2IDIgOC43MjEgMy40NTYgNi4wNzcgNi4xMDFjLTUuNDU5IDUuNDU5LTUuNDU5IDE0LjM0IDAgMTkuNzk4QTE0LjA0NCAxNC4wNDQgMCAwIDAgMTYgMjkuOTk1di0yLjAwMWExMi4wNCAxMi4wNCAwIDAgMS04LjUwOS0zLjUxYy00LjY3OS00LjY3OS00LjY3OS0xMi4yOTIgMC0xNi45NzEgMi4yNjctMi4yNjcgNS4yOC0zLjUxNSA4LjQ4NS0zLjUxNXM2LjIxOSAxLjI0OCA4LjQ4NSAzLjUxNSAzLjUxNSA1LjI4IDMuNTE1IDguNDg1YzAgMS4zMDgtLjIxOCAyLjU4LS42MTggMy43ODZsMS44OTcuNjMyYy40NjctMS40MDguNzIyLTIuODkyLjcyMi00LjQxOFoiLz48cGF0aCBkPSJNMjQuNyAxMy42NzVhOC45NCA4Ljk0IDAgMCAwLTQuMTkzLTUuNDY1IDguOTQyIDguOTQyIDAgMCAwLTYuODMtLjg5OSA4Ljk3MSA4Ljk3MSAwIDAgMC01LjQ2MSA0LjE5NSA4Ljk4IDguOTggMCAwIDAtLjkwMyA2LjgyOGMxLjA3NyA0LjAxNiA0LjcyMiA2LjY2IDguNjk1IDYuNjYxdi0xLjk5OGMtMy4wOS0uMDAxLTUuOTI2LTIuMDU4LTYuNzYzLTUuMTgxYTcuMDEgNy4wMSAwIDAgMSA0Ljk1LTguNTc0IDYuOTU4IDYuOTU4IDAgMCAxIDUuMzEyLjY5OSA2Ljk1NCA2Ljk1NCAwIDAgMSAzLjI2MSA0LjI1Yy4zNTkgMS4zNDIuMjc1IDIuNzMyLS4xNTQgNC4wMTNsMS45MDkuNjM2YTguOTU5IDguOTU5IDAgMCAwIC4xNzYtNS4xNjdaIi8+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xNCAxNmMwLTEuMTAzLjg5Ny0yIDItMnMyIC44OTcgMiAyYTIgMiAwIDAgMS0uMTExLjYzbDEuODg5LjYzYy4xMzMtLjM5OC4yMjItLjgxNy4yMjItMS4yNTlhNCA0IDAgMSAwLTQgNHYtMmMtMS4xMDMgMC0yLS44OTctMi0yWiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNyAxNGgzdjNoLTN6IiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTguNSAxNS41KSIvPjxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0xOSAxMmg3djVoLTd6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyMi41IDE0LjUpIi8+PHBhdGggZmlsbD0idXJsKCNjKSIgZD0iTTIyIDEwaDEydjZIMjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyOCAxMykiLz48cGF0aCBkPSJNMjUgMTloNnY0aC02ek0yMCAxOGg1djVoLTV6TTE3IDE3aDN2NmgtM3oiLz48L21hc2s+PC9kZWZzPjxwYXRoIGZpbGw9IiMwMDFkNmMiIGQ9Im0yNSAzMS4wMDEtMi4xMzktMS4wMTNBNS4wMjIgNS4wMjIgMCAwIDEgMjAgMjUuNDY4VjE5aDEwdjYuNDY4YTUuMDIzIDUuMDIzIDAgMCAxLTIuODYxIDQuNTJMMjUgMzEuMDAxWm0tMy0xMHY0LjQ2OGMwIDEuMTUzLjY3NCAyLjIxOCAxLjcxNyAyLjcxMWwxLjI4My42MDcgMS4yODMtLjYwN0EzLjAxMiAzLjAxMiAwIDAgMCAyOCAyNS40Njl2LTQuNDY4aC02WiIgZGF0YS1uYW1lPSJ1dWlkLTU1ODMwNDRiLWZmMjQtNGUyNy05MDU0LTI0MDQzYWRkZmMwNiIvPjxnIG1hc2s9InVybCgjZCkiPjxwYXRoIGZpbGw9InVybCgjZSkiIGQ9Ik0wIDBoMzJ2MzJIMHoiIHRyYW5zZm9ybT0icm90YXRlKC05MCAxNiAxNikiLz48L2c+PC9zdmc+\", \"label\": {\"text\": \"1 per instance\", \"tip\": \"Only 1 per instance\"}, \"attributes\": {\"mapKey\": {\"type\": \"text\", \"display_name\": \"Workload Protection Instance CRN\"}}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; + String listProviderTypesPath = "/provider_types"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListProviderTypesOptions model + ListProviderTypesOptions listProviderTypesOptionsModel = new ListProviderTypesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke listProviderTypes() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listProviderTypes(listProviderTypesOptionsModel).execute(); + assertNotNull(response); + ProviderTypesCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listProviderTypesPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the listProviderTypes operation with and without retries enabled + @Test + public void testListProviderTypesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListProviderTypesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListProviderTypesWOptions(); + } + + // Test the getProviderTypeById operation with a valid options model parameter + @Test + public void testGetProviderTypeByIdWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection\", \"description\": \"Security and Compliance Center Workload Protection helps you accelerate your Kubernetes and cloud adoption by addressing security and regulatory compliance. Easily identify vulnerabilities, check compliance, block threats and respond faster at every stage of the container and Kubernetes lifecycle.\", \"s2s_enabled\": true, \"instance_limit\": 1, \"mode\": \"PULL\", \"data_type\": \"com.sysdig.secure.results\", \"icon\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBkYXRhLW5hbWU9IkJ1aWxkIGljb24gaGVyZSIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSItMjgxMS4xOTgiIHgyPSItMjgxNC4xOTgiIHkxPSI1NTcuNTE3IiB5Mj0iNTU3LjUxNyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyODMxLjE5OCAtNTQyLjAxNykiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLW9wYWNpdHk9IjAiLz48c3RvcCBvZmZzZXQ9Ii44Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgeGxpbms6aHJlZj0iI2EiIGlkPSJiIiB4MT0iLTgwNi4xOTgiIHgyPSItNzk5LjE5OCIgeTE9Ii0yNDE0LjQ4MSIgeTI9Ii0yNDE0LjQ4MSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4MjUuMTk4IDI0MjguOTgxKSIvPjxsaW5lYXJHcmFkaWVudCB4bGluazpocmVmPSIjYSIgaWQ9ImMiIHgxPSItODEwLjE5OCIgeDI9Ii03OTguMTk4IiB5MT0iLTI0MTkuOTgxIiB5Mj0iLTI0MTkuOTgxIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDgzMi4xOTggMjQzMi45ODEpIi8+PGxpbmVhckdyYWRpZW50IGlkPSJlIiB4MT0iLTI1MTQiIHgyPSItMjQ4MiIgeTE9Ii0yNDgyIiB5Mj0iLTI1MTQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMjUxNCAtMjQ4MikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLWNvbG9yPSIjMDhiZGJhIi8+PHN0b3Agb2Zmc2V0PSIuOSIgc3RvcC1jb2xvcj0iIzBmNjJmZSIvPjwvbGluZWFyR3JhZGllbnQ+PG1hc2sgaWQ9ImQiIHdpZHRoPSIyOS4wMTciIGhlaWdodD0iMjcuOTk2IiB4PSIxLjk4MyIgeT0iMiIgZGF0YS1uYW1lPSJtYXNrIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMjkuOTc2IDE2YzAtMy43MzktMS40NTYtNy4yNTUtNC4xMDEtOS44OTlTMTkuNzE1IDIgMTUuOTc2IDIgOC43MjEgMy40NTYgNi4wNzcgNi4xMDFjLTUuNDU5IDUuNDU5LTUuNDU5IDE0LjM0IDAgMTkuNzk4QTE0LjA0NCAxNC4wNDQgMCAwIDAgMTYgMjkuOTk1di0yLjAwMWExMi4wNCAxMi4wNCAwIDAgMS04LjUwOS0zLjUxYy00LjY3OS00LjY3OS00LjY3OS0xMi4yOTIgMC0xNi45NzEgMi4yNjctMi4yNjcgNS4yOC0zLjUxNSA4LjQ4NS0zLjUxNXM2LjIxOSAxLjI0OCA4LjQ4NSAzLjUxNSAzLjUxNSA1LjI4IDMuNTE1IDguNDg1YzAgMS4zMDgtLjIxOCAyLjU4LS42MTggMy43ODZsMS44OTcuNjMyYy40NjctMS40MDguNzIyLTIuODkyLjcyMi00LjQxOFoiLz48cGF0aCBkPSJNMjQuNyAxMy42NzVhOC45NCA4Ljk0IDAgMCAwLTQuMTkzLTUuNDY1IDguOTQyIDguOTQyIDAgMCAwLTYuODMtLjg5OSA4Ljk3MSA4Ljk3MSAwIDAgMC01LjQ2MSA0LjE5NSA4Ljk4IDguOTggMCAwIDAtLjkwMyA2LjgyOGMxLjA3NyA0LjAxNiA0LjcyMiA2LjY2IDguNjk1IDYuNjYxdi0xLjk5OGMtMy4wOS0uMDAxLTUuOTI2LTIuMDU4LTYuNzYzLTUuMTgxYTcuMDEgNy4wMSAwIDAgMSA0Ljk1LTguNTc0IDYuOTU4IDYuOTU4IDAgMCAxIDUuMzEyLjY5OSA2Ljk1NCA2Ljk1NCAwIDAgMSAzLjI2MSA0LjI1Yy4zNTkgMS4zNDIuMjc1IDIuNzMyLS4xNTQgNC4wMTNsMS45MDkuNjM2YTguOTU5IDguOTU5IDAgMCAwIC4xNzYtNS4xNjdaIi8+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xNCAxNmMwLTEuMTAzLjg5Ny0yIDItMnMyIC44OTcgMiAyYTIgMiAwIDAgMS0uMTExLjYzbDEuODg5LjYzYy4xMzMtLjM5OC4yMjItLjgxNy4yMjItMS4yNTlhNCA0IDAgMSAwLTQgNHYtMmMtMS4xMDMgMC0yLS44OTctMi0yWiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNyAxNGgzdjNoLTN6IiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTguNSAxNS41KSIvPjxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0xOSAxMmg3djVoLTd6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyMi41IDE0LjUpIi8+PHBhdGggZmlsbD0idXJsKCNjKSIgZD0iTTIyIDEwaDEydjZIMjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyOCAxMykiLz48cGF0aCBkPSJNMjUgMTloNnY0aC02ek0yMCAxOGg1djVoLTV6TTE3IDE3aDN2NmgtM3oiLz48L21hc2s+PC9kZWZzPjxwYXRoIGZpbGw9IiMwMDFkNmMiIGQ9Im0yNSAzMS4wMDEtMi4xMzktMS4wMTNBNS4wMjIgNS4wMjIgMCAwIDEgMjAgMjUuNDY4VjE5aDEwdjYuNDY4YTUuMDIzIDUuMDIzIDAgMCAxLTIuODYxIDQuNTJMMjUgMzEuMDAxWm0tMy0xMHY0LjQ2OGMwIDEuMTUzLjY3NCAyLjIxOCAxLjcxNyAyLjcxMWwxLjI4My42MDcgMS4yODMtLjYwN0EzLjAxMiAzLjAxMiAwIDAgMCAyOCAyNS40Njl2LTQuNDY4aC02WiIgZGF0YS1uYW1lPSJ1dWlkLTU1ODMwNDRiLWZmMjQtNGUyNy05MDU0LTI0MDQzYWRkZmMwNiIvPjxnIG1hc2s9InVybCgjZCkiPjxwYXRoIGZpbGw9InVybCgjZSkiIGQ9Ik0wIDBoMzJ2MzJIMHoiIHRyYW5zZm9ybT0icm90YXRlKC05MCAxNiAxNikiLz48L2c+PC9zdmc+\", \"label\": {\"text\": \"1 per instance\", \"tip\": \"Only 1 per instance\"}, \"attributes\": {\"mapKey\": {\"type\": \"text\", \"display_name\": \"Workload Protection Instance CRN\"}}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String getProviderTypeByIdPath = "/provider_types/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetProviderTypeByIdOptions model + GetProviderTypeByIdOptions getProviderTypeByIdOptionsModel = new GetProviderTypeByIdOptions.Builder() + .providerTypeId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getProviderTypeById() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getProviderTypeById(getProviderTypeByIdOptionsModel).execute(); + assertNotNull(response); + ProviderTypeItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getProviderTypeByIdPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getProviderTypeById operation with and without retries enabled + @Test + public void testGetProviderTypeByIdWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetProviderTypeByIdWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetProviderTypeByIdWOptions(); + } + + // Test the getProviderTypeById operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProviderTypeByIdNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getProviderTypeById(null).execute(); + } + + // Test the listProviderTypeInstances operation with a valid options model parameter + @Test + public void testListProviderTypeInstancesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"provider_type_instances\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; + String listProviderTypeInstancesPath = "/provider_types/testString/provider_type_instances"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListProviderTypeInstancesOptions model + ListProviderTypeInstancesOptions listProviderTypeInstancesOptionsModel = new ListProviderTypeInstancesOptions.Builder() + .providerTypeId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke listProviderTypeInstances() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listProviderTypeInstances(listProviderTypeInstancesOptionsModel).execute(); + assertNotNull(response); + ProviderTypeInstancesResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listProviderTypeInstancesPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the listProviderTypeInstances operation with and without retries enabled + @Test + public void testListProviderTypeInstancesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListProviderTypeInstancesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListProviderTypeInstancesWOptions(); + } + + // Test the listProviderTypeInstances operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListProviderTypeInstancesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.listProviderTypeInstances(null).execute(); + } + + // Test the createProviderTypeInstance operation with a valid options model parameter + @Test + public void testCreateProviderTypeInstanceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String createProviderTypeInstancePath = "/provider_types/testString/provider_type_instances"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the CreateProviderTypeInstanceOptions model + CreateProviderTypeInstanceOptions createProviderTypeInstanceOptionsModel = new CreateProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .name("workload-protection-instance-1") + .attributes(java.util.Collections.singletonMap("anyKey", "anyValue")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke createProviderTypeInstance() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.createProviderTypeInstance(createProviderTypeInstanceOptionsModel).execute(); + assertNotNull(response); + ProviderTypeInstanceItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createProviderTypeInstancePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the createProviderTypeInstance operation with and without retries enabled + @Test + public void testCreateProviderTypeInstanceWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testCreateProviderTypeInstanceWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testCreateProviderTypeInstanceWOptions(); + } + + // Test the createProviderTypeInstance operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateProviderTypeInstanceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.createProviderTypeInstance(null).execute(); + } + + // Test the deleteProviderTypeInstance operation with a valid options model parameter + @Test + public void testDeleteProviderTypeInstanceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteProviderTypeInstancePath = "/provider_types/testString/provider_type_instances/testString"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteProviderTypeInstanceOptions model + DeleteProviderTypeInstanceOptions deleteProviderTypeInstanceOptionsModel = new DeleteProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .providerTypeInstanceId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke deleteProviderTypeInstance() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.deleteProviderTypeInstance(deleteProviderTypeInstanceOptionsModel).execute(); + assertNotNull(response); + Void responseObj = response.getResult(); + assertNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteProviderTypeInstancePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the deleteProviderTypeInstance operation with and without retries enabled + @Test + public void testDeleteProviderTypeInstanceWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testDeleteProviderTypeInstanceWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testDeleteProviderTypeInstanceWOptions(); + } + + // Test the deleteProviderTypeInstance operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteProviderTypeInstanceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.deleteProviderTypeInstance(null).execute(); + } + + // Test the getProviderTypeInstance operation with a valid options model parameter + @Test + public void testGetProviderTypeInstanceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String getProviderTypeInstancePath = "/provider_types/testString/provider_type_instances/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetProviderTypeInstanceOptions model + GetProviderTypeInstanceOptions getProviderTypeInstanceOptionsModel = new GetProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .providerTypeInstanceId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getProviderTypeInstance() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getProviderTypeInstance(getProviderTypeInstanceOptionsModel).execute(); + assertNotNull(response); + ProviderTypeInstanceItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getProviderTypeInstancePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getProviderTypeInstance operation with and without retries enabled + @Test + public void testGetProviderTypeInstanceWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetProviderTypeInstanceWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetProviderTypeInstanceWOptions(); + } + + // Test the getProviderTypeInstance operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProviderTypeInstanceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getProviderTypeInstance(null).execute(); + } + + // Test the updateProviderTypeInstance operation with a valid options model parameter + @Test + public void testUpdateProviderTypeInstanceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String updateProviderTypeInstancePath = "/provider_types/testString/provider_type_instances/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the UpdateProviderTypeInstanceOptions model + UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptionsModel = new UpdateProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .providerTypeInstanceId("testString") + .name("workload-protection-instance-1") + .attributes(java.util.Collections.singletonMap("anyKey", "anyValue")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke updateProviderTypeInstance() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.updateProviderTypeInstance(updateProviderTypeInstanceOptionsModel).execute(); + assertNotNull(response); + ProviderTypeInstanceItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateProviderTypeInstancePath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the updateProviderTypeInstance operation with and without retries enabled + @Test + public void testUpdateProviderTypeInstanceWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testUpdateProviderTypeInstanceWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testUpdateProviderTypeInstanceWOptions(); + } + + // Test the updateProviderTypeInstance operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateProviderTypeInstanceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.updateProviderTypeInstance(null).execute(); + } + + // Test the getProviderTypesInstances operation with a valid options model parameter + @Test + public void testGetProviderTypesInstancesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"provider_types_instances\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; + String getProviderTypesInstancesPath = "/provider_types_instances"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetProviderTypesInstancesOptions model + GetProviderTypesInstancesOptions getProviderTypesInstancesOptionsModel = new GetProviderTypesInstancesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getProviderTypesInstances() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getProviderTypesInstances(getProviderTypesInstancesOptionsModel).execute(); + assertNotNull(response); + ProviderTypesInstancesResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getProviderTypesInstancesPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getProviderTypesInstances operation with and without retries enabled + @Test + public void testGetProviderTypesInstancesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetProviderTypesInstancesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetProviderTypesInstancesWOptions(); + } + + // Perform setup needed before each test method + @BeforeMethod + public void beforeEachTest() { + // Start the mock server. + try { + server = new MockWebServer(); + server.start(); + } catch (IOException err) { + fail("Failed to instantiate mock web server"); + } + + // Construct an instance of the service + constructClientService(); + } + + // Perform tear down after each test method + @AfterMethod + public void afterEachTest() throws IOException { + server.shutdown(); + securityAndComplianceCenterApiService = null; + } + + // Constructs an instance of the service to be used by the tests + public void constructClientService() { + System.setProperty("TESTSERVICE_AUTH_TYPE", "noAuth"); + final String serviceName = "testService"; + + securityAndComplianceCenterApiService = SecurityAndComplianceCenterApi.newInstance(serviceName); + String url = server.url("/").toString(); + securityAndComplianceCenterApiService.setServiceUrl(url); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AccountTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AccountTest.java new file mode 100644 index 00000000..ffcb9cda --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AccountTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Account model. + */ +public class AccountTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAccount() throws Throwable { + Account accountModel = new Account(); + assertNull(accountModel.getId()); + assertNull(accountModel.getName()); + assertNull(accountModel.getType()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalPropertyTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalPropertyTest.java new file mode 100644 index 00000000..e0c573c3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalPropertyTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AdditionalProperty model. + */ +public class AdditionalPropertyTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAdditionalProperty() throws Throwable { + AdditionalProperty additionalPropertyModel = new AdditionalProperty(); + assertNull(additionalPropertyModel.getType()); + assertNull(additionalPropertyModel.getDisplayName()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttributeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttributeTest.java new file mode 100644 index 00000000..675434a8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AdditionalTargetAttributeTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AdditionalTargetAttribute model. + */ +public class AdditionalTargetAttributeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAdditionalTargetAttribute() throws Throwable { + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(additionalTargetAttributeModel.name(), "testString"); + assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); + assertEquals(additionalTargetAttributeModel.value(), "testString"); + + String json = TestUtilities.serialize(additionalTargetAttributeModel); + + AdditionalTargetAttribute additionalTargetAttributeModelNew = TestUtilities.deserialize(json, AdditionalTargetAttribute.class); + assertTrue(additionalTargetAttributeModelNew instanceof AdditionalTargetAttribute); + assertEquals(additionalTargetAttributeModelNew.name(), "testString"); + assertEquals(additionalTargetAttributeModelNew.operator(), "string_equals"); + assertEquals(additionalTargetAttributeModelNew.value(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AssessmentTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AssessmentTest.java new file mode 100644 index 00000000..517c0a46 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AssessmentTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Assessment model. + */ +public class AssessmentTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAssessment() throws Throwable { + Assessment assessmentModel = new Assessment(); + assertNull(assessmentModel.getAssessmentId()); + assertNull(assessmentModel.getAssessmentType()); + assertNull(assessmentModel.getAssessmentMethod()); + assertNull(assessmentModel.getAssessmentDescription()); + assertNull(assessmentModel.getParameterCount()); + assertNull(assessmentModel.getParameters()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollectionTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollectionTest.java new file mode 100644 index 00000000..406c7589 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollectionTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LastScan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AttachmentCollection model. + */ +public class AttachmentCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachmentCollection() throws Throwable { + AttachmentCollection attachmentCollectionModel = new AttachmentCollection(); + assertNull(attachmentCollectionModel.getTotalCount()); + assertNull(attachmentCollectionModel.getLimit()); + assertNull(attachmentCollectionModel.getFirst()); + assertNull(attachmentCollectionModel.getNext()); + assertNull(attachmentCollectionModel.getAttachments()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItemTest.java new file mode 100644 index 00000000..5746f4af --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentItemTest.java @@ -0,0 +1,150 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LastScan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AttachmentItem model. + */ +public class AttachmentItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachmentItem() throws Throwable { + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("name") + .value("value") + .build(); + assertEquals(propertyItemModel.name(), "name"); + assertEquals(propertyItemModel.value(), "value"); + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("environment") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + assertEquals(multiCloudScopeModel.environment(), "environment"); + assertEquals(multiCloudScopeModel.xProperties(), java.util.Arrays.asList(propertyItemModel)); + + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("0")) + .failedControlIds(java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")) + .build(); + assertEquals(failedControlsModel.thresholdLimit(), Long.valueOf("0")); + assertEquals(failedControlsModel.failedControlIds(), java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(true) + .controls(failedControlsModel) + .build(); + assertEquals(attachmentsNotificationsPrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(attachmentsNotificationsPrototypeModel.controls(), failedControlsModel); + + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("assessment_type") + .assessmentId("assessment_id") + .parameterName("parameter_name") + .parameterValue("parameter_value") + .parameterDisplayName("parameter_display_name") + .parameterType("string") + .build(); + assertEquals(attachmentParameterPrototypeModel.assessmentType(), "assessment_type"); + assertEquals(attachmentParameterPrototypeModel.assessmentId(), "assessment_id"); + assertEquals(attachmentParameterPrototypeModel.parameterName(), "parameter_name"); + assertEquals(attachmentParameterPrototypeModel.parameterValue(), "parameter_value"); + assertEquals(attachmentParameterPrototypeModel.parameterDisplayName(), "parameter_display_name"); + assertEquals(attachmentParameterPrototypeModel.parameterType(), "string"); + + LastScan lastScanModel = new LastScan.Builder() + .id("e8a39d25-0051-4328-8462-988ad321f49a") + .status("in_progress") + .time(DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")) + .build(); + assertEquals(lastScanModel.id(), "e8a39d25-0051-4328-8462-988ad321f49a"); + assertEquals(lastScanModel.status(), "in_progress"); + assertEquals(lastScanModel.time(), DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")); + + AttachmentItem attachmentItemModel = new AttachmentItem.Builder() + .id("130003ea8bfa43c5aacea07a86da3000") + .profileId("7ec45986-54fc-4b66-a303-d9577b078c65") + .accountId("130003ea8bfa43c5aacea07a86da3000") + .instanceId("edf9524f-406c-412c-acbb-ee371a5cabda") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .status("enabled") + .schedule("daily") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .lastScan(lastScanModel) + .nextScanTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("account-130003ea8bfa43c5aacea07a86da3000") + .description("Test description") + .build(); + assertEquals(attachmentItemModel.id(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentItemModel.profileId(), "7ec45986-54fc-4b66-a303-d9577b078c65"); + assertEquals(attachmentItemModel.accountId(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentItemModel.instanceId(), "edf9524f-406c-412c-acbb-ee371a5cabda"); + assertEquals(attachmentItemModel.scope(), java.util.Arrays.asList(multiCloudScopeModel)); + assertEquals(attachmentItemModel.createdOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(attachmentItemModel.createdBy(), "testString"); + assertEquals(attachmentItemModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(attachmentItemModel.updatedBy(), "testString"); + assertEquals(attachmentItemModel.status(), "enabled"); + assertEquals(attachmentItemModel.schedule(), "daily"); + assertEquals(attachmentItemModel.notifications(), attachmentsNotificationsPrototypeModel); + assertEquals(attachmentItemModel.attachmentParameters(), java.util.Arrays.asList(attachmentParameterPrototypeModel)); + assertEquals(attachmentItemModel.lastScan(), lastScanModel); + assertEquals(attachmentItemModel.nextScanTime(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(attachmentItemModel.name(), "account-130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentItemModel.description(), "Test description"); + + String json = TestUtilities.serialize(attachmentItemModel); + + AttachmentItem attachmentItemModelNew = TestUtilities.deserialize(json, AttachmentItem.class); + assertTrue(attachmentItemModelNew instanceof AttachmentItem); + assertEquals(attachmentItemModelNew.id(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentItemModelNew.profileId(), "7ec45986-54fc-4b66-a303-d9577b078c65"); + assertEquals(attachmentItemModelNew.accountId(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentItemModelNew.instanceId(), "edf9524f-406c-412c-acbb-ee371a5cabda"); + assertEquals(attachmentItemModelNew.createdOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(attachmentItemModelNew.createdBy(), "testString"); + assertEquals(attachmentItemModelNew.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(attachmentItemModelNew.updatedBy(), "testString"); + assertEquals(attachmentItemModelNew.status(), "enabled"); + assertEquals(attachmentItemModelNew.schedule(), "daily"); + assertEquals(attachmentItemModelNew.notifications().toString(), attachmentsNotificationsPrototypeModel.toString()); + assertEquals(attachmentItemModelNew.lastScan().toString(), lastScanModel.toString()); + assertEquals(attachmentItemModelNew.nextScanTime(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(attachmentItemModelNew.name(), "account-130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentItemModelNew.description(), "Test description"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototypeTest.java new file mode 100644 index 00000000..ffec1bb5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentParameterPrototypeTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AttachmentParameterPrototype model. + */ +public class AttachmentParameterPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachmentParameterPrototype() throws Throwable { + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("testString") + .assessmentId("testString") + .parameterName("testString") + .parameterValue("testString") + .parameterDisplayName("testString") + .parameterType("string") + .build(); + assertEquals(attachmentParameterPrototypeModel.assessmentType(), "testString"); + assertEquals(attachmentParameterPrototypeModel.assessmentId(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterName(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterValue(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterDisplayName(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterType(), "string"); + + String json = TestUtilities.serialize(attachmentParameterPrototypeModel); + + AttachmentParameterPrototype attachmentParameterPrototypeModelNew = TestUtilities.deserialize(json, AttachmentParameterPrototype.class); + assertTrue(attachmentParameterPrototypeModelNew instanceof AttachmentParameterPrototype); + assertEquals(attachmentParameterPrototypeModelNew.assessmentType(), "testString"); + assertEquals(attachmentParameterPrototypeModelNew.assessmentId(), "testString"); + assertEquals(attachmentParameterPrototypeModelNew.parameterName(), "testString"); + assertEquals(attachmentParameterPrototypeModelNew.parameterValue(), "testString"); + assertEquals(attachmentParameterPrototypeModelNew.parameterDisplayName(), "testString"); + assertEquals(attachmentParameterPrototypeModelNew.parameterType(), "string"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototypeTest.java new file mode 100644 index 00000000..240cac8e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentPrototypeTest.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AttachmentPrototype model. + */ +public class AttachmentPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachmentPrototype() throws Throwable { + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("name") + .value("value") + .build(); + assertEquals(propertyItemModel.name(), "name"); + assertEquals(propertyItemModel.value(), "value"); + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("environment") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + assertEquals(multiCloudScopeModel.environment(), "environment"); + assertEquals(multiCloudScopeModel.xProperties(), java.util.Arrays.asList(propertyItemModel)); + + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("0")) + .failedControlIds(java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")) + .build(); + assertEquals(failedControlsModel.thresholdLimit(), Long.valueOf("0")); + assertEquals(failedControlsModel.failedControlIds(), java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(true) + .controls(failedControlsModel) + .build(); + assertEquals(attachmentsNotificationsPrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(attachmentsNotificationsPrototypeModel.controls(), failedControlsModel); + + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("assessment_type") + .assessmentId("assessment_id") + .parameterName("parameter_name") + .parameterValue("parameter_value") + .parameterDisplayName("parameter_display_name") + .parameterType("string") + .build(); + assertEquals(attachmentParameterPrototypeModel.assessmentType(), "assessment_type"); + assertEquals(attachmentParameterPrototypeModel.assessmentId(), "assessment_id"); + assertEquals(attachmentParameterPrototypeModel.parameterName(), "parameter_name"); + assertEquals(attachmentParameterPrototypeModel.parameterValue(), "parameter_value"); + assertEquals(attachmentParameterPrototypeModel.parameterDisplayName(), "parameter_display_name"); + assertEquals(attachmentParameterPrototypeModel.parameterType(), "string"); + + AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() + .id("130003ea8bfa43c5aacea07a86da3000") + .name("account-130003ea8bfa43c5aacea07a86da3000") + .description("Test description") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("daily") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .build(); + assertEquals(attachmentsPrototypeModel.id(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModel.name(), "account-130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModel.description(), "Test description"); + assertEquals(attachmentsPrototypeModel.scope(), java.util.Arrays.asList(multiCloudScopeModel)); + assertEquals(attachmentsPrototypeModel.status(), "enabled"); + assertEquals(attachmentsPrototypeModel.schedule(), "daily"); + assertEquals(attachmentsPrototypeModel.notifications(), attachmentsNotificationsPrototypeModel); + assertEquals(attachmentsPrototypeModel.attachmentParameters(), java.util.Arrays.asList(attachmentParameterPrototypeModel)); + + AttachmentPrototype attachmentPrototypeModel = new AttachmentPrototype.Builder() + .profileId("testString") + .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) + .build(); + assertEquals(attachmentPrototypeModel.profileId(), "testString"); + assertEquals(attachmentPrototypeModel.attachments(), java.util.Arrays.asList(attachmentsPrototypeModel)); + + String json = TestUtilities.serialize(attachmentPrototypeModel); + + AttachmentPrototype attachmentPrototypeModelNew = TestUtilities.deserialize(json, AttachmentPrototype.class); + assertTrue(attachmentPrototypeModelNew instanceof AttachmentPrototype); + assertEquals(attachmentPrototypeModelNew.profileId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testAttachmentPrototypeError() throws Throwable { + new AttachmentPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScopeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScopeTest.java new file mode 100644 index 00000000..5ed26d58 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentScopeTest.java @@ -0,0 +1,40 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AttachmentScope model. + */ +public class AttachmentScopeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachmentScope() throws Throwable { + AttachmentScope attachmentScopeModel = new AttachmentScope(); + assertNull(attachmentScopeModel.getId()); + assertNull(attachmentScopeModel.getEnvironment()); + assertNull(attachmentScopeModel.getXProperties()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentTest.java new file mode 100644 index 00000000..24e00b96 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Attachment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Attachment model. + */ +public class AttachmentTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachment() throws Throwable { + Attachment attachmentModel = new Attachment(); + assertNull(attachmentModel.getId()); + assertNull(attachmentModel.getName()); + assertNull(attachmentModel.getDescription()); + assertNull(attachmentModel.getSchedule()); + assertNull(attachmentModel.getScope()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototypeTest.java new file mode 100644 index 00000000..514a1807 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototypeTest.java @@ -0,0 +1,62 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AttachmentsNotificationsPrototype model. + */ +public class AttachmentsNotificationsPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachmentsNotificationsPrototype() throws Throwable { + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("0")) + .failedControlIds(java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")) + .build(); + assertEquals(failedControlsModel.thresholdLimit(), Long.valueOf("0")); + assertEquals(failedControlsModel.failedControlIds(), java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(true) + .controls(failedControlsModel) + .build(); + assertEquals(attachmentsNotificationsPrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(attachmentsNotificationsPrototypeModel.controls(), failedControlsModel); + + String json = TestUtilities.serialize(attachmentsNotificationsPrototypeModel); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModelNew = TestUtilities.deserialize(json, AttachmentsNotificationsPrototype.class); + assertTrue(attachmentsNotificationsPrototypeModelNew instanceof AttachmentsNotificationsPrototype); + assertEquals(attachmentsNotificationsPrototypeModelNew.enabled(), Boolean.valueOf(true)); + assertEquals(attachmentsNotificationsPrototypeModelNew.controls().toString(), failedControlsModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testAttachmentsNotificationsPrototypeError() throws Throwable { + new AttachmentsNotificationsPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototypeTest.java new file mode 100644 index 00000000..8d28c7ca --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototypeTest.java @@ -0,0 +1,118 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AttachmentsPrototype model. + */ +public class AttachmentsPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAttachmentsPrototype() throws Throwable { + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("name") + .value("value") + .build(); + assertEquals(propertyItemModel.name(), "name"); + assertEquals(propertyItemModel.value(), "value"); + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("environment") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + assertEquals(multiCloudScopeModel.environment(), "environment"); + assertEquals(multiCloudScopeModel.xProperties(), java.util.Arrays.asList(propertyItemModel)); + + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("0")) + .failedControlIds(java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")) + .build(); + assertEquals(failedControlsModel.thresholdLimit(), Long.valueOf("0")); + assertEquals(failedControlsModel.failedControlIds(), java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF", "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(true) + .controls(failedControlsModel) + .build(); + assertEquals(attachmentsNotificationsPrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(attachmentsNotificationsPrototypeModel.controls(), failedControlsModel); + + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("assessment_type") + .assessmentId("assessment_id") + .parameterName("parameter_name") + .parameterValue("parameter_value") + .parameterDisplayName("parameter_display_name") + .parameterType("string") + .build(); + assertEquals(attachmentParameterPrototypeModel.assessmentType(), "assessment_type"); + assertEquals(attachmentParameterPrototypeModel.assessmentId(), "assessment_id"); + assertEquals(attachmentParameterPrototypeModel.parameterName(), "parameter_name"); + assertEquals(attachmentParameterPrototypeModel.parameterValue(), "parameter_value"); + assertEquals(attachmentParameterPrototypeModel.parameterDisplayName(), "parameter_display_name"); + assertEquals(attachmentParameterPrototypeModel.parameterType(), "string"); + + AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() + .id("130003ea8bfa43c5aacea07a86da3000") + .name("account-130003ea8bfa43c5aacea07a86da3000") + .description("Test description") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("daily") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .build(); + assertEquals(attachmentsPrototypeModel.id(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModel.name(), "account-130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModel.description(), "Test description"); + assertEquals(attachmentsPrototypeModel.scope(), java.util.Arrays.asList(multiCloudScopeModel)); + assertEquals(attachmentsPrototypeModel.status(), "enabled"); + assertEquals(attachmentsPrototypeModel.schedule(), "daily"); + assertEquals(attachmentsPrototypeModel.notifications(), attachmentsNotificationsPrototypeModel); + assertEquals(attachmentsPrototypeModel.attachmentParameters(), java.util.Arrays.asList(attachmentParameterPrototypeModel)); + + String json = TestUtilities.serialize(attachmentsPrototypeModel); + + AttachmentsPrototype attachmentsPrototypeModelNew = TestUtilities.deserialize(json, AttachmentsPrototype.class); + assertTrue(attachmentsPrototypeModelNew instanceof AttachmentsPrototype); + assertEquals(attachmentsPrototypeModelNew.id(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModelNew.name(), "account-130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModelNew.description(), "Test description"); + assertEquals(attachmentsPrototypeModelNew.status(), "enabled"); + assertEquals(attachmentsPrototypeModelNew.schedule(), "daily"); + assertEquals(attachmentsPrototypeModelNew.notifications().toString(), attachmentsNotificationsPrototypeModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testAttachmentsPrototypeError() throws Throwable { + new AttachmentsPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScoreTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScoreTest.java new file mode 100644 index 00000000..6df8669c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceScoreTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceScore; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ComplianceScore model. + */ +public class ComplianceScoreTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testComplianceScore() throws Throwable { + ComplianceScore complianceScoreModel = new ComplianceScore(); + assertNull(complianceScoreModel.getPassed()); + assertNull(complianceScoreModel.getTotalCount()); + assertNull(complianceScoreModel.getPercent()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStatsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStatsTest.java new file mode 100644 index 00000000..c6ba84da --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ComplianceStatsTest.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ComplianceStats model. + */ +public class ComplianceStatsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testComplianceStats() throws Throwable { + ComplianceStats complianceStatsModel = new ComplianceStats(); + assertNull(complianceStatsModel.getStatus()); + assertNull(complianceStatsModel.getTotalCount()); + assertNull(complianceStatsModel.getCompliantCount()); + assertNull(complianceStatsModel.getNotCompliantCount()); + assertNull(complianceStatsModel.getUnableToPerformCount()); + assertNull(complianceStatsModel.getUserEvaluationRequiredCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocsTest.java new file mode 100644 index 00000000..8fb82117 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlDocsTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlDocs model. + */ +public class ControlDocsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlDocs() throws Throwable { + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("testString") + .controlDocsType("testString") + .build(); + assertEquals(controlDocsModel.controlDocsId(), "testString"); + assertEquals(controlDocsModel.controlDocsType(), "testString"); + + String json = TestUtilities.serialize(controlDocsModel); + + ControlDocs controlDocsModelNew = TestUtilities.deserialize(json, ControlDocs.class); + assertTrue(controlDocsModelNew instanceof ControlDocs); + assertEquals(controlDocsModelNew.controlDocsId(), "testString"); + assertEquals(controlDocsModelNew.controlDocsType(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollectionTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollectionTest.java new file mode 100644 index 00000000..9df39838 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryCollectionTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlLibraryCollection model. + */ +public class ControlLibraryCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlLibraryCollection() throws Throwable { + ControlLibraryCollection controlLibraryCollectionModel = new ControlLibraryCollection(); + assertNull(controlLibraryCollectionModel.getTotalCount()); + assertNull(controlLibraryCollectionModel.getLimit()); + assertNull(controlLibraryCollectionModel.getFirst()); + assertNull(controlLibraryCollectionModel.getNext()); + assertNull(controlLibraryCollectionModel.getControlLibraries()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDeleteTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDeleteTest.java new file mode 100644 index 00000000..5a7f1549 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryDeleteTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryDelete; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlLibraryDelete model. + */ +public class ControlLibraryDeleteTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlLibraryDelete() throws Throwable { + ControlLibraryDelete controlLibraryDeleteModel = new ControlLibraryDelete(); + assertNull(controlLibraryDeleteModel.getDeleted()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItemTest.java new file mode 100644 index 00000000..6d669fa4 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryItemTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibraryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlLibraryItem model. + */ +public class ControlLibraryItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlLibraryItem() throws Throwable { + ControlLibraryItem controlLibraryItemModel = new ControlLibraryItem(); + assertNull(controlLibraryItemModel.getId()); + assertNull(controlLibraryItemModel.getAccountId()); + assertNull(controlLibraryItemModel.getControlLibraryName()); + assertNull(controlLibraryItemModel.getControlLibraryDescription()); + assertNull(controlLibraryItemModel.getControlLibraryType()); + assertNull(controlLibraryItemModel.getCreatedOn()); + assertNull(controlLibraryItemModel.getCreatedBy()); + assertNull(controlLibraryItemModel.getUpdatedOn()); + assertNull(controlLibraryItemModel.getUpdatedBy()); + assertNull(controlLibraryItemModel.getVersionGroupLabel()); + assertNull(controlLibraryItemModel.getControlLibraryVersion()); + assertNull(controlLibraryItemModel.isLatest()); + assertNull(controlLibraryItemModel.getControlsCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java new file mode 100644 index 00000000..cdebe2bd --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java @@ -0,0 +1,170 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlLibrary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlsInControlLib; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlLibrary model. + */ +public class ControlLibraryTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlLibrary() throws Throwable { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("parameter_name") + .parameterDisplayName("parameter_display_name") + .parameterType("string") + .parameterValue("public") + .build(); + assertEquals(parameterInfoModel.parameterName(), "parameter_name"); + assertEquals(parameterInfoModel.parameterDisplayName(), "parameter_display_name"); + assertEquals(parameterInfoModel.parameterType(), "string"); + assertEquals(parameterInfoModel.parameterValue(), "public"); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("assessment_id") + .assessmentMethod("assessment_method") + .assessmentType("assessment_type") + .assessmentDescription("assessment_description") + .parameterCount(Long.valueOf("5")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + assertEquals(implementationModel.assessmentId(), "assessment_id"); + assertEquals(implementationModel.assessmentMethod(), "assessment_method"); + assertEquals(implementationModel.assessmentType(), "assessment_type"); + assertEquals(implementationModel.assessmentDescription(), "assessment_description"); + assertEquals(implementationModel.parameterCount(), Long.valueOf("5")); + assertEquals(implementationModel.parameters(), java.util.Arrays.asList(parameterInfoModel)); + + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") + .responsibility("user") + .componentId("f3517159-889e-4781-819a-89d89b747c85") + .componenetName("componenet_name") + .environment("environment") + .controlSpecificationDescription("control_specification_description") + .assessmentsCount(Long.valueOf("1")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.responsibility(), "user"); + assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.componenetName(), "componenet_name"); + assertEquals(controlSpecificationsModel.environment(), "environment"); + assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "control_specification_description"); + assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("1")); + assertEquals(controlSpecificationsModel.assessments(), java.util.Arrays.asList(implementationModel)); + + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("control_docs_id") + .controlDocsType("control_docs_type") + .build(); + assertEquals(controlDocsModel.controlDocsId(), "control_docs_id"); + assertEquals(controlDocsModel.controlDocsType(), "control_docs_type"); + + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("control_name") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("control_description") + .controlCategory("control_category") + .controlParent("control_parent") + .controlTags(java.util.Arrays.asList("control_tags", "control_tags", "control_tags", "control_tags", "control_tags")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + assertEquals(controlsInControlLibModel.controlName(), "control_name"); + assertEquals(controlsInControlLibModel.controlId(), "1fa45e17-9322-4e6c-bbd6-1c51db08e790"); + assertEquals(controlsInControlLibModel.controlDescription(), "control_description"); + assertEquals(controlsInControlLibModel.controlCategory(), "control_category"); + assertEquals(controlsInControlLibModel.controlParent(), "control_parent"); + assertEquals(controlsInControlLibModel.controlTags(), java.util.Arrays.asList("control_tags", "control_tags", "control_tags", "control_tags", "control_tags")); + assertEquals(controlsInControlLibModel.controlSpecifications(), java.util.Arrays.asList(controlSpecificationsModel)); + assertEquals(controlsInControlLibModel.controlDocs(), controlDocsModel); + assertEquals(controlsInControlLibModel.controlRequirement(), Boolean.valueOf(true)); + assertEquals(controlsInControlLibModel.status(), "enabled"); + + ControlLibrary controlLibraryModel = new ControlLibrary.Builder() + .id("f3517159-889e-4781-819a-89d89b747c85") + .accountId("130003ea8bfa43c5aacea07a86da3000") + .controlLibraryName("testString") + .controlLibraryDescription("testString") + .controlLibraryType("predefined") + .versionGroupLabel("e0923045-f00d-44de-b49b-6f1f0e8033cc") + .controlLibraryVersion("testString") + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .latest(true) + .hierarchyEnabled(true) + .controlsCount(Long.valueOf("26")) + .controlParentsCount(Long.valueOf("26")) + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .build(); + assertEquals(controlLibraryModel.id(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlLibraryModel.accountId(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(controlLibraryModel.controlLibraryName(), "testString"); + assertEquals(controlLibraryModel.controlLibraryDescription(), "testString"); + assertEquals(controlLibraryModel.controlLibraryType(), "predefined"); + assertEquals(controlLibraryModel.versionGroupLabel(), "e0923045-f00d-44de-b49b-6f1f0e8033cc"); + assertEquals(controlLibraryModel.controlLibraryVersion(), "testString"); + assertEquals(controlLibraryModel.createdOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(controlLibraryModel.createdBy(), "testString"); + assertEquals(controlLibraryModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(controlLibraryModel.updatedBy(), "testString"); + assertEquals(controlLibraryModel.latest(), Boolean.valueOf(true)); + assertEquals(controlLibraryModel.hierarchyEnabled(), Boolean.valueOf(true)); + assertEquals(controlLibraryModel.controlsCount(), Long.valueOf("26")); + assertEquals(controlLibraryModel.controlParentsCount(), Long.valueOf("26")); + assertEquals(controlLibraryModel.controls(), java.util.Arrays.asList(controlsInControlLibModel)); + + String json = TestUtilities.serialize(controlLibraryModel); + + ControlLibrary controlLibraryModelNew = TestUtilities.deserialize(json, ControlLibrary.class); + assertTrue(controlLibraryModelNew instanceof ControlLibrary); + assertEquals(controlLibraryModelNew.id(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlLibraryModelNew.accountId(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(controlLibraryModelNew.controlLibraryName(), "testString"); + assertEquals(controlLibraryModelNew.controlLibraryDescription(), "testString"); + assertEquals(controlLibraryModelNew.controlLibraryType(), "predefined"); + assertEquals(controlLibraryModelNew.versionGroupLabel(), "e0923045-f00d-44de-b49b-6f1f0e8033cc"); + assertEquals(controlLibraryModelNew.controlLibraryVersion(), "testString"); + assertEquals(controlLibraryModelNew.createdOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(controlLibraryModelNew.createdBy(), "testString"); + assertEquals(controlLibraryModelNew.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(controlLibraryModelNew.updatedBy(), "testString"); + assertEquals(controlLibraryModelNew.latest(), Boolean.valueOf(true)); + assertEquals(controlLibraryModelNew.hierarchyEnabled(), Boolean.valueOf(true)); + assertEquals(controlLibraryModelNew.controlsCount(), Long.valueOf("26")); + assertEquals(controlLibraryModelNew.controlParentsCount(), Long.valueOf("26")); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStatsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStatsTest.java new file mode 100644 index 00000000..a273dee5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationWithStatsTest.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecificationWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlSpecificationWithStats model. + */ +public class ControlSpecificationWithStatsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlSpecificationWithStats() throws Throwable { + ControlSpecificationWithStats controlSpecificationWithStatsModel = new ControlSpecificationWithStats(); + assertNull(controlSpecificationWithStatsModel.getControlSpecificationId()); + assertNull(controlSpecificationWithStatsModel.getComponentId()); + assertNull(controlSpecificationWithStatsModel.getControlSpecificationDescription()); + assertNull(controlSpecificationWithStatsModel.getEnvironment()); + assertNull(controlSpecificationWithStatsModel.getResponsibility()); + assertNull(controlSpecificationWithStatsModel.getAssessments()); + assertNull(controlSpecificationWithStatsModel.getStatus()); + assertNull(controlSpecificationWithStatsModel.getTotalCount()); + assertNull(controlSpecificationWithStatsModel.getCompliantCount()); + assertNull(controlSpecificationWithStatsModel.getNotCompliantCount()); + assertNull(controlSpecificationWithStatsModel.getUnableToPerformCount()); + assertNull(controlSpecificationWithStatsModel.getUserEvaluationRequiredCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java new file mode 100644 index 00000000..d09c6b71 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java @@ -0,0 +1,93 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlSpecifications model. + */ +public class ControlSpecificationsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlSpecifications() throws Throwable { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("parameter_name") + .parameterDisplayName("parameter_display_name") + .parameterType("string") + .parameterValue("public") + .build(); + assertEquals(parameterInfoModel.parameterName(), "parameter_name"); + assertEquals(parameterInfoModel.parameterDisplayName(), "parameter_display_name"); + assertEquals(parameterInfoModel.parameterType(), "string"); + assertEquals(parameterInfoModel.parameterValue(), "public"); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("assessment_id") + .assessmentMethod("assessment_method") + .assessmentType("assessment_type") + .assessmentDescription("assessment_description") + .parameterCount(Long.valueOf("5")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + assertEquals(implementationModel.assessmentId(), "assessment_id"); + assertEquals(implementationModel.assessmentMethod(), "assessment_method"); + assertEquals(implementationModel.assessmentType(), "assessment_type"); + assertEquals(implementationModel.assessmentDescription(), "assessment_description"); + assertEquals(implementationModel.parameterCount(), Long.valueOf("5")); + assertEquals(implementationModel.parameters(), java.util.Arrays.asList(parameterInfoModel)); + + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") + .responsibility("user") + .componentId("f3517159-889e-4781-819a-89d89b747c85") + .componenetName("testString") + .environment("testString") + .controlSpecificationDescription("testString") + .assessmentsCount(Long.valueOf("26")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.responsibility(), "user"); + assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.componenetName(), "testString"); + assertEquals(controlSpecificationsModel.environment(), "testString"); + assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "testString"); + assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("26")); + assertEquals(controlSpecificationsModel.assessments(), java.util.Arrays.asList(implementationModel)); + + String json = TestUtilities.serialize(controlSpecificationsModel); + + ControlSpecifications controlSpecificationsModelNew = TestUtilities.deserialize(json, ControlSpecifications.class); + assertTrue(controlSpecificationsModelNew instanceof ControlSpecifications); + assertEquals(controlSpecificationsModelNew.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModelNew.responsibility(), "user"); + assertEquals(controlSpecificationsModelNew.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModelNew.componenetName(), "testString"); + assertEquals(controlSpecificationsModelNew.environment(), "testString"); + assertEquals(controlSpecificationsModelNew.controlSpecificationDescription(), "testString"); + assertEquals(controlSpecificationsModelNew.assessmentsCount(), Long.valueOf("26")); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStatsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStatsTest.java new file mode 100644 index 00000000..a3ab9c7c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlWithStatsTest.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecificationWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlWithStats model. + */ +public class ControlWithStatsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlWithStats() throws Throwable { + ControlWithStats controlWithStatsModel = new ControlWithStats(); + assertNull(controlWithStatsModel.getId()); + assertNull(controlWithStatsModel.getControlLibraryId()); + assertNull(controlWithStatsModel.getControlLibraryVersion()); + assertNull(controlWithStatsModel.getControlName()); + assertNull(controlWithStatsModel.getControlDescription()); + assertNull(controlWithStatsModel.getControlCategory()); + assertNull(controlWithStatsModel.getControlPath()); + assertNull(controlWithStatsModel.getControlSpecifications()); + assertNull(controlWithStatsModel.getStatus()); + assertNull(controlWithStatsModel.getTotalCount()); + assertNull(controlWithStatsModel.getCompliantCount()); + assertNull(controlWithStatsModel.getNotCompliantCount()); + assertNull(controlWithStatsModel.getUnableToPerformCount()); + assertNull(controlWithStatsModel.getUserEvaluationRequiredCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java new file mode 100644 index 00000000..fcd0eb3f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java @@ -0,0 +1,126 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlsInControlLib; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ControlsInControlLib model. + */ +public class ControlsInControlLibTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testControlsInControlLib() throws Throwable { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("parameter_name") + .parameterDisplayName("parameter_display_name") + .parameterType("string") + .parameterValue("public") + .build(); + assertEquals(parameterInfoModel.parameterName(), "parameter_name"); + assertEquals(parameterInfoModel.parameterDisplayName(), "parameter_display_name"); + assertEquals(parameterInfoModel.parameterType(), "string"); + assertEquals(parameterInfoModel.parameterValue(), "public"); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("assessment_id") + .assessmentMethod("assessment_method") + .assessmentType("assessment_type") + .assessmentDescription("assessment_description") + .parameterCount(Long.valueOf("5")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + assertEquals(implementationModel.assessmentId(), "assessment_id"); + assertEquals(implementationModel.assessmentMethod(), "assessment_method"); + assertEquals(implementationModel.assessmentType(), "assessment_type"); + assertEquals(implementationModel.assessmentDescription(), "assessment_description"); + assertEquals(implementationModel.parameterCount(), Long.valueOf("5")); + assertEquals(implementationModel.parameters(), java.util.Arrays.asList(parameterInfoModel)); + + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") + .responsibility("user") + .componentId("f3517159-889e-4781-819a-89d89b747c85") + .componenetName("componenet_name") + .environment("environment") + .controlSpecificationDescription("control_specification_description") + .assessmentsCount(Long.valueOf("1")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.responsibility(), "user"); + assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.componenetName(), "componenet_name"); + assertEquals(controlSpecificationsModel.environment(), "environment"); + assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "control_specification_description"); + assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("1")); + assertEquals(controlSpecificationsModel.assessments(), java.util.Arrays.asList(implementationModel)); + + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("control_docs_id") + .controlDocsType("control_docs_type") + .build(); + assertEquals(controlDocsModel.controlDocsId(), "control_docs_id"); + assertEquals(controlDocsModel.controlDocsType(), "control_docs_type"); + + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("testString") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("testString") + .controlCategory("testString") + .controlParent("testString") + .controlTags(java.util.Arrays.asList("testString")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + assertEquals(controlsInControlLibModel.controlName(), "testString"); + assertEquals(controlsInControlLibModel.controlId(), "1fa45e17-9322-4e6c-bbd6-1c51db08e790"); + assertEquals(controlsInControlLibModel.controlDescription(), "testString"); + assertEquals(controlsInControlLibModel.controlCategory(), "testString"); + assertEquals(controlsInControlLibModel.controlParent(), "testString"); + assertEquals(controlsInControlLibModel.controlTags(), java.util.Arrays.asList("testString")); + assertEquals(controlsInControlLibModel.controlSpecifications(), java.util.Arrays.asList(controlSpecificationsModel)); + assertEquals(controlsInControlLibModel.controlDocs(), controlDocsModel); + assertEquals(controlsInControlLibModel.controlRequirement(), Boolean.valueOf(true)); + assertEquals(controlsInControlLibModel.status(), "enabled"); + + String json = TestUtilities.serialize(controlsInControlLibModel); + + ControlsInControlLib controlsInControlLibModelNew = TestUtilities.deserialize(json, ControlsInControlLib.class); + assertTrue(controlsInControlLibModelNew instanceof ControlsInControlLib); + assertEquals(controlsInControlLibModelNew.controlName(), "testString"); + assertEquals(controlsInControlLibModelNew.controlId(), "1fa45e17-9322-4e6c-bbd6-1c51db08e790"); + assertEquals(controlsInControlLibModelNew.controlDescription(), "testString"); + assertEquals(controlsInControlLibModelNew.controlCategory(), "testString"); + assertEquals(controlsInControlLibModelNew.controlParent(), "testString"); + assertEquals(controlsInControlLibModelNew.controlDocs().toString(), controlDocsModel.toString()); + assertEquals(controlsInControlLibModelNew.controlRequirement(), Boolean.valueOf(true)); + assertEquals(controlsInControlLibModelNew.status(), "enabled"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java new file mode 100644 index 00000000..82b4c65c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CreateAttachmentOptions model. + */ +public class CreateAttachmentOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateAttachmentOptions() throws Throwable { + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("testString") + .value("testString") + .build(); + assertEquals(propertyItemModel.name(), "testString"); + assertEquals(propertyItemModel.value(), "testString"); + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("testString") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + assertEquals(multiCloudScopeModel.environment(), "testString"); + assertEquals(multiCloudScopeModel.xProperties(), java.util.Arrays.asList(propertyItemModel)); + + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("26")) + .failedControlIds(java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")) + .build(); + assertEquals(failedControlsModel.thresholdLimit(), Long.valueOf("26")); + assertEquals(failedControlsModel.failedControlIds(), java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(true) + .controls(failedControlsModel) + .build(); + assertEquals(attachmentsNotificationsPrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(attachmentsNotificationsPrototypeModel.controls(), failedControlsModel); + + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("testString") + .assessmentId("testString") + .parameterName("testString") + .parameterValue("testString") + .parameterDisplayName("testString") + .parameterType("string") + .build(); + assertEquals(attachmentParameterPrototypeModel.assessmentType(), "testString"); + assertEquals(attachmentParameterPrototypeModel.assessmentId(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterName(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterValue(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterDisplayName(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterType(), "string"); + + AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() + .id("130003ea8bfa43c5aacea07a86da3000") + .name("account-130003ea8bfa43c5aacea07a86da3000") + .description("Test description") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("daily") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .build(); + assertEquals(attachmentsPrototypeModel.id(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModel.name(), "account-130003ea8bfa43c5aacea07a86da3000"); + assertEquals(attachmentsPrototypeModel.description(), "Test description"); + assertEquals(attachmentsPrototypeModel.scope(), java.util.Arrays.asList(multiCloudScopeModel)); + assertEquals(attachmentsPrototypeModel.status(), "enabled"); + assertEquals(attachmentsPrototypeModel.schedule(), "daily"); + assertEquals(attachmentsPrototypeModel.notifications(), attachmentsNotificationsPrototypeModel); + assertEquals(attachmentsPrototypeModel.attachmentParameters(), java.util.Arrays.asList(attachmentParameterPrototypeModel)); + + CreateAttachmentOptions createAttachmentOptionsModel = new CreateAttachmentOptions.Builder() + .profilesId("testString") + .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) + .profileId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(createAttachmentOptionsModel.profilesId(), "testString"); + assertEquals(createAttachmentOptionsModel.attachments(), java.util.Arrays.asList(attachmentsPrototypeModel)); + assertEquals(createAttachmentOptionsModel.profileId(), "testString"); + assertEquals(createAttachmentOptionsModel.xCorrelationId(), "testString"); + assertEquals(createAttachmentOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateAttachmentOptionsError() throws Throwable { + new CreateAttachmentOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java new file mode 100644 index 00000000..45eee4ef --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java @@ -0,0 +1,143 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlsInControlLib; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CreateCustomControlLibraryOptions model. + */ +public class CreateCustomControlLibraryOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateCustomControlLibraryOptions() throws Throwable { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("location") + .parameterDisplayName("Location") + .parameterType("string") + .parameterValue("public") + .build(); + assertEquals(parameterInfoModel.parameterName(), "location"); + assertEquals(parameterInfoModel.parameterDisplayName(), "Location"); + assertEquals(parameterInfoModel.parameterType(), "string"); + assertEquals(parameterInfoModel.parameterValue(), "public"); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("testString") + .assessmentMethod("testString") + .assessmentType("testString") + .assessmentDescription("testString") + .parameterCount(Long.valueOf("26")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + assertEquals(implementationModel.assessmentId(), "testString"); + assertEquals(implementationModel.assessmentMethod(), "testString"); + assertEquals(implementationModel.assessmentType(), "testString"); + assertEquals(implementationModel.assessmentDescription(), "testString"); + assertEquals(implementationModel.parameterCount(), Long.valueOf("26")); + assertEquals(implementationModel.parameters(), java.util.Arrays.asList(parameterInfoModel)); + + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") + .responsibility("user") + .componentId("f3517159-889e-4781-819a-89d89b747c85") + .componenetName("testString") + .environment("testString") + .controlSpecificationDescription("testString") + .assessmentsCount(Long.valueOf("26")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.responsibility(), "user"); + assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.componenetName(), "testString"); + assertEquals(controlSpecificationsModel.environment(), "testString"); + assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "testString"); + assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("26")); + assertEquals(controlSpecificationsModel.assessments(), java.util.Arrays.asList(implementationModel)); + + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("testString") + .controlDocsType("testString") + .build(); + assertEquals(controlDocsModel.controlDocsId(), "testString"); + assertEquals(controlDocsModel.controlDocsType(), "testString"); + + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("testString") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("testString") + .controlCategory("testString") + .controlParent("testString") + .controlTags(java.util.Arrays.asList("testString")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + assertEquals(controlsInControlLibModel.controlName(), "testString"); + assertEquals(controlsInControlLibModel.controlId(), "1fa45e17-9322-4e6c-bbd6-1c51db08e790"); + assertEquals(controlsInControlLibModel.controlDescription(), "testString"); + assertEquals(controlsInControlLibModel.controlCategory(), "testString"); + assertEquals(controlsInControlLibModel.controlParent(), "testString"); + assertEquals(controlsInControlLibModel.controlTags(), java.util.Arrays.asList("testString")); + assertEquals(controlsInControlLibModel.controlSpecifications(), java.util.Arrays.asList(controlSpecificationsModel)); + assertEquals(controlsInControlLibModel.controlDocs(), controlDocsModel); + assertEquals(controlsInControlLibModel.controlRequirement(), Boolean.valueOf(true)); + assertEquals(controlsInControlLibModel.status(), "enabled"); + + CreateCustomControlLibraryOptions createCustomControlLibraryOptionsModel = new CreateCustomControlLibraryOptions.Builder() + .controlLibraryName("testString") + .controlLibraryDescription("testString") + .controlLibraryType("predefined") + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .versionGroupLabel("e0923045-f00d-44de-b49b-6f1f0e8033cc") + .controlLibraryVersion("testString") + .latest(true) + .controlsCount(Long.valueOf("26")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(createCustomControlLibraryOptionsModel.controlLibraryName(), "testString"); + assertEquals(createCustomControlLibraryOptionsModel.controlLibraryDescription(), "testString"); + assertEquals(createCustomControlLibraryOptionsModel.controlLibraryType(), "predefined"); + assertEquals(createCustomControlLibraryOptionsModel.controls(), java.util.Arrays.asList(controlsInControlLibModel)); + assertEquals(createCustomControlLibraryOptionsModel.versionGroupLabel(), "e0923045-f00d-44de-b49b-6f1f0e8033cc"); + assertEquals(createCustomControlLibraryOptionsModel.controlLibraryVersion(), "testString"); + assertEquals(createCustomControlLibraryOptionsModel.latest(), Boolean.valueOf(true)); + assertEquals(createCustomControlLibraryOptionsModel.controlsCount(), Long.valueOf("26")); + assertEquals(createCustomControlLibraryOptionsModel.xCorrelationId(), "testString"); + assertEquals(createCustomControlLibraryOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateCustomControlLibraryOptionsError() throws Throwable { + new CreateCustomControlLibraryOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptionsTest.java new file mode 100644 index 00000000..1974da03 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptionsTest.java @@ -0,0 +1,81 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DefaultParametersPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControlsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CreateProfileOptions model. + */ +public class CreateProfileOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateProfileOptions() throws Throwable { + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId("e98a56ff-dc24-41d4-9875-1e188e2da6cd") + .controlId("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF") + .build(); + assertEquals(profileControlsPrototypeModel.controlLibraryId(), "e98a56ff-dc24-41d4-9875-1e188e2da6cd"); + assertEquals(profileControlsPrototypeModel.controlId(), "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF"); + + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("testString") + .assessmentId("testString") + .parameterName("testString") + .parameterDefaultValue("testString") + .parameterDisplayName("testString") + .parameterType("string") + .build(); + assertEquals(defaultParametersPrototypeModel.assessmentType(), "testString"); + assertEquals(defaultParametersPrototypeModel.assessmentId(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterName(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterDefaultValue(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterDisplayName(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterType(), "string"); + + CreateProfileOptions createProfileOptionsModel = new CreateProfileOptions.Builder() + .profileName("testString") + .profileDescription("testString") + .profileType("predefined") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(createProfileOptionsModel.profileName(), "testString"); + assertEquals(createProfileOptionsModel.profileDescription(), "testString"); + assertEquals(createProfileOptionsModel.profileType(), "predefined"); + assertEquals(createProfileOptionsModel.controls(), java.util.Arrays.asList(profileControlsPrototypeModel)); + assertEquals(createProfileOptionsModel.defaultParameters(), java.util.Arrays.asList(defaultParametersPrototypeModel)); + assertEquals(createProfileOptionsModel.xCorrelationId(), "testString"); + assertEquals(createProfileOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateProfileOptionsError() throws Throwable { + new CreateProfileOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptionsTest.java new file mode 100644 index 00000000..3500cb9d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptionsTest.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CreateProviderTypeInstanceOptions model. + */ +public class CreateProviderTypeInstanceOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateProviderTypeInstanceOptions() throws Throwable { + CreateProviderTypeInstanceOptions createProviderTypeInstanceOptionsModel = new CreateProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .name("workload-protection-instance-1") + .attributes(java.util.Collections.singletonMap("anyKey", "anyValue")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(createProviderTypeInstanceOptionsModel.providerTypeId(), "testString"); + assertEquals(createProviderTypeInstanceOptionsModel.name(), "workload-protection-instance-1"); + assertEquals(createProviderTypeInstanceOptionsModel.attributes(), java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(createProviderTypeInstanceOptionsModel.xCorrelationId(), "testString"); + assertEquals(createProviderTypeInstanceOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateProviderTypeInstanceOptionsError() throws Throwable { + new CreateProviderTypeInstanceOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java new file mode 100644 index 00000000..c7c277a0 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CreateRuleOptions model. + */ +public class CreateRuleOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateRuleOptions() throws Throwable { + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(additionalTargetAttributeModel.name(), "testString"); + assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); + assertEquals(additionalTargetAttributeModel.value(), "testString"); + + Target targetModel = new Target.Builder() + .serviceName("testString") + .serviceDisplayName("testString") + .resourceKind("testString") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + assertEquals(targetModel.serviceName(), "testString"); + assertEquals(targetModel.serviceDisplayName(), "testString"); + assertEquals(targetModel.resourceKind(), "testString"); + assertEquals(targetModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); + + RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() + .description("testString") + .build(); + assertEquals(requiredConfigItemsModel.description(), "testString"); + + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("testString") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + assertEquals(requiredConfigModel.description(), "testString"); + assertEquals(requiredConfigModel.and(), java.util.Arrays.asList(requiredConfigItemsModel)); + + Parameter parameterModel = new Parameter.Builder() + .name("testString") + .displayName("testString") + .description("testString") + .type("string") + .build(); + assertEquals(parameterModel.name(), "testString"); + assertEquals(parameterModel.displayName(), "testString"); + assertEquals(parameterModel.description(), "testString"); + assertEquals(parameterModel.type(), "string"); + + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + assertEquals(importModel.parameters(), java.util.Arrays.asList(parameterModel)); + + CreateRuleOptions createRuleOptionsModel = new CreateRuleOptions.Builder() + .description("testString") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .type("user_defined") + .version("testString") + .xImport(importModel) + .labels(java.util.Arrays.asList("testString")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(createRuleOptionsModel.description(), "testString"); + assertEquals(createRuleOptionsModel.target(), targetModel); + assertEquals(createRuleOptionsModel.requiredConfig(), requiredConfigModel); + assertEquals(createRuleOptionsModel.type(), "user_defined"); + assertEquals(createRuleOptionsModel.version(), "testString"); + assertEquals(createRuleOptionsModel.xImport(), importModel); + assertEquals(createRuleOptionsModel.labels(), java.util.Arrays.asList("testString")); + assertEquals(createRuleOptionsModel.xCorrelationId(), "testString"); + assertEquals(createRuleOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateRuleOptionsError() throws Throwable { + new CreateRuleOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptionsTest.java new file mode 100644 index 00000000..dde38056 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateScanOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateScanOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CreateScanOptions model. + */ +public class CreateScanOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateScanOptions() throws Throwable { + CreateScanOptions createScanOptionsModel = new CreateScanOptions.Builder() + .attachmentId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(createScanOptionsModel.attachmentId(), "testString"); + assertEquals(createScanOptionsModel.xCorrelationId(), "testString"); + assertEquals(createScanOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateScanOptionsError() throws Throwable { + new CreateScanOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototypeTest.java new file mode 100644 index 00000000..ddaf228f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DefaultParametersPrototypeTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DefaultParametersPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the DefaultParametersPrototype model. + */ +public class DefaultParametersPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testDefaultParametersPrototype() throws Throwable { + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("testString") + .assessmentId("testString") + .parameterName("testString") + .parameterDefaultValue("testString") + .parameterDisplayName("testString") + .parameterType("string") + .build(); + assertEquals(defaultParametersPrototypeModel.assessmentType(), "testString"); + assertEquals(defaultParametersPrototypeModel.assessmentId(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterName(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterDefaultValue(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterDisplayName(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterType(), "string"); + + String json = TestUtilities.serialize(defaultParametersPrototypeModel); + + DefaultParametersPrototype defaultParametersPrototypeModelNew = TestUtilities.deserialize(json, DefaultParametersPrototype.class); + assertTrue(defaultParametersPrototypeModelNew instanceof DefaultParametersPrototype); + assertEquals(defaultParametersPrototypeModelNew.assessmentType(), "testString"); + assertEquals(defaultParametersPrototypeModelNew.assessmentId(), "testString"); + assertEquals(defaultParametersPrototypeModelNew.parameterName(), "testString"); + assertEquals(defaultParametersPrototypeModelNew.parameterDefaultValue(), "testString"); + assertEquals(defaultParametersPrototypeModelNew.parameterDisplayName(), "testString"); + assertEquals(defaultParametersPrototypeModelNew.parameterType(), "string"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptionsTest.java new file mode 100644 index 00000000..8bff2d40 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomControlLibraryOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the DeleteCustomControlLibraryOptions model. + */ +public class DeleteCustomControlLibraryOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testDeleteCustomControlLibraryOptions() throws Throwable { + DeleteCustomControlLibraryOptions deleteCustomControlLibraryOptionsModel = new DeleteCustomControlLibraryOptions.Builder() + .controlLibrariesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(deleteCustomControlLibraryOptionsModel.controlLibrariesId(), "testString"); + assertEquals(deleteCustomControlLibraryOptionsModel.xCorrelationId(), "testString"); + assertEquals(deleteCustomControlLibraryOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteCustomControlLibraryOptionsError() throws Throwable { + new DeleteCustomControlLibraryOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java new file mode 100644 index 00000000..50ca0a8b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteCustomProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the DeleteCustomProfileOptions model. + */ +public class DeleteCustomProfileOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testDeleteCustomProfileOptions() throws Throwable { + DeleteCustomProfileOptions deleteCustomProfileOptionsModel = new DeleteCustomProfileOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(deleteCustomProfileOptionsModel.profilesId(), "testString"); + assertEquals(deleteCustomProfileOptionsModel.xCorrelationId(), "testString"); + assertEquals(deleteCustomProfileOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteCustomProfileOptionsError() throws Throwable { + new DeleteCustomProfileOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java new file mode 100644 index 00000000..ac75b2b5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the DeleteProfileAttachmentOptions model. + */ +public class DeleteProfileAttachmentOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testDeleteProfileAttachmentOptions() throws Throwable { + DeleteProfileAttachmentOptions deleteProfileAttachmentOptionsModel = new DeleteProfileAttachmentOptions.Builder() + .attachmentId("testString") + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(deleteProfileAttachmentOptionsModel.attachmentId(), "testString"); + assertEquals(deleteProfileAttachmentOptionsModel.profilesId(), "testString"); + assertEquals(deleteProfileAttachmentOptionsModel.xCorrelationId(), "testString"); + assertEquals(deleteProfileAttachmentOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteProfileAttachmentOptionsError() throws Throwable { + new DeleteProfileAttachmentOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptionsTest.java new file mode 100644 index 00000000..a162ee44 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProviderTypeInstanceOptionsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the DeleteProviderTypeInstanceOptions model. + */ +public class DeleteProviderTypeInstanceOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testDeleteProviderTypeInstanceOptions() throws Throwable { + DeleteProviderTypeInstanceOptions deleteProviderTypeInstanceOptionsModel = new DeleteProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .providerTypeInstanceId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(deleteProviderTypeInstanceOptionsModel.providerTypeId(), "testString"); + assertEquals(deleteProviderTypeInstanceOptionsModel.providerTypeInstanceId(), "testString"); + assertEquals(deleteProviderTypeInstanceOptionsModel.xCorrelationId(), "testString"); + assertEquals(deleteProviderTypeInstanceOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteProviderTypeInstanceOptionsError() throws Throwable { + new DeleteProviderTypeInstanceOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptionsTest.java new file mode 100644 index 00000000..b4503675 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteRuleOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DeleteRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the DeleteRuleOptions model. + */ +public class DeleteRuleOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testDeleteRuleOptions() throws Throwable { + DeleteRuleOptions deleteRuleOptionsModel = new DeleteRuleOptions.Builder() + .ruleId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(deleteRuleOptionsModel.ruleId(), "testString"); + assertEquals(deleteRuleOptionsModel.xCorrelationId(), "testString"); + assertEquals(deleteRuleOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteRuleOptionsError() throws Throwable { + new DeleteRuleOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetailsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetailsTest.java new file mode 100644 index 00000000..789986d5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalDetailsTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalDetails; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EvalDetails model. + */ +public class EvalDetailsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEvalDetails() throws Throwable { + EvalDetails evalDetailsModel = new EvalDetails(); + assertNull(evalDetailsModel.getXProperties()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStatsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStatsTest.java new file mode 100644 index 00000000..fffe9fe8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvalStatsTest.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EvalStats model. + */ +public class EvalStatsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEvalStats() throws Throwable { + EvalStats evalStatsModel = new EvalStats(); + assertNull(evalStatsModel.getStatus()); + assertNull(evalStatsModel.getTotalCount()); + assertNull(evalStatsModel.getPassCount()); + assertNull(evalStatsModel.getFailureCount()); + assertNull(evalStatsModel.getErrorCount()); + assertNull(evalStatsModel.getCompletedCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPageTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPageTest.java new file mode 100644 index 00000000..86d9750c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationPageTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalDetails; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Evaluation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvaluationPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRef; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EvaluationPage model. + */ +public class EvaluationPageTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEvaluationPage() throws Throwable { + EvaluationPage evaluationPageModel = new EvaluationPage(); + assertNull(evaluationPageModel.getTotalCount()); + assertNull(evaluationPageModel.getLimit()); + assertNull(evaluationPageModel.getStart()); + assertNull(evaluationPageModel.getFirst()); + assertNull(evaluationPageModel.getNext()); + assertNull(evaluationPageModel.getHomeAccountId()); + assertNull(evaluationPageModel.getReportId()); + assertNull(evaluationPageModel.getEvaluations()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationTest.java new file mode 100644 index 00000000..e2f0a439 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EvaluationTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalDetails; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Evaluation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Evaluation model. + */ +public class EvaluationTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEvaluation() throws Throwable { + Evaluation evaluationModel = new Evaluation(); + assertNull(evaluationModel.getHomeAccountId()); + assertNull(evaluationModel.getReportId()); + assertNull(evaluationModel.getControlId()); + assertNull(evaluationModel.getComponentId()); + assertNull(evaluationModel.getAssessment()); + assertNull(evaluationModel.getEvaluateTime()); + assertNull(evaluationModel.getTarget()); + assertNull(evaluationModel.getStatus()); + assertNull(evaluationModel.getReason()); + assertNull(evaluationModel.getDetails()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java new file mode 100644 index 00000000..120621a9 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java @@ -0,0 +1,58 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EventNotifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EventNotifications model. + */ +public class EventNotificationsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEventNotifications() throws Throwable { + EventNotifications eventNotificationsModel = new EventNotifications.Builder() + .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") + .sourceName("compliance") + .build(); + assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(eventNotificationsModel.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModel.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); + assertEquals(eventNotificationsModel.sourceName(), "compliance"); + + String json = TestUtilities.serialize(eventNotificationsModel); + + EventNotifications eventNotificationsModelNew = TestUtilities.deserialize(json, EventNotifications.class); + assertTrue(eventNotificationsModelNew instanceof EventNotifications); + assertEquals(eventNotificationsModelNew.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModelNew.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(eventNotificationsModelNew.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModelNew.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); + assertEquals(eventNotificationsModelNew.sourceName(), "compliance"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControlsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControlsTest.java new file mode 100644 index 00000000..463c1a15 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/FailedControlsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the FailedControls model. + */ +public class FailedControlsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testFailedControls() throws Throwable { + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("26")) + .failedControlIds(java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")) + .build(); + assertEquals(failedControlsModel.thresholdLimit(), Long.valueOf("26")); + assertEquals(failedControlsModel.failedControlIds(), java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")); + + String json = TestUtilities.serialize(failedControlsModel); + + FailedControls failedControlsModelNew = TestUtilities.deserialize(json, FailedControls.class); + assertTrue(failedControlsModelNew instanceof FailedControls); + assertEquals(failedControlsModelNew.thresholdLimit(), Long.valueOf("26")); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptionsTest.java new file mode 100644 index 00000000..45d00fe6 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetControlLibraryOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetControlLibraryOptions model. + */ +public class GetControlLibraryOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetControlLibraryOptions() throws Throwable { + GetControlLibraryOptions getControlLibraryOptionsModel = new GetControlLibraryOptions.Builder() + .controlLibrariesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getControlLibraryOptionsModel.controlLibrariesId(), "testString"); + assertEquals(getControlLibraryOptionsModel.xCorrelationId(), "testString"); + assertEquals(getControlLibraryOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetControlLibraryOptionsError() throws Throwable { + new GetControlLibraryOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptionsTest.java new file mode 100644 index 00000000..503bc5ae --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetLatestReportsOptionsTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetLatestReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetLatestReportsOptions model. + */ +public class GetLatestReportsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetLatestReportsOptions() throws Throwable { + GetLatestReportsOptions getLatestReportsOptionsModel = new GetLatestReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .sort("profile_name") + .build(); + assertEquals(getLatestReportsOptionsModel.xCorrelationId(), "testString"); + assertEquals(getLatestReportsOptionsModel.xRequestId(), "testString"); + assertEquals(getLatestReportsOptionsModel.sort(), "profile_name"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java new file mode 100644 index 00000000..bdef3998 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetProfileAttachmentOptions model. + */ +public class GetProfileAttachmentOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetProfileAttachmentOptions() throws Throwable { + GetProfileAttachmentOptions getProfileAttachmentOptionsModel = new GetProfileAttachmentOptions.Builder() + .attachmentId("testString") + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getProfileAttachmentOptionsModel.attachmentId(), "testString"); + assertEquals(getProfileAttachmentOptionsModel.profilesId(), "testString"); + assertEquals(getProfileAttachmentOptionsModel.xCorrelationId(), "testString"); + assertEquals(getProfileAttachmentOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProfileAttachmentOptionsError() throws Throwable { + new GetProfileAttachmentOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java new file mode 100644 index 00000000..73923e46 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetProfileOptions model. + */ +public class GetProfileOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetProfileOptions() throws Throwable { + GetProfileOptions getProfileOptionsModel = new GetProfileOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getProfileOptionsModel.profilesId(), "testString"); + assertEquals(getProfileOptionsModel.xCorrelationId(), "testString"); + assertEquals(getProfileOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProfileOptionsError() throws Throwable { + new GetProfileOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptionsTest.java new file mode 100644 index 00000000..26e7e186 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeByIdOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeByIdOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetProviderTypeByIdOptions model. + */ +public class GetProviderTypeByIdOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetProviderTypeByIdOptions() throws Throwable { + GetProviderTypeByIdOptions getProviderTypeByIdOptionsModel = new GetProviderTypeByIdOptions.Builder() + .providerTypeId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getProviderTypeByIdOptionsModel.providerTypeId(), "testString"); + assertEquals(getProviderTypeByIdOptionsModel.xCorrelationId(), "testString"); + assertEquals(getProviderTypeByIdOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProviderTypeByIdOptionsError() throws Throwable { + new GetProviderTypeByIdOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptionsTest.java new file mode 100644 index 00000000..0b652942 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypeInstanceOptionsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetProviderTypeInstanceOptions model. + */ +public class GetProviderTypeInstanceOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetProviderTypeInstanceOptions() throws Throwable { + GetProviderTypeInstanceOptions getProviderTypeInstanceOptionsModel = new GetProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .providerTypeInstanceId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getProviderTypeInstanceOptionsModel.providerTypeId(), "testString"); + assertEquals(getProviderTypeInstanceOptionsModel.providerTypeInstanceId(), "testString"); + assertEquals(getProviderTypeInstanceOptionsModel.xCorrelationId(), "testString"); + assertEquals(getProviderTypeInstanceOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProviderTypeInstanceOptionsError() throws Throwable { + new GetProviderTypeInstanceOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptionsTest.java new file mode 100644 index 00000000..84065978 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProviderTypesInstancesOptionsTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetProviderTypesInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetProviderTypesInstancesOptions model. + */ +public class GetProviderTypesInstancesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetProviderTypesInstancesOptions() throws Throwable { + GetProviderTypesInstancesOptions getProviderTypesInstancesOptionsModel = new GetProviderTypesInstancesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getProviderTypesInstancesOptionsModel.xCorrelationId(), "testString"); + assertEquals(getProviderTypesInstancesOptionsModel.xRequestId(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptionsTest.java new file mode 100644 index 00000000..324a67d0 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportControlsOptionsTest.java @@ -0,0 +1,61 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportControlsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetReportControlsOptions model. + */ +public class GetReportControlsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetReportControlsOptions() throws Throwable { + GetReportControlsOptions getReportControlsOptionsModel = new GetReportControlsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .controlId("testString") + .controlName("testString") + .controlDescription("testString") + .controlCategory("testString") + .status("compliant") + .sort("control_name") + .build(); + assertEquals(getReportControlsOptionsModel.reportId(), "testString"); + assertEquals(getReportControlsOptionsModel.xCorrelationId(), "testString"); + assertEquals(getReportControlsOptionsModel.xRequestId(), "testString"); + assertEquals(getReportControlsOptionsModel.controlId(), "testString"); + assertEquals(getReportControlsOptionsModel.controlName(), "testString"); + assertEquals(getReportControlsOptionsModel.controlDescription(), "testString"); + assertEquals(getReportControlsOptionsModel.controlCategory(), "testString"); + assertEquals(getReportControlsOptionsModel.status(), "compliant"); + assertEquals(getReportControlsOptionsModel.sort(), "control_name"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportControlsOptionsError() throws Throwable { + new GetReportControlsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptionsTest.java new file mode 100644 index 00000000..21b037ca --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportEvaluationOptionsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportEvaluationOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetReportEvaluationOptions model. + */ +public class GetReportEvaluationOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetReportEvaluationOptions() throws Throwable { + GetReportEvaluationOptions getReportEvaluationOptionsModel = new GetReportEvaluationOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .excludeSummary(true) + .build(); + assertEquals(getReportEvaluationOptionsModel.reportId(), "testString"); + assertEquals(getReportEvaluationOptionsModel.xCorrelationId(), "testString"); + assertEquals(getReportEvaluationOptionsModel.xRequestId(), "testString"); + assertEquals(getReportEvaluationOptionsModel.excludeSummary(), Boolean.valueOf(true)); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportEvaluationOptionsError() throws Throwable { + new GetReportEvaluationOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptionsTest.java new file mode 100644 index 00000000..8670660b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetReportOptions model. + */ +public class GetReportOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetReportOptions() throws Throwable { + GetReportOptions getReportOptionsModel = new GetReportOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getReportOptionsModel.reportId(), "testString"); + assertEquals(getReportOptionsModel.xCorrelationId(), "testString"); + assertEquals(getReportOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportOptionsError() throws Throwable { + new GetReportOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptionsTest.java new file mode 100644 index 00000000..3ddde23d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportRuleOptionsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetReportRuleOptions model. + */ +public class GetReportRuleOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetReportRuleOptions() throws Throwable { + GetReportRuleOptions getReportRuleOptionsModel = new GetReportRuleOptions.Builder() + .reportId("testString") + .ruleId("rule-8d444f8c-fd1d-48de-bcaa-f43732568761") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getReportRuleOptionsModel.reportId(), "testString"); + assertEquals(getReportRuleOptionsModel.ruleId(), "rule-8d444f8c-fd1d-48de-bcaa-f43732568761"); + assertEquals(getReportRuleOptionsModel.xCorrelationId(), "testString"); + assertEquals(getReportRuleOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportRuleOptionsError() throws Throwable { + new GetReportRuleOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptionsTest.java new file mode 100644 index 00000000..bf54c6f2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportSummaryOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportSummaryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetReportSummaryOptions model. + */ +public class GetReportSummaryOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetReportSummaryOptions() throws Throwable { + GetReportSummaryOptions getReportSummaryOptionsModel = new GetReportSummaryOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getReportSummaryOptionsModel.reportId(), "testString"); + assertEquals(getReportSummaryOptionsModel.xCorrelationId(), "testString"); + assertEquals(getReportSummaryOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportSummaryOptionsError() throws Throwable { + new GetReportSummaryOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptionsTest.java new file mode 100644 index 00000000..2cb17407 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportTagsOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportTagsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetReportTagsOptions model. + */ +public class GetReportTagsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetReportTagsOptions() throws Throwable { + GetReportTagsOptions getReportTagsOptionsModel = new GetReportTagsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getReportTagsOptionsModel.reportId(), "testString"); + assertEquals(getReportTagsOptionsModel.xCorrelationId(), "testString"); + assertEquals(getReportTagsOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportTagsOptionsError() throws Throwable { + new GetReportTagsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptionsTest.java new file mode 100644 index 00000000..954c7ab8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetReportViolationsDriftOptionsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetReportViolationsDriftOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetReportViolationsDriftOptions model. + */ +public class GetReportViolationsDriftOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetReportViolationsDriftOptions() throws Throwable { + GetReportViolationsDriftOptions getReportViolationsDriftOptionsModel = new GetReportViolationsDriftOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .scanTimeDuration(Long.valueOf("0")) + .build(); + assertEquals(getReportViolationsDriftOptionsModel.reportId(), "testString"); + assertEquals(getReportViolationsDriftOptionsModel.xCorrelationId(), "testString"); + assertEquals(getReportViolationsDriftOptionsModel.xRequestId(), "testString"); + assertEquals(getReportViolationsDriftOptionsModel.scanTimeDuration(), Long.valueOf("0")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReportViolationsDriftOptionsError() throws Throwable { + new GetReportViolationsDriftOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptionsTest.java new file mode 100644 index 00000000..3dbde70d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetRuleOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetRuleOptions model. + */ +public class GetRuleOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetRuleOptions() throws Throwable { + GetRuleOptions getRuleOptionsModel = new GetRuleOptions.Builder() + .ruleId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(getRuleOptionsModel.ruleId(), "testString"); + assertEquals(getRuleOptionsModel.xCorrelationId(), "testString"); + assertEquals(getRuleOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetRuleOptionsError() throws Throwable { + new GetRuleOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptionsTest.java new file mode 100644 index 00000000..83ac7e62 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetSettingsOptionsTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.GetSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetSettingsOptions model. + */ +public class GetSettingsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetSettingsOptions() throws Throwable { + GetSettingsOptions getSettingsOptionsModel = new GetSettingsOptions.Builder() + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + assertEquals(getSettingsOptionsModel.xCorrelationId(), "1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5"); + assertEquals(getSettingsOptionsModel.xRequestId(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImplementationTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImplementationTest.java new file mode 100644 index 00000000..2ce54e8f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImplementationTest.java @@ -0,0 +1,71 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Implementation model. + */ +public class ImplementationTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImplementation() throws Throwable { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("parameter_name") + .parameterDisplayName("parameter_display_name") + .parameterType("string") + .parameterValue("public") + .build(); + assertEquals(parameterInfoModel.parameterName(), "parameter_name"); + assertEquals(parameterInfoModel.parameterDisplayName(), "parameter_display_name"); + assertEquals(parameterInfoModel.parameterType(), "string"); + assertEquals(parameterInfoModel.parameterValue(), "public"); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("testString") + .assessmentMethod("testString") + .assessmentType("testString") + .assessmentDescription("testString") + .parameterCount(Long.valueOf("26")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + assertEquals(implementationModel.assessmentId(), "testString"); + assertEquals(implementationModel.assessmentMethod(), "testString"); + assertEquals(implementationModel.assessmentType(), "testString"); + assertEquals(implementationModel.assessmentDescription(), "testString"); + assertEquals(implementationModel.parameterCount(), Long.valueOf("26")); + assertEquals(implementationModel.parameters(), java.util.Arrays.asList(parameterInfoModel)); + + String json = TestUtilities.serialize(implementationModel); + + Implementation implementationModelNew = TestUtilities.deserialize(json, Implementation.class); + assertTrue(implementationModelNew instanceof Implementation); + assertEquals(implementationModelNew.assessmentId(), "testString"); + assertEquals(implementationModelNew.assessmentMethod(), "testString"); + assertEquals(implementationModelNew.assessmentType(), "testString"); + assertEquals(implementationModelNew.assessmentDescription(), "testString"); + assertEquals(implementationModelNew.parameterCount(), Long.valueOf("26")); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImportTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImportTest.java new file mode 100644 index 00000000..e318d7c9 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ImportTest.java @@ -0,0 +1,56 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Import model. + */ +public class ImportTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImport() throws Throwable { + Parameter parameterModel = new Parameter.Builder() + .name("name") + .displayName("display_name") + .description("description") + .type("string") + .build(); + assertEquals(parameterModel.name(), "name"); + assertEquals(parameterModel.displayName(), "display_name"); + assertEquals(parameterModel.description(), "description"); + assertEquals(parameterModel.type(), "string"); + + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + assertEquals(importModel.parameters(), java.util.Arrays.asList(parameterModel)); + + String json = TestUtilities.serialize(importModel); + + Import importModelNew = TestUtilities.deserialize(json, Import.class); + assertTrue(importModelNew instanceof Import); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelTypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelTypeTest.java new file mode 100644 index 00000000..8e5aa9c2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LabelTypeTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LabelType; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LabelType model. + */ +public class LabelTypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLabelType() throws Throwable { + LabelType labelTypeModel = new LabelType(); + assertNull(labelTypeModel.getText()); + assertNull(labelTypeModel.getTip()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScanTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScanTest.java new file mode 100644 index 00000000..929a96a5 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/LastScanTest.java @@ -0,0 +1,52 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LastScan; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LastScan model. + */ +public class LastScanTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLastScan() throws Throwable { + LastScan lastScanModel = new LastScan.Builder() + .id("e8a39d25-0051-4328-8462-988ad321f49a") + .status("in_progress") + .time(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + assertEquals(lastScanModel.id(), "e8a39d25-0051-4328-8462-988ad321f49a"); + assertEquals(lastScanModel.status(), "in_progress"); + assertEquals(lastScanModel.time(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + + String json = TestUtilities.serialize(lastScanModel); + + LastScan lastScanModelNew = TestUtilities.deserialize(json, LastScan.class); + assertTrue(lastScanModelNew instanceof LastScan); + assertEquals(lastScanModelNew.id(), "e8a39d25-0051-4328-8462-988ad321f49a"); + assertEquals(lastScanModelNew.status(), "in_progress"); + assertEquals(lastScanModelNew.time(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptionsTest.java new file mode 100644 index 00000000..d2a023c8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptionsTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsAccountOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListAttachmentsAccountOptions model. + */ +public class ListAttachmentsAccountOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListAttachmentsAccountOptions() throws Throwable { + ListAttachmentsAccountOptions listAttachmentsAccountOptionsModel = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .start("testString") + .build(); + assertEquals(listAttachmentsAccountOptionsModel.xCorrelationId(), "testString"); + assertEquals(listAttachmentsAccountOptionsModel.xRequestId(), "testString"); + assertEquals(listAttachmentsAccountOptionsModel.limit(), Long.valueOf("50")); + assertEquals(listAttachmentsAccountOptionsModel.start(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java new file mode 100644 index 00000000..88fbfc01 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListAttachmentsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListAttachmentsOptions model. + */ +public class ListAttachmentsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListAttachmentsOptions() throws Throwable { + ListAttachmentsOptions listAttachmentsOptionsModel = new ListAttachmentsOptions.Builder() + .profilesId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .start("testString") + .build(); + assertEquals(listAttachmentsOptionsModel.profilesId(), "testString"); + assertEquals(listAttachmentsOptionsModel.xCorrelationId(), "testString"); + assertEquals(listAttachmentsOptionsModel.xRequestId(), "testString"); + assertEquals(listAttachmentsOptionsModel.limit(), Long.valueOf("50")); + assertEquals(listAttachmentsOptionsModel.start(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListAttachmentsOptionsError() throws Throwable { + new ListAttachmentsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptionsTest.java new file mode 100644 index 00000000..5cc25889 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListControlLibrariesOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListControlLibrariesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListControlLibrariesOptions model. + */ +public class ListControlLibrariesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListControlLibrariesOptions() throws Throwable { + ListControlLibrariesOptions listControlLibrariesOptionsModel = new ListControlLibrariesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .controlLibraryType("custom") + .start("testString") + .build(); + assertEquals(listControlLibrariesOptionsModel.xCorrelationId(), "testString"); + assertEquals(listControlLibrariesOptionsModel.xRequestId(), "testString"); + assertEquals(listControlLibrariesOptionsModel.limit(), Long.valueOf("50")); + assertEquals(listControlLibrariesOptionsModel.controlLibraryType(), "custom"); + assertEquals(listControlLibrariesOptionsModel.start(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptionsTest.java new file mode 100644 index 00000000..9e0e5942 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProfilesOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProfilesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListProfilesOptions model. + */ +public class ListProfilesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListProfilesOptions() throws Throwable { + ListProfilesOptions listProfilesOptionsModel = new ListProfilesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("50")) + .profileType("custom") + .start("testString") + .build(); + assertEquals(listProfilesOptionsModel.xCorrelationId(), "testString"); + assertEquals(listProfilesOptionsModel.xRequestId(), "testString"); + assertEquals(listProfilesOptionsModel.limit(), Long.valueOf("50")); + assertEquals(listProfilesOptionsModel.profileType(), "custom"); + assertEquals(listProfilesOptionsModel.start(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptionsTest.java new file mode 100644 index 00000000..bac9ea88 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypeInstancesOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypeInstancesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListProviderTypeInstancesOptions model. + */ +public class ListProviderTypeInstancesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListProviderTypeInstancesOptions() throws Throwable { + ListProviderTypeInstancesOptions listProviderTypeInstancesOptionsModel = new ListProviderTypeInstancesOptions.Builder() + .providerTypeId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(listProviderTypeInstancesOptionsModel.providerTypeId(), "testString"); + assertEquals(listProviderTypeInstancesOptionsModel.xCorrelationId(), "testString"); + assertEquals(listProviderTypeInstancesOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListProviderTypeInstancesOptionsError() throws Throwable { + new ListProviderTypeInstancesOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptionsTest.java new file mode 100644 index 00000000..eb582689 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListProviderTypesOptionsTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListProviderTypesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListProviderTypesOptions model. + */ +public class ListProviderTypesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListProviderTypesOptions() throws Throwable { + ListProviderTypesOptions listProviderTypesOptionsModel = new ListProviderTypesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(listProviderTypesOptionsModel.xCorrelationId(), "testString"); + assertEquals(listProviderTypesOptionsModel.xRequestId(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java new file mode 100644 index 00000000..419079ca --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java @@ -0,0 +1,63 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportEvaluationsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListReportEvaluationsOptions model. + */ +public class ListReportEvaluationsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListReportEvaluationsOptions() throws Throwable { + ListReportEvaluationsOptions listReportEvaluationsOptionsModel = new ListReportEvaluationsOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .assessmentId("testString") + .componentId("testString") + .targetId("testString") + .targetName("testString") + .status("failure") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listReportEvaluationsOptionsModel.reportId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.xCorrelationId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.xRequestId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.assessmentId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.componentId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.targetId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.targetName(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.status(), "failure"); + assertEquals(listReportEvaluationsOptionsModel.start(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListReportEvaluationsOptionsError() throws Throwable { + new ListReportEvaluationsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptionsTest.java new file mode 100644 index 00000000..6b8572d7 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportResourcesOptionsTest.java @@ -0,0 +1,65 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportResourcesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListReportResourcesOptions model. + */ +public class ListReportResourcesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListReportResourcesOptions() throws Throwable { + ListReportResourcesOptions listReportResourcesOptionsModel = new ListReportResourcesOptions.Builder() + .reportId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .id("testString") + .resourceName("testString") + .accountId("testString") + .componentId("testString") + .status("compliant") + .sort("account_id") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listReportResourcesOptionsModel.reportId(), "testString"); + assertEquals(listReportResourcesOptionsModel.xCorrelationId(), "testString"); + assertEquals(listReportResourcesOptionsModel.xRequestId(), "testString"); + assertEquals(listReportResourcesOptionsModel.id(), "testString"); + assertEquals(listReportResourcesOptionsModel.resourceName(), "testString"); + assertEquals(listReportResourcesOptionsModel.accountId(), "testString"); + assertEquals(listReportResourcesOptionsModel.componentId(), "testString"); + assertEquals(listReportResourcesOptionsModel.status(), "compliant"); + assertEquals(listReportResourcesOptionsModel.sort(), "account_id"); + assertEquals(listReportResourcesOptionsModel.start(), "testString"); + assertEquals(listReportResourcesOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListReportResourcesOptionsError() throws Throwable { + new ListReportResourcesOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptionsTest.java new file mode 100644 index 00000000..64f0f5cf --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportsOptionsTest.java @@ -0,0 +1,55 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListReportsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListReportsOptions model. + */ +public class ListReportsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListReportsOptions() throws Throwable { + ListReportsOptions listReportsOptionsModel = new ListReportsOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .attachmentId("testString") + .groupId("testString") + .profileId("testString") + .type("scheduled") + .start("testString") + .limit(Long.valueOf("50")) + .sort("profile_name") + .build(); + assertEquals(listReportsOptionsModel.xCorrelationId(), "testString"); + assertEquals(listReportsOptionsModel.xRequestId(), "testString"); + assertEquals(listReportsOptionsModel.attachmentId(), "testString"); + assertEquals(listReportsOptionsModel.groupId(), "testString"); + assertEquals(listReportsOptionsModel.profileId(), "testString"); + assertEquals(listReportsOptionsModel.type(), "scheduled"); + assertEquals(listReportsOptionsModel.start(), "testString"); + assertEquals(listReportsOptionsModel.limit(), Long.valueOf("50")); + assertEquals(listReportsOptionsModel.sort(), "profile_name"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptionsTest.java new file mode 100644 index 00000000..df8e2e29 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListRulesOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ListRulesOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListRulesOptions model. + */ +public class ListRulesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListRulesOptions() throws Throwable { + ListRulesOptions listRulesOptionsModel = new ListRulesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .type("system_defined") + .search("testString") + .serviceName("testString") + .build(); + assertEquals(listRulesOptionsModel.xCorrelationId(), "testString"); + assertEquals(listRulesOptionsModel.xRequestId(), "testString"); + assertEquals(listRulesOptionsModel.type(), "system_defined"); + assertEquals(listRulesOptionsModel.search(), "testString"); + assertEquals(listRulesOptionsModel.serviceName(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScopeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScopeTest.java new file mode 100644 index 00000000..966ff341 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/MultiCloudScopeTest.java @@ -0,0 +1,61 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the MultiCloudScope model. + */ +public class MultiCloudScopeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testMultiCloudScope() throws Throwable { + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("name") + .value("value") + .build(); + assertEquals(propertyItemModel.name(), "name"); + assertEquals(propertyItemModel.value(), "value"); + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("testString") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + assertEquals(multiCloudScopeModel.environment(), "testString"); + assertEquals(multiCloudScopeModel.xProperties(), java.util.Arrays.asList(propertyItemModel)); + + String json = TestUtilities.serialize(multiCloudScopeModel); + + MultiCloudScope multiCloudScopeModelNew = TestUtilities.deserialize(json, MultiCloudScope.class); + assertTrue(multiCloudScopeModelNew instanceof MultiCloudScope); + assertEquals(multiCloudScopeModelNew.environment(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testMultiCloudScopeError() throws Throwable { + new MultiCloudScope.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorageTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorageTest.java new file mode 100644 index 00000000..daeb0261 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ObjectStorageTest.java @@ -0,0 +1,58 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ObjectStorage; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ObjectStorage model. + */ +public class ObjectStorageTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testObjectStorage() throws Throwable { + ObjectStorage objectStorageModel = new ObjectStorage.Builder() + .instanceCrn("testString") + .bucket("testString") + .bucketLocation("testString") + .bucketEndpoint("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + assertEquals(objectStorageModel.instanceCrn(), "testString"); + assertEquals(objectStorageModel.bucket(), "testString"); + assertEquals(objectStorageModel.bucketLocation(), "testString"); + assertEquals(objectStorageModel.bucketEndpoint(), "testString"); + assertEquals(objectStorageModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + + String json = TestUtilities.serialize(objectStorageModel); + + ObjectStorage objectStorageModelNew = TestUtilities.deserialize(json, ObjectStorage.class); + assertTrue(objectStorageModelNew instanceof ObjectStorage); + assertEquals(objectStorageModelNew.instanceCrn(), "testString"); + assertEquals(objectStorageModelNew.bucket(), "testString"); + assertEquals(objectStorageModelNew.bucketLocation(), "testString"); + assertEquals(objectStorageModelNew.bucketEndpoint(), "testString"); + assertEquals(objectStorageModelNew.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirstTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirstTest.java new file mode 100644 index 00000000..4bfddbc1 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefFirstTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PageHRefFirst model. + */ +public class PageHRefFirstTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPageHRefFirst() throws Throwable { + PageHRefFirst pageHRefFirstModel = new PageHRefFirst(); + assertNull(pageHRefFirstModel.getHref()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNextTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNextTest.java new file mode 100644 index 00000000..1f9ff849 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefNextTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PageHRefNext model. + */ +public class PageHRefNextTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPageHRefNext() throws Throwable { + PageHRefNext pageHRefNextModel = new PageHRefNext(); + assertNull(pageHRefNextModel.getHref()); + assertNull(pageHRefNextModel.getStart()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefTest.java new file mode 100644 index 00000000..7d91af8b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PageHRefTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRef; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PageHRef model. + */ +public class PageHRefTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPageHRef() throws Throwable { + PageHRef pageHRefModel = new PageHRef(); + assertNull(pageHRefModel.getHref()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirstTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirstTest.java new file mode 100644 index 00000000..bdb2c9cd --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionFirstTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PaginatedCollectionFirst model. + */ +public class PaginatedCollectionFirstTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPaginatedCollectionFirst() throws Throwable { + PaginatedCollectionFirst paginatedCollectionFirstModel = new PaginatedCollectionFirst(); + assertNull(paginatedCollectionFirstModel.getHref()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNextTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNextTest.java new file mode 100644 index 00000000..1493171c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PaginatedCollectionNextTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PaginatedCollectionNext model. + */ +public class PaginatedCollectionNextTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPaginatedCollectionNext() throws Throwable { + PaginatedCollectionNext paginatedCollectionNextModel = new PaginatedCollectionNext(); + assertNull(paginatedCollectionNextModel.getHref()); + assertNull(paginatedCollectionNextModel.getStart()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfoTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfoTest.java new file mode 100644 index 00000000..442fa6bc --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfoTest.java @@ -0,0 +1,54 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ParameterInfo model. + */ +public class ParameterInfoTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testParameterInfo() throws Throwable { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("location") + .parameterDisplayName("Location") + .parameterType("string") + .parameterValue("public") + .build(); + assertEquals(parameterInfoModel.parameterName(), "location"); + assertEquals(parameterInfoModel.parameterDisplayName(), "Location"); + assertEquals(parameterInfoModel.parameterType(), "string"); + assertEquals(parameterInfoModel.parameterValue(), "public"); + + String json = TestUtilities.serialize(parameterInfoModel); + + ParameterInfo parameterInfoModelNew = TestUtilities.deserialize(json, ParameterInfo.class); + assertTrue(parameterInfoModelNew instanceof ParameterInfo); + assertEquals(parameterInfoModelNew.parameterName(), "location"); + assertEquals(parameterInfoModelNew.parameterDisplayName(), "Location"); + assertEquals(parameterInfoModelNew.parameterType(), "string"); + assertEquals(parameterInfoModelNew.parameterValue(), "public"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterTest.java new file mode 100644 index 00000000..63c9f29c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterTest.java @@ -0,0 +1,54 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Parameter model. + */ +public class ParameterTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testParameter() throws Throwable { + Parameter parameterModel = new Parameter.Builder() + .name("testString") + .displayName("testString") + .description("testString") + .type("string") + .build(); + assertEquals(parameterModel.name(), "testString"); + assertEquals(parameterModel.displayName(), "testString"); + assertEquals(parameterModel.description(), "testString"); + assertEquals(parameterModel.type(), "string"); + + String json = TestUtilities.serialize(parameterModel); + + Parameter parameterModelNew = TestUtilities.deserialize(json, Parameter.class); + assertTrue(parameterModelNew instanceof Parameter); + assertEquals(parameterModelNew.name(), "testString"); + assertEquals(parameterModelNew.displayName(), "testString"); + assertEquals(parameterModelNew.description(), "testString"); + assertEquals(parameterModelNew.type(), "string"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptionsTest.java new file mode 100644 index 00000000..b299a192 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PostTestEventOptionsTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PostTestEventOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PostTestEventOptions model. + */ +public class PostTestEventOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPostTestEventOptions() throws Throwable { + PostTestEventOptions postTestEventOptionsModel = new PostTestEventOptions.Builder() + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + assertEquals(postTestEventOptionsModel.xCorrelationId(), "1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5"); + assertEquals(postTestEventOptionsModel.xRequestId(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollectionTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollectionTest.java new file mode 100644 index 00000000..ab702fc2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollectionTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PaginatedCollectionNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProfileCollection model. + */ +public class ProfileCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProfileCollection() throws Throwable { + ProfileCollection profileCollectionModel = new ProfileCollection(); + assertNull(profileCollectionModel.getTotalCount()); + assertNull(profileCollectionModel.getLimit()); + assertNull(profileCollectionModel.getFirst()); + assertNull(profileCollectionModel.getNext()); + assertNull(profileCollectionModel.getProfiles()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototypeTest.java new file mode 100644 index 00000000..f61c3070 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsPrototypeTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControlsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProfileControlsPrototype model. + */ +public class ProfileControlsPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProfileControlsPrototype() throws Throwable { + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId("e98a56ff-dc24-41d4-9875-1e188e2da6cd") + .controlId("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF") + .build(); + assertEquals(profileControlsPrototypeModel.controlLibraryId(), "e98a56ff-dc24-41d4-9875-1e188e2da6cd"); + assertEquals(profileControlsPrototypeModel.controlId(), "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF"); + + String json = TestUtilities.serialize(profileControlsPrototypeModel); + + ProfileControlsPrototype profileControlsPrototypeModelNew = TestUtilities.deserialize(json, ProfileControlsPrototype.class); + assertTrue(profileControlsPrototypeModelNew instanceof ProfileControlsPrototype); + assertEquals(profileControlsPrototypeModelNew.controlLibraryId(), "e98a56ff-dc24-41d4-9875-1e188e2da6cd"); + assertEquals(profileControlsPrototypeModelNew.controlId(), "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsTest.java new file mode 100644 index 00000000..ace4370a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileControlsTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProfileControls model. + */ +public class ProfileControlsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProfileControls() throws Throwable { + ProfileControls profileControlsModel = new ProfileControls(); + assertNull(profileControlsModel.getControlLibraryId()); + assertNull(profileControlsModel.getControlId()); + assertNull(profileControlsModel.getControlLibraryVersion()); + assertNull(profileControlsModel.getControlName()); + assertNull(profileControlsModel.getControlDescription()); + assertNull(profileControlsModel.getControlCategory()); + assertNull(profileControlsModel.getControlParent()); + assertNull(profileControlsModel.isControlRequirement()); + assertNull(profileControlsModel.getControlDocs()); + assertNull(profileControlsModel.getControlSpecificationsCount()); + assertNull(profileControlsModel.getControlSpecifications()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfoTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfoTest.java new file mode 100644 index 00000000..4f825811 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileInfoTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProfileInfo model. + */ +public class ProfileInfoTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProfileInfo() throws Throwable { + ProfileInfo profileInfoModel = new ProfileInfo(); + assertNull(profileInfoModel.getId()); + assertNull(profileInfoModel.getName()); + assertNull(profileInfoModel.getVersion()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItemTest.java new file mode 100644 index 00000000..cd1834e8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileItemTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProfileItem model. + */ +public class ProfileItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProfileItem() throws Throwable { + ProfileItem profileItemModel = new ProfileItem(); + assertNull(profileItemModel.getId()); + assertNull(profileItemModel.getProfileName()); + assertNull(profileItemModel.getProfileDescription()); + assertNull(profileItemModel.getProfileType()); + assertNull(profileItemModel.getProfileVersion()); + assertNull(profileItemModel.getVersionGroupLabel()); + assertNull(profileItemModel.isLatest()); + assertNull(profileItemModel.getCreatedBy()); + assertNull(profileItemModel.getCreatedOn()); + assertNull(profileItemModel.getUpdatedBy()); + assertNull(profileItemModel.getUpdatedOn()); + assertNull(profileItemModel.getControlsCount()); + assertNull(profileItemModel.getAttachmentsCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileTest.java new file mode 100644 index 00000000..954bde2f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DefaultParametersPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Profile; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Profile model. + */ +public class ProfileTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProfile() throws Throwable { + Profile profileModel = new Profile(); + assertNull(profileModel.getId()); + assertNull(profileModel.getProfileName()); + assertNull(profileModel.getProfileDescription()); + assertNull(profileModel.getProfileType()); + assertNull(profileModel.getProfileVersion()); + assertNull(profileModel.getVersionGroupLabel()); + assertNull(profileModel.getInstanceId()); + assertNull(profileModel.isLatest()); + assertNull(profileModel.isHierarchyEnabled()); + assertNull(profileModel.getCreatedBy()); + assertNull(profileModel.getCreatedOn()); + assertNull(profileModel.getUpdatedBy()); + assertNull(profileModel.getUpdatedOn()); + assertNull(profileModel.getControlsCount()); + assertNull(profileModel.getControlParentsCount()); + assertNull(profileModel.getAttachmentsCount()); + assertNull(profileModel.getControls()); + assertNull(profileModel.getDefaultParameters()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItemTest.java new file mode 100644 index 00000000..71032a98 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyItemTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PropertyItem model. + */ +public class PropertyItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPropertyItem() throws Throwable { + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("testString") + .value("testString") + .build(); + assertEquals(propertyItemModel.name(), "testString"); + assertEquals(propertyItemModel.value(), "testString"); + + String json = TestUtilities.serialize(propertyItemModel); + + PropertyItem propertyItemModelNew = TestUtilities.deserialize(json, PropertyItem.class); + assertTrue(propertyItemModelNew instanceof PropertyItem); + assertEquals(propertyItemModelNew.name(), "testString"); + assertEquals(propertyItemModelNew.value(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyTest.java new file mode 100644 index 00000000..dc51f570 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/PropertyTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Property model. + */ +public class PropertyTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProperty() throws Throwable { + Property propertyModel = new Property(); + assertNull(propertyModel.getProperty()); + assertNull(propertyModel.getPropertyDescription()); + assertNull(propertyModel.getOperator()); + assertNull(propertyModel.getExpectedValue()); + assertNull(propertyModel.getFoundValue()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java new file mode 100644 index 00000000..43f490e8 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProviderTypeInstanceItem model. + */ +public class ProviderTypeInstanceItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderTypeInstanceItem() throws Throwable { + ProviderTypeInstanceItem providerTypeInstanceItemModel = new ProviderTypeInstanceItem(); + assertNull(providerTypeInstanceItemModel.getId()); + assertNull(providerTypeInstanceItemModel.getType()); + assertNull(providerTypeInstanceItemModel.getName()); + assertNull(providerTypeInstanceItemModel.getAttributes()); + assertNull(providerTypeInstanceItemModel.getCreatedAt()); + assertNull(providerTypeInstanceItemModel.getUpdatedAt()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java new file mode 100644 index 00000000..7d94ee45 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProviderTypeInstancesResponse model. + */ +public class ProviderTypeInstancesResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderTypeInstancesResponse() throws Throwable { + ProviderTypeInstancesResponse providerTypeInstancesResponseModel = new ProviderTypeInstancesResponse(); + assertNull(providerTypeInstancesResponseModel.getProviderTypeInstances()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItemTest.java new file mode 100644 index 00000000..97b68b8a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeItemTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LabelType; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProviderTypeItem model. + */ +public class ProviderTypeItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderTypeItem() throws Throwable { + ProviderTypeItem providerTypeItemModel = new ProviderTypeItem(); + assertNull(providerTypeItemModel.getId()); + assertNull(providerTypeItemModel.getType()); + assertNull(providerTypeItemModel.getName()); + assertNull(providerTypeItemModel.getDescription()); + assertNull(providerTypeItemModel.isS2sEnabled()); + assertNull(providerTypeItemModel.getInstanceLimit()); + assertNull(providerTypeItemModel.getMode()); + assertNull(providerTypeItemModel.getDataType()); + assertNull(providerTypeItemModel.getIcon()); + assertNull(providerTypeItemModel.getLabel()); + assertNull(providerTypeItemModel.getAttributes()); + assertNull(providerTypeItemModel.getCreatedAt()); + assertNull(providerTypeItemModel.getUpdatedAt()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollectionTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollectionTest.java new file mode 100644 index 00000000..2ee6cecf --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesCollectionTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LabelType; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesCollection; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProviderTypesCollection model. + */ +public class ProviderTypesCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderTypesCollection() throws Throwable { + ProviderTypesCollection providerTypesCollectionModel = new ProviderTypesCollection(); + assertNull(providerTypesCollectionModel.getProviderTypes()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java new file mode 100644 index 00000000..841ae8f2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesInstancesResponse; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ProviderTypesInstancesResponse model. + */ +public class ProviderTypesInstancesResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderTypesInstancesResponse() throws Throwable { + ProviderTypesInstancesResponse providerTypesInstancesResponseModel = new ProviderTypesInstancesResponse(); + assertNull(providerTypesInstancesResponseModel.getProviderTypesInstances()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java new file mode 100644 index 00000000..fb24cac2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java @@ -0,0 +1,162 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlDocs; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlsInControlLib; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Implementation; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceCustomControlLibraryOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReplaceCustomControlLibraryOptions model. + */ +public class ReplaceCustomControlLibraryOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReplaceCustomControlLibraryOptions() throws Throwable { + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("location") + .parameterDisplayName("Location") + .parameterType("string") + .parameterValue("public") + .build(); + assertEquals(parameterInfoModel.parameterName(), "location"); + assertEquals(parameterInfoModel.parameterDisplayName(), "Location"); + assertEquals(parameterInfoModel.parameterType(), "string"); + assertEquals(parameterInfoModel.parameterValue(), "public"); + + Implementation implementationModel = new Implementation.Builder() + .assessmentId("testString") + .assessmentMethod("testString") + .assessmentType("testString") + .assessmentDescription("testString") + .parameterCount(Long.valueOf("26")) + .parameters(java.util.Arrays.asList(parameterInfoModel)) + .build(); + assertEquals(implementationModel.assessmentId(), "testString"); + assertEquals(implementationModel.assessmentMethod(), "testString"); + assertEquals(implementationModel.assessmentType(), "testString"); + assertEquals(implementationModel.assessmentDescription(), "testString"); + assertEquals(implementationModel.parameterCount(), Long.valueOf("26")); + assertEquals(implementationModel.parameters(), java.util.Arrays.asList(parameterInfoModel)); + + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") + .responsibility("user") + .componentId("f3517159-889e-4781-819a-89d89b747c85") + .componenetName("testString") + .environment("testString") + .controlSpecificationDescription("testString") + .assessmentsCount(Long.valueOf("26")) + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.responsibility(), "user"); + assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(controlSpecificationsModel.componenetName(), "testString"); + assertEquals(controlSpecificationsModel.environment(), "testString"); + assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "testString"); + assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("26")); + assertEquals(controlSpecificationsModel.assessments(), java.util.Arrays.asList(implementationModel)); + + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("testString") + .controlDocsType("testString") + .build(); + assertEquals(controlDocsModel.controlDocsId(), "testString"); + assertEquals(controlDocsModel.controlDocsType(), "testString"); + + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("testString") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("testString") + .controlCategory("testString") + .controlParent("testString") + .controlTags(java.util.Arrays.asList("testString")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .status("enabled") + .build(); + assertEquals(controlsInControlLibModel.controlName(), "testString"); + assertEquals(controlsInControlLibModel.controlId(), "1fa45e17-9322-4e6c-bbd6-1c51db08e790"); + assertEquals(controlsInControlLibModel.controlDescription(), "testString"); + assertEquals(controlsInControlLibModel.controlCategory(), "testString"); + assertEquals(controlsInControlLibModel.controlParent(), "testString"); + assertEquals(controlsInControlLibModel.controlTags(), java.util.Arrays.asList("testString")); + assertEquals(controlsInControlLibModel.controlSpecifications(), java.util.Arrays.asList(controlSpecificationsModel)); + assertEquals(controlsInControlLibModel.controlDocs(), controlDocsModel); + assertEquals(controlsInControlLibModel.controlRequirement(), Boolean.valueOf(true)); + assertEquals(controlsInControlLibModel.status(), "enabled"); + + ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptionsModel = new ReplaceCustomControlLibraryOptions.Builder() + .controlLibrariesId("testString") + .id("f3517159-889e-4781-819a-89d89b747c85") + .accountId("130003ea8bfa43c5aacea07a86da3000") + .controlLibraryName("testString") + .controlLibraryDescription("testString") + .controlLibraryType("predefined") + .versionGroupLabel("e0923045-f00d-44de-b49b-6f1f0e8033cc") + .controlLibraryVersion("testString") + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .latest(true) + .hierarchyEnabled(true) + .controlsCount(Long.valueOf("26")) + .controlParentsCount(Long.valueOf("26")) + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(replaceCustomControlLibraryOptionsModel.controlLibrariesId(), "testString"); + assertEquals(replaceCustomControlLibraryOptionsModel.id(), "f3517159-889e-4781-819a-89d89b747c85"); + assertEquals(replaceCustomControlLibraryOptionsModel.accountId(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(replaceCustomControlLibraryOptionsModel.controlLibraryName(), "testString"); + assertEquals(replaceCustomControlLibraryOptionsModel.controlLibraryDescription(), "testString"); + assertEquals(replaceCustomControlLibraryOptionsModel.controlLibraryType(), "predefined"); + assertEquals(replaceCustomControlLibraryOptionsModel.versionGroupLabel(), "e0923045-f00d-44de-b49b-6f1f0e8033cc"); + assertEquals(replaceCustomControlLibraryOptionsModel.controlLibraryVersion(), "testString"); + assertEquals(replaceCustomControlLibraryOptionsModel.createdOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(replaceCustomControlLibraryOptionsModel.createdBy(), "testString"); + assertEquals(replaceCustomControlLibraryOptionsModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(replaceCustomControlLibraryOptionsModel.updatedBy(), "testString"); + assertEquals(replaceCustomControlLibraryOptionsModel.latest(), Boolean.valueOf(true)); + assertEquals(replaceCustomControlLibraryOptionsModel.hierarchyEnabled(), Boolean.valueOf(true)); + assertEquals(replaceCustomControlLibraryOptionsModel.controlsCount(), Long.valueOf("26")); + assertEquals(replaceCustomControlLibraryOptionsModel.controlParentsCount(), Long.valueOf("26")); + assertEquals(replaceCustomControlLibraryOptionsModel.controls(), java.util.Arrays.asList(controlsInControlLibModel)); + assertEquals(replaceCustomControlLibraryOptionsModel.xCorrelationId(), "testString"); + assertEquals(replaceCustomControlLibraryOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceCustomControlLibraryOptionsError() throws Throwable { + new ReplaceCustomControlLibraryOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java new file mode 100644 index 00000000..862b5138 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java @@ -0,0 +1,144 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentParameterPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentsNotificationsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.FailedControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.LastScan; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.MultiCloudScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileAttachmentOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReplaceProfileAttachmentOptions model. + */ +public class ReplaceProfileAttachmentOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReplaceProfileAttachmentOptions() throws Throwable { + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("testString") + .value("testString") + .build(); + assertEquals(propertyItemModel.name(), "testString"); + assertEquals(propertyItemModel.value(), "testString"); + + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("testString") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + assertEquals(multiCloudScopeModel.environment(), "testString"); + assertEquals(multiCloudScopeModel.xProperties(), java.util.Arrays.asList(propertyItemModel)); + + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("26")) + .failedControlIds(java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")) + .build(); + assertEquals(failedControlsModel.thresholdLimit(), Long.valueOf("26")); + assertEquals(failedControlsModel.failedControlIds(), java.util.Arrays.asList("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF")); + + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(true) + .controls(failedControlsModel) + .build(); + assertEquals(attachmentsNotificationsPrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(attachmentsNotificationsPrototypeModel.controls(), failedControlsModel); + + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("testString") + .assessmentId("testString") + .parameterName("testString") + .parameterValue("testString") + .parameterDisplayName("testString") + .parameterType("string") + .build(); + assertEquals(attachmentParameterPrototypeModel.assessmentType(), "testString"); + assertEquals(attachmentParameterPrototypeModel.assessmentId(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterName(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterValue(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterDisplayName(), "testString"); + assertEquals(attachmentParameterPrototypeModel.parameterType(), "string"); + + LastScan lastScanModel = new LastScan.Builder() + .id("e8a39d25-0051-4328-8462-988ad321f49a") + .status("in_progress") + .time(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + assertEquals(lastScanModel.id(), "e8a39d25-0051-4328-8462-988ad321f49a"); + assertEquals(lastScanModel.status(), "in_progress"); + assertEquals(lastScanModel.time(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + + ReplaceProfileAttachmentOptions replaceProfileAttachmentOptionsModel = new ReplaceProfileAttachmentOptions.Builder() + .attachmentId("testString") + .profilesId("testString") + .id("130003ea8bfa43c5aacea07a86da3000") + .profileId("7ec45986-54fc-4b66-a303-d9577b078c65") + .accountId("130003ea8bfa43c5aacea07a86da3000") + .instanceId("edf9524f-406c-412c-acbb-ee371a5cabda") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .createdOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .createdBy("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .updatedBy("testString") + .status("enabled") + .schedule("daily") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .lastScan(lastScanModel) + .nextScanTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("account-130003ea8bfa43c5aacea07a86da3000") + .description("Test description") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(replaceProfileAttachmentOptionsModel.attachmentId(), "testString"); + assertEquals(replaceProfileAttachmentOptionsModel.profilesId(), "testString"); + assertEquals(replaceProfileAttachmentOptionsModel.id(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(replaceProfileAttachmentOptionsModel.profileId(), "7ec45986-54fc-4b66-a303-d9577b078c65"); + assertEquals(replaceProfileAttachmentOptionsModel.accountId(), "130003ea8bfa43c5aacea07a86da3000"); + assertEquals(replaceProfileAttachmentOptionsModel.instanceId(), "edf9524f-406c-412c-acbb-ee371a5cabda"); + assertEquals(replaceProfileAttachmentOptionsModel.scope(), java.util.Arrays.asList(multiCloudScopeModel)); + assertEquals(replaceProfileAttachmentOptionsModel.createdOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(replaceProfileAttachmentOptionsModel.createdBy(), "testString"); + assertEquals(replaceProfileAttachmentOptionsModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(replaceProfileAttachmentOptionsModel.updatedBy(), "testString"); + assertEquals(replaceProfileAttachmentOptionsModel.status(), "enabled"); + assertEquals(replaceProfileAttachmentOptionsModel.schedule(), "daily"); + assertEquals(replaceProfileAttachmentOptionsModel.notifications(), attachmentsNotificationsPrototypeModel); + assertEquals(replaceProfileAttachmentOptionsModel.attachmentParameters(), java.util.Arrays.asList(attachmentParameterPrototypeModel)); + assertEquals(replaceProfileAttachmentOptionsModel.lastScan(), lastScanModel); + assertEquals(replaceProfileAttachmentOptionsModel.nextScanTime(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(replaceProfileAttachmentOptionsModel.name(), "account-130003ea8bfa43c5aacea07a86da3000"); + assertEquals(replaceProfileAttachmentOptionsModel.description(), "Test description"); + assertEquals(replaceProfileAttachmentOptionsModel.xCorrelationId(), "testString"); + assertEquals(replaceProfileAttachmentOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceProfileAttachmentOptionsError() throws Throwable { + new ReplaceProfileAttachmentOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java new file mode 100644 index 00000000..6a78d864 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java @@ -0,0 +1,83 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.DefaultParametersPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileControlsPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceProfileOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReplaceProfileOptions model. + */ +public class ReplaceProfileOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReplaceProfileOptions() throws Throwable { + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId("e98a56ff-dc24-41d4-9875-1e188e2da6cd") + .controlId("5C453578-E9A1-421E-AD0F-C6AFCDD67CCF") + .build(); + assertEquals(profileControlsPrototypeModel.controlLibraryId(), "e98a56ff-dc24-41d4-9875-1e188e2da6cd"); + assertEquals(profileControlsPrototypeModel.controlId(), "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF"); + + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("testString") + .assessmentId("testString") + .parameterName("testString") + .parameterDefaultValue("testString") + .parameterDisplayName("testString") + .parameterType("string") + .build(); + assertEquals(defaultParametersPrototypeModel.assessmentType(), "testString"); + assertEquals(defaultParametersPrototypeModel.assessmentId(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterName(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterDefaultValue(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterDisplayName(), "testString"); + assertEquals(defaultParametersPrototypeModel.parameterType(), "string"); + + ReplaceProfileOptions replaceProfileOptionsModel = new ReplaceProfileOptions.Builder() + .profilesId("testString") + .profileName("testString") + .profileDescription("testString") + .profileType("predefined") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(replaceProfileOptionsModel.profilesId(), "testString"); + assertEquals(replaceProfileOptionsModel.profileName(), "testString"); + assertEquals(replaceProfileOptionsModel.profileDescription(), "testString"); + assertEquals(replaceProfileOptionsModel.profileType(), "predefined"); + assertEquals(replaceProfileOptionsModel.controls(), java.util.Arrays.asList(profileControlsPrototypeModel)); + assertEquals(replaceProfileOptionsModel.defaultParameters(), java.util.Arrays.asList(defaultParametersPrototypeModel)); + assertEquals(replaceProfileOptionsModel.xCorrelationId(), "testString"); + assertEquals(replaceProfileOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceProfileOptionsError() throws Throwable { + new ReplaceProfileOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java new file mode 100644 index 00000000..d90b030d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java @@ -0,0 +1,119 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceRuleOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReplaceRuleOptions model. + */ +public class ReplaceRuleOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReplaceRuleOptions() throws Throwable { + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(additionalTargetAttributeModel.name(), "testString"); + assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); + assertEquals(additionalTargetAttributeModel.value(), "testString"); + + Target targetModel = new Target.Builder() + .serviceName("testString") + .serviceDisplayName("testString") + .resourceKind("testString") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + assertEquals(targetModel.serviceName(), "testString"); + assertEquals(targetModel.serviceDisplayName(), "testString"); + assertEquals(targetModel.resourceKind(), "testString"); + assertEquals(targetModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); + + RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() + .description("testString") + .build(); + assertEquals(requiredConfigItemsModel.description(), "testString"); + + RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("testString") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + assertEquals(requiredConfigModel.description(), "testString"); + assertEquals(requiredConfigModel.and(), java.util.Arrays.asList(requiredConfigItemsModel)); + + Parameter parameterModel = new Parameter.Builder() + .name("testString") + .displayName("testString") + .description("testString") + .type("string") + .build(); + assertEquals(parameterModel.name(), "testString"); + assertEquals(parameterModel.displayName(), "testString"); + assertEquals(parameterModel.description(), "testString"); + assertEquals(parameterModel.type(), "string"); + + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + assertEquals(importModel.parameters(), java.util.Arrays.asList(parameterModel)); + + ReplaceRuleOptions replaceRuleOptionsModel = new ReplaceRuleOptions.Builder() + .ruleId("testString") + .ifMatch("testString") + .description("testString") + .target(targetModel) + .requiredConfig(requiredConfigModel) + .type("user_defined") + .version("testString") + .xImport(importModel) + .labels(java.util.Arrays.asList("testString")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(replaceRuleOptionsModel.ruleId(), "testString"); + assertEquals(replaceRuleOptionsModel.ifMatch(), "testString"); + assertEquals(replaceRuleOptionsModel.description(), "testString"); + assertEquals(replaceRuleOptionsModel.target(), targetModel); + assertEquals(replaceRuleOptionsModel.requiredConfig(), requiredConfigModel); + assertEquals(replaceRuleOptionsModel.type(), "user_defined"); + assertEquals(replaceRuleOptionsModel.version(), "testString"); + assertEquals(replaceRuleOptionsModel.xImport(), importModel); + assertEquals(replaceRuleOptionsModel.labels(), java.util.Arrays.asList("testString")); + assertEquals(replaceRuleOptionsModel.xCorrelationId(), "testString"); + assertEquals(replaceRuleOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceRuleOptionsError() throws Throwable { + new ReplaceRuleOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControlsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControlsTest.java new file mode 100644 index 00000000..b61488c1 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportControlsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Assessment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlSpecificationWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ControlWithStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ParameterInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportControls; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReportControls model. + */ +public class ReportControlsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReportControls() throws Throwable { + ReportControls reportControlsModel = new ReportControls(); + assertNull(reportControlsModel.getStatus()); + assertNull(reportControlsModel.getTotalCount()); + assertNull(reportControlsModel.getCompliantCount()); + assertNull(reportControlsModel.getNotCompliantCount()); + assertNull(reportControlsModel.getUnableToPerformCount()); + assertNull(reportControlsModel.getUserEvaluationRequiredCount()); + assertNull(reportControlsModel.getHomeAccountId()); + assertNull(reportControlsModel.getReportId()); + assertNull(reportControlsModel.getControls()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatestTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatestTest.java new file mode 100644 index 00000000..4d344dc4 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportLatestTest.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Attachment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceScore; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Report; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportLatest; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReportLatest model. + */ +public class ReportLatestTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReportLatest() throws Throwable { + ReportLatest reportLatestModel = new ReportLatest(); + assertNull(reportLatestModel.getHomeAccountId()); + assertNull(reportLatestModel.getControlsSummary()); + assertNull(reportLatestModel.getEvaluationsSummary()); + assertNull(reportLatestModel.getScore()); + assertNull(reportLatestModel.getReports()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPageTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPageTest.java new file mode 100644 index 00000000..040b2cd3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportPageTest.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Attachment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRef; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Report; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportPage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReportPage model. + */ +public class ReportPageTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReportPage() throws Throwable { + ReportPage reportPageModel = new ReportPage(); + assertNull(reportPageModel.getTotalCount()); + assertNull(reportPageModel.getLimit()); + assertNull(reportPageModel.getStart()); + assertNull(reportPageModel.getFirst()); + assertNull(reportPageModel.getNext()); + assertNull(reportPageModel.getHomeAccountId()); + assertNull(reportPageModel.getReports()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummaryTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummaryTest.java new file mode 100644 index 00000000..ff2b0cae --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportSummaryTest.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceScore; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EvalStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummaryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReportSummary model. + */ +public class ReportSummaryTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReportSummary() throws Throwable { + ReportSummary reportSummaryModel = new ReportSummary(); + assertNull(reportSummaryModel.getReportId()); + assertNull(reportSummaryModel.getIsntanceId()); + assertNull(reportSummaryModel.getAccount()); + assertNull(reportSummaryModel.getScore()); + assertNull(reportSummaryModel.getControls()); + assertNull(reportSummaryModel.getEvaluations()); + assertNull(reportSummaryModel.getResources()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTagsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTagsTest.java new file mode 100644 index 00000000..ae466f9c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTagsTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportTags; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReportTags model. + */ +public class ReportTagsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReportTags() throws Throwable { + ReportTags reportTagsModel = new ReportTags(); + assertNull(reportTagsModel.getReportId()); + assertNull(reportTagsModel.getTags()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTest.java new file mode 100644 index 00000000..1a9be977 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Attachment; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AttachmentScope; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfileInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Report; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Report model. + */ +public class ReportTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReport() throws Throwable { + Report reportModel = new Report(); + assertNull(reportModel.getId()); + assertNull(reportModel.getGroupId()); + assertNull(reportModel.getCreatedOn()); + assertNull(reportModel.getScanTime()); + assertNull(reportModel.getType()); + assertNull(reportModel.getCosObject()); + assertNull(reportModel.getInstanceId()); + assertNull(reportModel.getAccount()); + assertNull(reportModel.getProfile()); + assertNull(reportModel.getAttachment()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPointTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPointTest.java new file mode 100644 index 00000000..f3f50a91 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationDataPointTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationDataPoint; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReportViolationDataPoint model. + */ +public class ReportViolationDataPointTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReportViolationDataPoint() throws Throwable { + ReportViolationDataPoint reportViolationDataPointModel = new ReportViolationDataPoint(); + assertNull(reportViolationDataPointModel.getReportId()); + assertNull(reportViolationDataPointModel.getReportGroupId()); + assertNull(reportViolationDataPointModel.getScanTime()); + assertNull(reportViolationDataPointModel.getControls()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDriftTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDriftTest.java new file mode 100644 index 00000000..8e85ce62 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReportViolationsDriftTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ComplianceStats; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationDataPoint; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ReportViolationsDrift model. + */ +public class ReportViolationsDriftTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testReportViolationsDrift() throws Throwable { + ReportViolationsDrift reportViolationsDriftModel = new ReportViolationsDrift(); + assertNull(reportViolationsDriftModel.getHomeAccountId()); + assertNull(reportViolationsDriftModel.getReportId()); + assertNull(reportViolationsDriftModel.getDataPoints()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndTest.java new file mode 100644 index 00000000..fec2b590 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigItemsRequiredConfigAnd model. + */ +public class RequiredConfigItemsRequiredConfigAndTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigItemsRequiredConfigAnd() throws Throwable { + RequiredConfigItemsRequiredConfigAnd requiredConfigItemsRequiredConfigAndModel = new RequiredConfigItemsRequiredConfigAnd.Builder() + .description("testString") + .build(); + assertEquals(requiredConfigItemsRequiredConfigAndModel.description(), "testString"); + + String json = TestUtilities.serialize(requiredConfigItemsRequiredConfigAndModel); + + RequiredConfigItemsRequiredConfigAnd requiredConfigItemsRequiredConfigAndModelNew = TestUtilities.deserialize(json, RequiredConfigItemsRequiredConfigAnd.class); + assertTrue(requiredConfigItemsRequiredConfigAndModelNew instanceof RequiredConfigItemsRequiredConfigAnd); + assertEquals(requiredConfigItemsRequiredConfigAndModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBaseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBaseTest.java new file mode 100644 index 00000000..a65a11b0 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigBaseTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigItemsRequiredConfigBase model. + */ +public class RequiredConfigItemsRequiredConfigBaseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigItemsRequiredConfigBase() throws Throwable { + RequiredConfigItemsRequiredConfigBase requiredConfigItemsRequiredConfigBaseModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigItemsRequiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigItemsRequiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigItemsRequiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigItemsRequiredConfigBaseModel.value(), "testString"); + + String json = TestUtilities.serialize(requiredConfigItemsRequiredConfigBaseModel); + + RequiredConfigItemsRequiredConfigBase requiredConfigItemsRequiredConfigBaseModelNew = TestUtilities.deserialize(json, RequiredConfigItemsRequiredConfigBase.class); + assertTrue(requiredConfigItemsRequiredConfigBaseModelNew instanceof RequiredConfigItemsRequiredConfigBase); + assertEquals(requiredConfigItemsRequiredConfigBaseModelNew.description(), "testString"); + assertEquals(requiredConfigItemsRequiredConfigBaseModelNew.property(), "testString"); + assertEquals(requiredConfigItemsRequiredConfigBaseModelNew.operator(), "string_equals"); + assertEquals(requiredConfigItemsRequiredConfigBaseModelNew.value(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRequiredConfigItemsRequiredConfigBaseError() throws Throwable { + new RequiredConfigItemsRequiredConfigBase.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrTest.java new file mode 100644 index 00000000..3034157a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigItemsRequiredConfigOr model. + */ +public class RequiredConfigItemsRequiredConfigOrTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigItemsRequiredConfigOr() throws Throwable { + RequiredConfigItemsRequiredConfigOr requiredConfigItemsRequiredConfigOrModel = new RequiredConfigItemsRequiredConfigOr.Builder() + .description("testString") + .build(); + assertEquals(requiredConfigItemsRequiredConfigOrModel.description(), "testString"); + + String json = TestUtilities.serialize(requiredConfigItemsRequiredConfigOrModel); + + RequiredConfigItemsRequiredConfigOr requiredConfigItemsRequiredConfigOrModelNew = TestUtilities.deserialize(json, RequiredConfigItemsRequiredConfigOr.class); + assertTrue(requiredConfigItemsRequiredConfigOrModelNew instanceof RequiredConfigItemsRequiredConfigOr); + assertEquals(requiredConfigItemsRequiredConfigOrModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java new file mode 100644 index 00000000..fcf12658 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItems; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigItems model. + */ +public class RequiredConfigItemsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testRequiredConfigItems() throws Throwable { + RequiredConfigItems requiredConfigItemsModel = new RequiredConfigItems(); + assertNotNull(requiredConfigItemsModel); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java new file mode 100644 index 00000000..cd92e335 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigRequiredConfigAnd model. + */ +public class RequiredConfigRequiredConfigAndTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigRequiredConfigAnd() throws Throwable { + RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() + .description("testString") + .build(); + assertEquals(requiredConfigItemsModel.description(), "testString"); + + RequiredConfigRequiredConfigAnd requiredConfigRequiredConfigAndModel = new RequiredConfigRequiredConfigAnd.Builder() + .description("testString") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + assertEquals(requiredConfigRequiredConfigAndModel.description(), "testString"); + assertEquals(requiredConfigRequiredConfigAndModel.and(), java.util.Arrays.asList(requiredConfigItemsModel)); + + String json = TestUtilities.serialize(requiredConfigRequiredConfigAndModel); + + RequiredConfigRequiredConfigAnd requiredConfigRequiredConfigAndModelNew = TestUtilities.deserialize(json, RequiredConfigRequiredConfigAnd.class); + assertTrue(requiredConfigRequiredConfigAndModelNew instanceof RequiredConfigRequiredConfigAnd); + assertEquals(requiredConfigRequiredConfigAndModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBaseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBaseTest.java new file mode 100644 index 00000000..88b6587e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigBaseTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigRequiredConfigBase model. + */ +public class RequiredConfigRequiredConfigBaseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigRequiredConfigBase() throws Throwable { + RequiredConfigRequiredConfigBase requiredConfigRequiredConfigBaseModel = new RequiredConfigRequiredConfigBase.Builder() + .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigRequiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigRequiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigRequiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigRequiredConfigBaseModel.value(), "testString"); + + String json = TestUtilities.serialize(requiredConfigRequiredConfigBaseModel); + + RequiredConfigRequiredConfigBase requiredConfigRequiredConfigBaseModelNew = TestUtilities.deserialize(json, RequiredConfigRequiredConfigBase.class); + assertTrue(requiredConfigRequiredConfigBaseModelNew instanceof RequiredConfigRequiredConfigBase); + assertEquals(requiredConfigRequiredConfigBaseModelNew.description(), "testString"); + assertEquals(requiredConfigRequiredConfigBaseModelNew.property(), "testString"); + assertEquals(requiredConfigRequiredConfigBaseModelNew.operator(), "string_equals"); + assertEquals(requiredConfigRequiredConfigBaseModelNew.value(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRequiredConfigRequiredConfigBaseError() throws Throwable { + new RequiredConfigRequiredConfigBase.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java new file mode 100644 index 00000000..24f44889 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigRequiredConfigOr model. + */ +public class RequiredConfigRequiredConfigOrTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigRequiredConfigOr() throws Throwable { + RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() + .description("testString") + .build(); + assertEquals(requiredConfigItemsModel.description(), "testString"); + + RequiredConfigRequiredConfigOr requiredConfigRequiredConfigOrModel = new RequiredConfigRequiredConfigOr.Builder() + .description("testString") + .or(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + assertEquals(requiredConfigRequiredConfigOrModel.description(), "testString"); + assertEquals(requiredConfigRequiredConfigOrModel.or(), java.util.Arrays.asList(requiredConfigItemsModel)); + + String json = TestUtilities.serialize(requiredConfigRequiredConfigOrModel); + + RequiredConfigRequiredConfigOr requiredConfigRequiredConfigOrModelNew = TestUtilities.deserialize(json, RequiredConfigRequiredConfigOr.class); + assertTrue(requiredConfigRequiredConfigOrModelNew instanceof RequiredConfigRequiredConfigOr); + assertEquals(requiredConfigRequiredConfigOrModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java new file mode 100644 index 00000000..60efce86 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfig; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfig model. + */ +public class RequiredConfigTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testRequiredConfig() throws Throwable { + RequiredConfig requiredConfigModel = new RequiredConfig(); + assertNotNull(requiredConfigModel); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePageTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePageTest.java new file mode 100644 index 00000000..48cfbd29 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourcePageTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRef; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourcePage; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ResourcePage model. + */ +public class ResourcePageTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testResourcePage() throws Throwable { + ResourcePage resourcePageModel = new ResourcePage(); + assertNull(resourcePageModel.getTotalCount()); + assertNull(resourcePageModel.getLimit()); + assertNull(resourcePageModel.getStart()); + assertNull(resourcePageModel.getFirst()); + assertNull(resourcePageModel.getNext()); + assertNull(resourcePageModel.getHomeAccountId()); + assertNull(resourcePageModel.getReportId()); + assertNull(resourcePageModel.getResources()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItemTest.java new file mode 100644 index 00000000..a6530337 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryItemTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummaryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ResourceSummaryItem model. + */ +public class ResourceSummaryItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testResourceSummaryItem() throws Throwable { + ResourceSummaryItem resourceSummaryItemModel = new ResourceSummaryItem(); + assertNull(resourceSummaryItemModel.getName()); + assertNull(resourceSummaryItemModel.getId()); + assertNull(resourceSummaryItemModel.getService()); + assertNull(resourceSummaryItemModel.getTags()); + assertNull(resourceSummaryItemModel.getAccount()); + assertNull(resourceSummaryItemModel.getStatus()); + assertNull(resourceSummaryItemModel.getTotalCount()); + assertNull(resourceSummaryItemModel.getPassCount()); + assertNull(resourceSummaryItemModel.getFailureCount()); + assertNull(resourceSummaryItemModel.getErrorCount()); + assertNull(resourceSummaryItemModel.getCompletedCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryTest.java new file mode 100644 index 00000000..d8464449 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceSummaryTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummary; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummaryItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ResourceSummary model. + */ +public class ResourceSummaryTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testResourceSummary() throws Throwable { + ResourceSummary resourceSummaryModel = new ResourceSummary(); + assertNull(resourceSummaryModel.getStatus()); + assertNull(resourceSummaryModel.getTotalCount()); + assertNull(resourceSummaryModel.getCompliantCount()); + assertNull(resourceSummaryModel.getNotCompliantCount()); + assertNull(resourceSummaryModel.getUnableToPerformCount()); + assertNull(resourceSummaryModel.getUserEvaluationRequiredCount()); + assertNull(resourceSummaryModel.getTopFailed()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceTest.java new file mode 100644 index 00000000..81e87bbc --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ResourceTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Account; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Resource model. + */ +public class ResourceTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testResource() throws Throwable { + Resource resourceModel = new Resource(); + assertNull(resourceModel.getReportId()); + assertNull(resourceModel.getId()); + assertNull(resourceModel.getResourceName()); + assertNull(resourceModel.getComponentId()); + assertNull(resourceModel.getEnvironment()); + assertNull(resourceModel.getAccount()); + assertNull(resourceModel.getStatus()); + assertNull(resourceModel.getTotalCount()); + assertNull(resourceModel.getPassCount()); + assertNull(resourceModel.getFailureCount()); + assertNull(resourceModel.getErrorCount()); + assertNull(resourceModel.getCompletedCount()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfoTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfoTest.java new file mode 100644 index 00000000..3a168701 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleInfoTest.java @@ -0,0 +1,46 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RuleInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RuleInfo model. + */ +public class RuleInfoTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRuleInfo() throws Throwable { + RuleInfo ruleInfoModel = new RuleInfo(); + assertNull(ruleInfoModel.getId()); + assertNull(ruleInfoModel.getType()); + assertNull(ruleInfoModel.getDescription()); + assertNull(ruleInfoModel.getVersion()); + assertNull(ruleInfoModel.getAccountId()); + assertNull(ruleInfoModel.getCreatedOn()); + assertNull(ruleInfoModel.getCreatedBy()); + assertNull(ruleInfoModel.getUpdatedOn()); + assertNull(ruleInfoModel.getUpdatedBy()); + assertNull(ruleInfoModel.getLabels()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java new file mode 100644 index 00000000..f2ec5d84 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java @@ -0,0 +1,55 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Rule model. + */ +public class RuleTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRule() throws Throwable { + Rule ruleModel = new Rule(); + assertNull(ruleModel.getCreatedOn()); + assertNull(ruleModel.getCreatedBy()); + assertNull(ruleModel.getUpdatedOn()); + assertNull(ruleModel.getUpdatedBy()); + assertNull(ruleModel.getId()); + assertNull(ruleModel.getAccountId()); + assertNull(ruleModel.getDescription()); + assertNull(ruleModel.getType()); + assertNull(ruleModel.getVersion()); + assertNull(ruleModel.getXImport()); + assertNull(ruleModel.getTarget()); + assertNull(ruleModel.getRequiredConfig()); + assertNull(ruleModel.getLabels()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java new file mode 100644 index 00000000..8732fc1c --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefFirst; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefNext; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RulesPageBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RulesPageBase model. + */ +public class RulesPageBaseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRulesPageBase() throws Throwable { + RulesPageBase rulesPageBaseModel = new RulesPageBase(); + assertNull(rulesPageBaseModel.getLimit()); + assertNull(rulesPageBaseModel.getTotalCount()); + assertNull(rulesPageBaseModel.getFirst()); + assertNull(rulesPageBaseModel.getNext()); + assertNull(rulesPageBaseModel.getRules()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScanTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScanTest.java new file mode 100644 index 00000000..ba047c9e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScanTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Scan; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Scan model. + */ +public class ScanTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testScan() throws Throwable { + Scan scanModel = new Scan(); + assertNull(scanModel.getId()); + assertNull(scanModel.getAccountId()); + assertNull(scanModel.getAttachmentId()); + assertNull(scanModel.getReportId()); + assertNull(scanModel.getStatus()); + assertNull(scanModel.getLastScanTime()); + assertNull(scanModel.getNextScanTime()); + assertNull(scanModel.getScanType()); + assertNull(scanModel.getOccurence()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopePropertyTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopePropertyTest.java new file mode 100644 index 00000000..47df4b32 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ScopePropertyTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ScopeProperty; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ScopeProperty model. + */ +public class ScopePropertyTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testScopeProperty() throws Throwable { + ScopeProperty scopePropertyModel = new ScopeProperty(); + assertNull(scopePropertyModel.getName()); + assertNull(scopePropertyModel.getValue()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java new file mode 100644 index 00000000..7fe184e2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java @@ -0,0 +1,77 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EventNotifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ObjectStorage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Settings; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Settings model. + */ +public class SettingsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSettings() throws Throwable { + EventNotifications eventNotificationsModel = new EventNotifications.Builder() + .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .updatedOn(DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")) + .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") + .sourceName("compliance") + .build(); + assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModel.updatedOn(), DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")); + assertEquals(eventNotificationsModel.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModel.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); + assertEquals(eventNotificationsModel.sourceName(), "compliance"); + + ObjectStorage objectStorageModel = new ObjectStorage.Builder() + .instanceCrn("instance_crn") + .bucket("bucket") + .bucketLocation("bucket_location") + .bucketEndpoint("bucket_endpoint") + .updatedOn(DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")) + .build(); + assertEquals(objectStorageModel.instanceCrn(), "instance_crn"); + assertEquals(objectStorageModel.bucket(), "bucket"); + assertEquals(objectStorageModel.bucketLocation(), "bucket_location"); + assertEquals(objectStorageModel.bucketEndpoint(), "bucket_endpoint"); + assertEquals(objectStorageModel.updatedOn(), DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")); + + Settings settingsModel = new Settings.Builder() + .eventNotifications(eventNotificationsModel) + .objectStorage(objectStorageModel) + .build(); + assertEquals(settingsModel.eventNotifications(), eventNotificationsModel); + assertEquals(settingsModel.objectStorage(), objectStorageModel); + + String json = TestUtilities.serialize(settingsModel); + + Settings settingsModelNew = TestUtilities.deserialize(json, Settings.class); + assertTrue(settingsModelNew instanceof Settings); + assertEquals(settingsModelNew.eventNotifications().toString(), eventNotificationsModel.toString()); + assertEquals(settingsModelNew.objectStorage().toString(), objectStorageModel.toString()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TagsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TagsTest.java new file mode 100644 index 00000000..828c54b7 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TagsTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Tags model. + */ +public class TagsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testTags() throws Throwable { + Tags tagsModel = new Tags(); + assertNull(tagsModel.getUser()); + assertNull(tagsModel.getAccess()); + assertNull(tagsModel.getService()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfoTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfoTest.java new file mode 100644 index 00000000..848c845e --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetInfoTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the TargetInfo model. + */ +public class TargetInfoTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testTargetInfo() throws Throwable { + TargetInfo targetInfoModel = new TargetInfo(); + assertNull(targetInfoModel.getId()); + assertNull(targetInfoModel.getAccountId()); + assertNull(targetInfoModel.getResourceCrn()); + assertNull(targetInfoModel.getResourceName()); + assertNull(targetInfoModel.getServiceName()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java new file mode 100644 index 00000000..e4f584dd --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the Target model. + */ +public class TargetTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testTarget() throws Throwable { + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("name") + .operator("string_equals") + .value("value") + .build(); + assertEquals(additionalTargetAttributeModel.name(), "name"); + assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); + assertEquals(additionalTargetAttributeModel.value(), "value"); + + Target targetModel = new Target.Builder() + .serviceName("testString") + .serviceDisplayName("testString") + .resourceKind("testString") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + assertEquals(targetModel.serviceName(), "testString"); + assertEquals(targetModel.serviceDisplayName(), "testString"); + assertEquals(targetModel.resourceKind(), "testString"); + assertEquals(targetModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); + + String json = TestUtilities.serialize(targetModel); + + Target targetModelNew = TestUtilities.deserialize(json, Target.class); + assertTrue(targetModelNew instanceof Target); + assertEquals(targetModelNew.serviceName(), "testString"); + assertEquals(targetModelNew.serviceDisplayName(), "testString"); + assertEquals(targetModelNew.resourceKind(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testTargetError() throws Throwable { + new Target.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEventTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEventTest.java new file mode 100644 index 00000000..5c5b451d --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TestEventTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the TestEvent model. + */ +public class TestEventTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testTestEvent() throws Throwable { + TestEvent testEventModel = new TestEvent(); + assertNull(testEventModel.isSuccess()); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java new file mode 100644 index 00000000..57481521 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java @@ -0,0 +1,55 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the UpdateProviderTypeInstanceOptions model. + */ +public class UpdateProviderTypeInstanceOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateProviderTypeInstanceOptions() throws Throwable { + UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptionsModel = new UpdateProviderTypeInstanceOptions.Builder() + .providerTypeId("testString") + .providerTypeInstanceId("testString") + .name("workload-protection-instance-1") + .attributes(java.util.Collections.singletonMap("anyKey", "anyValue")) + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + assertEquals(updateProviderTypeInstanceOptionsModel.providerTypeId(), "testString"); + assertEquals(updateProviderTypeInstanceOptionsModel.providerTypeInstanceId(), "testString"); + assertEquals(updateProviderTypeInstanceOptionsModel.name(), "workload-protection-instance-1"); + assertEquals(updateProviderTypeInstanceOptionsModel.attributes(), java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(updateProviderTypeInstanceOptionsModel.xCorrelationId(), "testString"); + assertEquals(updateProviderTypeInstanceOptionsModel.xRequestId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateProviderTypeInstanceOptionsError() throws Throwable { + new UpdateProviderTypeInstanceOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java new file mode 100644 index 00000000..737a867b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java @@ -0,0 +1,74 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.EventNotifications; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ObjectStorage; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the UpdateSettingsOptions model. + */ +public class UpdateSettingsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateSettingsOptions() throws Throwable { + EventNotifications eventNotificationsModel = new EventNotifications.Builder() + .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") + .sourceName("compliance") + .build(); + assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(eventNotificationsModel.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModel.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); + assertEquals(eventNotificationsModel.sourceName(), "compliance"); + + ObjectStorage objectStorageModel = new ObjectStorage.Builder() + .instanceCrn("testString") + .bucket("testString") + .bucketLocation("testString") + .bucketEndpoint("testString") + .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + assertEquals(objectStorageModel.instanceCrn(), "testString"); + assertEquals(objectStorageModel.bucket(), "testString"); + assertEquals(objectStorageModel.bucketLocation(), "testString"); + assertEquals(objectStorageModel.bucketEndpoint(), "testString"); + assertEquals(objectStorageModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + + UpdateSettingsOptions updateSettingsOptionsModel = new UpdateSettingsOptions.Builder() + .eventNotifications(eventNotificationsModel) + .objectStorage(objectStorageModel) + .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xRequestId("testString") + .build(); + assertEquals(updateSettingsOptionsModel.eventNotifications(), eventNotificationsModel); + assertEquals(updateSettingsOptionsModel.objectStorage(), objectStorageModel); + assertEquals(updateSettingsOptionsModel.xCorrelationId(), "1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5"); + assertEquals(updateSettingsOptionsModel.xRequestId(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/utils/TestUtilities.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/utils/TestUtilities.java new file mode 100644 index 00000000..03bd79b2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/utils/TestUtilities.java @@ -0,0 +1,129 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.utils; + +import java.util.Map; +import java.util.Set; +import java.util.List; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.io.InputStream; +import java.io.ByteArrayInputStream; + +import okhttp3.mockwebserver.RecordedRequest; +import okhttp3.HttpUrl; +import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.sdk.core.util.GsonSingleton; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; + +/** + * A class used by the unit tests containing utility functions. + */ +public class TestUtilities { + public static Map createMockMap() { + Map mockMap = new HashMap<>(); + mockMap.put("foo", "bar"); + return mockMap; + } + + public static HashMap createMockStreamMap() { + return new HashMap() { + { put("key1", createMockStream("This is a mock file.")); } + }; + } + + public static Map parseQueryString(RecordedRequest req) { + Map queryMap = new HashMap<>(); + + try { + HttpUrl requestUrl = req.getRequestUrl(); + + if (requestUrl != null) { + Set queryParamsNames = requestUrl.queryParameterNames(); + // map the parameter name to its corresponding value + for (String p : queryParamsNames) { + // get the corresponding value for the parameter (p) + List val = requestUrl.queryParameterValues(p); + if (val != null && !val.isEmpty()) { + String joinedQuery = String.join(",", val); + queryMap.put(p, joinedQuery); + } + } + } + if (queryMap.isEmpty()) { + return null; + } + } catch (Exception e) { + return null; + } + + return queryMap; + } + + public static String parseReqPath(RecordedRequest req) { + String parsedPath = null; + + try { + String fullPath = req.getPath(); + if (fullPath != null && !fullPath.isEmpty()) { + // retrieve the path segment before the query parameter + parsedPath = fullPath.split("\\?", 2)[0]; + } + if (parsedPath.isEmpty() || parsedPath == null) { + return null; + } + + } catch (Exception e) { + return null; + } + + return parsedPath; + } + + public static String serialize(Object obj) { + return GsonSingleton.getGson().toJson(obj); + } + + public static T deserialize(String json, Class clazz) { + return GsonSingleton.getGson().fromJson(json, clazz); + } + + public static InputStream createMockStream(String s) { + return new ByteArrayInputStream(s.getBytes()); + } + + public static List creatMockListFileWithMetadata() { + List list = new ArrayList(); + byte[] fileBytes = {(byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef}; + InputStream inputStream = new ByteArrayInputStream(fileBytes); + FileWithMetadata.Builder builder = new FileWithMetadata.Builder(); + builder.data(inputStream); + FileWithMetadata fileWithMetadata = builder.build(); + list.add(fileWithMetadata); + + return list; + } + + public static byte[] createMockByteArray(String bytes) { + return bytes.getBytes(); + } + + public static Date createMockDate(String date) throws Exception { + return DateUtils.parseAsDate(date); + } + + public static Date createMockDateTime(String date) throws Exception { + return DateUtils.parseAsDateTime(date); + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f5e1b945..c753de26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,41 +1,45 @@ { - "name": "scc-java-sdk", - "lockfileVersion": 2, + "name": "security-and-compliance-center-api", + "lockfileVersion": 3, "requires": true, "packages": { "": { - "dependencies": { - "@semantic-release/changelog": "^6.0.1", + "devDependencies": { + "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^8.0.5" + "@semantic-release/github": "^8.0.7", + "@semantic-release/release-notes-generator": "^10.0.3" } }, "node_modules/@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "dev": true, "dependencies": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -43,10 +47,22 @@ "node": ">=6.9.0" } }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -59,14 +75,16 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", - "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -76,26 +94,28 @@ } }, "node_modules/@octokit/auth-token": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.0.tgz", - "integrity": "sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.3.tgz", + "integrity": "sha512-/aFM2M4HVDBT/jjDBa84sJniv1t9Gm/rLkalaz9htOm+L+8JMj1k9w0CkUdcxNyNxZPlTxKPVko+m1VlM58ZVA==", + "dev": true, "dependencies": { - "@octokit/types": "^6.0.3" + "@octokit/types": "^9.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/core": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.4.tgz", - "integrity": "sha512-sUpR/hc4Gc7K34o60bWC7WUH6Q7T6ftZ2dUmepSyJr9PRF76/qqkWjE2SOEzCqLA5W83SaISymwKtxks+96hPQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.0.tgz", + "integrity": "sha512-AgvDRUg3COpR82P7PBdGZF/NNqGmtMq2NiPqeSsDIeCfYFOZ9gddqWNQHnFdEUf+YwOj4aZYmJnlPp7OXmDIDg==", + "dev": true, "dependencies": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", "@octokit/request": "^6.0.0", "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" }, @@ -104,11 +124,12 @@ } }, "node_modules/@octokit/endpoint": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.0.tgz", - "integrity": "sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.5.tgz", + "integrity": "sha512-LG4o4HMY1Xoaec87IqQ41TQ+glvIeTKqfjkCEmt5AIwDZJwQeVZFIEYXrYY6yLwK+pAScb9Gj4q+Nz2qSw1roA==", + "dev": true, "dependencies": { - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" }, @@ -117,12 +138,13 @@ } }, "node_modules/@octokit/graphql": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.0.tgz", - "integrity": "sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.5.tgz", + "integrity": "sha512-Qwfvh3xdqKtIznjX9lz2D458r7dJPP8l6r4GQkIdWQouZwHQK0mVT88uwiU2bdTU2OtT1uOlKpRciUWldpG0yQ==", + "dev": true, "dependencies": { "@octokit/request": "^6.0.0", - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "universal-user-agent": "^6.0.0" }, "engines": { @@ -130,16 +152,18 @@ } }, "node_modules/@octokit/openapi-types": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", - "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-16.0.0.tgz", + "integrity": "sha512-JbFWOqTJVLHZSUUoF4FzAZKYtqdxWu9Z5m2QQnOyEa04fOFljvyh7D3GYKbfuaSWisqehImiVIMG4eyJeP5VEA==", + "dev": true }, "node_modules/@octokit/plugin-paginate-rest": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.1.0.tgz", - "integrity": "sha512-+cfc40pMzWcLkoDcLb1KXqjX0jTGYXjKuQdFQDc6UAknISJHnZTiBqld6HDwRJvD4DsouDKrWXNbNV0lE/3AXA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.0.0.tgz", + "integrity": "sha512-Sq5VU1PfT6/JyuXPyt04KZNVsFOSBaYOAq2QRZUwzVlI10KFvcbUo8lR258AAQL1Et60b0WuVik+zOWKLuDZxw==", + "dev": true, "dependencies": { - "@octokit/types": "^6.41.0" + "@octokit/types": "^9.0.0" }, "engines": { "node": ">= 14" @@ -152,16 +176,18 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "dev": true, "peerDependencies": { "@octokit/core": ">=3" } }, "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.2.0.tgz", - "integrity": "sha512-PZ+yfkbZAuRUtqu6Y191/V3eM0KBPx+Yq7nh+ONPdpm3EX4pd5UnK2y2XgO/0AtNum5a4aJCDjqsDuUZ2hWRXw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.0.1.tgz", + "integrity": "sha512-pnCaLwZBudK5xCdrR823xHGNgqOzRnJ/mpC/76YPpNP7DybdsJtP7mdOwh+wYZxK5jqeQuhu59ogMI4NRlBUvA==", + "dev": true, "dependencies": { - "@octokit/types": "^6.41.0", + "@octokit/types": "^9.0.0", "deprecation": "^2.3.1" }, "engines": { @@ -172,13 +198,14 @@ } }, "node_modules/@octokit/request": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.0.tgz", - "integrity": "sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.3.tgz", + "integrity": "sha512-TNAodj5yNzrrZ/VxP+H5HiYaZep0H3GU0O7PaF+fhDrt8FPrnkei9Aal/txsN/1P7V3CPiThG0tIvpPDYUsyAA==", + "dev": true, "dependencies": { "@octokit/endpoint": "^7.0.0", "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.16.1", + "@octokit/types": "^9.0.0", "is-plain-object": "^5.0.0", "node-fetch": "^2.6.7", "universal-user-agent": "^6.0.0" @@ -188,11 +215,12 @@ } }, "node_modules/@octokit/request-error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.0.tgz", - "integrity": "sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.3.tgz", + "integrity": "sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ==", + "dev": true, "dependencies": { - "@octokit/types": "^6.0.3", + "@octokit/types": "^9.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" }, @@ -201,35 +229,76 @@ } }, "node_modules/@octokit/rest": { - "version": "19.0.3", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.3.tgz", - "integrity": "sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ==", + "version": "19.0.7", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.7.tgz", + "integrity": "sha512-HRtSfjrWmWVNp2uAkEpQnuGMJsu/+dBr47dRc5QVgsCbnIc1+GFEaoKBWkYG+zjrsHpSqcAElMio+n10c0b5JA==", + "dev": true, "dependencies": { - "@octokit/core": "^4.0.0", - "@octokit/plugin-paginate-rest": "^3.0.0", + "@octokit/core": "^4.1.0", + "@octokit/plugin-paginate-rest": "^6.0.0", "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-rest-endpoint-methods": "^6.0.0" + "@octokit/plugin-rest-endpoint-methods": "^7.0.0" }, "engines": { "node": ">= 14" } }, "node_modules/@octokit/types": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", - "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.0.0.tgz", + "integrity": "sha512-LUewfj94xCMH2rbD5YJ+6AQ4AVjFYTgpp6rboWM5T7N3IsIF65SBEOVcYMGAEzO/kKNiNaW4LoWtoThOhH06gw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^16.0.0" + } + }, + "node_modules/@pnpm/config.env-replace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.0.0.tgz", + "integrity": "sha512-ZVPVDi1E8oeXlYqkGRtX0CkzLTwE2zt62bjWaWKaAvI8NZqHzlMvGeSNDpW+JB3+aKanYb4UETJOF1/CxGPemA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "4.2.10" + }, + "engines": { + "node": ">=12.22.0" + } + }, + "node_modules/@pnpm/npm-conf": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.1.0.tgz", + "integrity": "sha512-Oe6ntvgsMTE3hDIqy6sajqHF+MnzJrOF06qC2QSiUEybLL7cp6tjoKUa32gpd9+KPVl4QyMs3E3nsXrx/Vdnlw==", + "dev": true, + "peer": true, "dependencies": { - "@octokit/openapi-types": "^12.11.0" + "@pnpm/config.env-replace": "^1.0.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" + }, + "engines": { + "node": ">=12" } }, "node_modules/@semantic-release/changelog": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.1.tgz", - "integrity": "sha512-FT+tAGdWHr0RCM3EpWegWnvXJ05LQtBkQUaQRIExONoXjVjLuOILNm4DEKNaV+GAQyJjbLRVs57ti//GypH6PA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", + "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", + "dev": true, "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", - "fs-extra": "^9.0.0", + "fs-extra": "^11.0.0", "lodash": "^4.17.4" }, "engines": { @@ -239,23 +308,16 @@ "semantic-release": ">=18.0.0" } }, - "node_modules/@semantic-release/changelog/node_modules/@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", - "engines": { - "node": ">=14.17" - } - }, "node_modules/@semantic-release/commit-analyzer": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.1.tgz", - "integrity": "sha512-ncNsnrLmiykhgNZUXNvhhAjNN0me7VGIb0X5hu3ogyi5DDPapjGAHdEffO5vi+HX1BFWLRD/Ximx5PjGAKjAqQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.2.tgz", + "integrity": "sha512-E+dr6L+xIHZkX4zNMe6Rnwg4YQrWNXK+rNsvwOPpdFppvZO1olE2fIgWhv89TkQErygevbjsZFSIxp+u6w2e5g==", + "dev": true, "peer": true, "dependencies": { "conventional-changelog-angular": "^5.0.0", "conventional-commits-filter": "^2.0.0", - "conventional-commits-parser": "^3.0.7", + "conventional-commits-parser": "^3.2.3", "debug": "^4.0.0", "import-from": "^4.0.0", "lodash": "^4.17.4", @@ -269,14 +331,19 @@ } }, "node_modules/@semantic-release/error": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-2.2.0.tgz", - "integrity": "sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", + "dev": true, + "engines": { + "node": ">=14.17" + } }, "node_modules/@semantic-release/exec": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@semantic-release/exec/-/exec-6.0.3.tgz", "integrity": "sha512-bxAq8vLOw76aV89vxxICecEa8jfaWwYITw6X74zzlO0mc/Bgieqx9kBRz9z96pHectiTAtsCwsQcUyLYWnp3VQ==", + "dev": true, "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", @@ -292,59 +359,11 @@ "semantic-release": ">=18.0.0" } }, - "node_modules/@semantic-release/exec/node_modules/@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", - "engines": { - "node": ">=14.17" - } - }, - "node_modules/@semantic-release/exec/node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/@semantic-release/exec/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/exec/node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "engines": { - "node": ">=10.17.0" - } - }, "node_modules/@semantic-release/git": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", + "dev": true, "dependencies": { "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", @@ -362,67 +381,19 @@ "semantic-release": ">=18.0.0" } }, - "node_modules/@semantic-release/git/node_modules/@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", - "engines": { - "node": ">=14.17" - } - }, - "node_modules/@semantic-release/git/node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/@semantic-release/git/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/git/node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "engines": { - "node": ">=10.17.0" - } - }, "node_modules/@semantic-release/github": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.5.tgz", - "integrity": "sha512-9pGxRM3gv1hgoZ/muyd4pWnykdIUVfCiev6MXE9lOyGQof4FQy95GFE26nDcifs9ZG7bBzV8ue87bo/y1zVf0g==", + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.7.tgz", + "integrity": "sha512-VtgicRIKGvmTHwm//iqTh/5NGQwsncOMR5vQK9pMT92Aem7dv37JFKKRuulUsAnUOIlO4G8wH3gPiBAA0iW0ww==", + "dev": true, "dependencies": { "@octokit/rest": "^19.0.0", - "@semantic-release/error": "^2.2.0", + "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", "bottleneck": "^2.18.1", "debug": "^4.0.0", "dir-glob": "^3.0.0", - "fs-extra": "^10.0.0", + "fs-extra": "^11.0.0", "globby": "^11.0.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", @@ -440,114 +411,44 @@ "semantic-release": ">=18.0.0-beta.1" } }, - "node_modules/@semantic-release/github/node_modules/fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@semantic-release/npm": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-8.0.0.tgz", - "integrity": "sha512-MAlynjIaN5XwBEzsq3xbZ8I+riD9zhLvpPqGCPaZ0j/ySbR0Sg3YG1MYv03fC1aygPFFC5RwefMxKids9llvDg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-9.0.2.tgz", + "integrity": "sha512-zgsynF6McdzxPnFet+a4iO9HpAlARXOM5adz7VGVCvj0ne8wtL2ZOQoDV2wZPDmdEotDIbVeJjafhelZjs9j6g==", + "dev": true, "peer": true, "dependencies": { - "@semantic-release/error": "^2.2.0", + "@semantic-release/error": "^3.0.0", "aggregate-error": "^3.0.0", "execa": "^5.0.0", - "fs-extra": "^10.0.0", + "fs-extra": "^11.0.0", "lodash": "^4.17.15", "nerf-dart": "^1.0.0", "normalize-url": "^6.0.0", - "npm": "^7.0.0", + "npm": "^8.3.0", "rc": "^1.2.8", "read-pkg": "^5.0.0", - "registry-auth-token": "^4.0.0", + "registry-auth-token": "^5.0.0", "semver": "^7.1.2", "tempy": "^1.0.0" }, "engines": { - "node": ">=14.17" + "node": ">=16 || ^14.17" }, "peerDependencies": { - "semantic-release": ">=18.0.0-beta.1" - } - }, - "node_modules/@semantic-release/npm/node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "peer": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/@semantic-release/npm/node_modules/fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", - "peer": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@semantic-release/npm/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "peer": true, - "engines": { - "node": ">=10.17.0" + "semantic-release": ">=19.0.0" } }, "node_modules/@semantic-release/release-notes-generator": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-10.0.2.tgz", - "integrity": "sha512-I4eavIcDan8fNQHskZ2cbWkFMimvgxNkqR2UfuYNwYBgswEl3SJsN8XMf9gZWObt6nXDc2QfDwhjy8DjTZqS3w==", - "peer": true, + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-10.0.3.tgz", + "integrity": "sha512-k4x4VhIKneOWoBGHkx0qZogNjCldLPRiAjnIpMnlUh6PtaWXp/T+C9U7/TaNDDtgDa5HMbHl4WlREdxHio6/3w==", + "dev": true, "dependencies": { "conventional-changelog-angular": "^5.0.0", "conventional-changelog-writer": "^5.0.0", "conventional-commits-filter": "^2.0.0", - "conventional-commits-parser": "^3.0.0", + "conventional-commits-parser": "^3.2.3", "debug": "^4.0.0", "get-stream": "^6.0.0", "import-from": "^4.0.0", @@ -562,53 +463,125 @@ "semantic-release": ">=18.0.0-beta.1" } }, - "node_modules/@semantic-release/release-notes-generator/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "peer": true, + "node_modules/@semantic-release/release-notes-generator/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, "engines": { - "node": ">=10" + "node": ">=8" + } + }, + "node_modules/@semantic-release/release-notes-generator/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=8" } }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "node_modules/@semantic-release/release-notes-generator/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, "engines": { - "node": ">= 10" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "peer": true + "node_modules/@semantic-release/release-notes-generator/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@semantic-release/release-notes-generator/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@semantic-release/release-notes-generator/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@semantic-release/release-notes-generator/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "peer": true - }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "peer": true + "dev": true }, "node_modules/@types/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" + "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", + "dev": true }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, "dependencies": { "debug": "4" }, @@ -620,6 +593,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -629,15 +603,16 @@ } }, "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "dev": true, "peer": true, "dependencies": { - "type-fest": "^0.21.3" + "type-fest": "^1.0.2" }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -647,6 +622,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "peer": true, "engines": { "node": ">=8" @@ -656,6 +632,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -666,25 +643,35 @@ "node_modules/ansicolors": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", - "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", + "integrity": "sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==", + "dev": true, + "peer": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, "peer": true }, "node_modules/argv-formatter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", - "integrity": "sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk=", + "integrity": "sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==", + "dev": true, "peer": true }, "node_modules/array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", - "peer": true + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, "engines": { "node": ">=8" } @@ -692,40 +679,36 @@ "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "peer": true, + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, "peer": true }, "node_modules/before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true }, "node_modules/bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", - "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "dev": true }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "peer": true, "dependencies": { "balanced-match": "^1.0.0", @@ -736,6 +719,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -747,6 +731,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "peer": true, "engines": { "node": ">=6" @@ -756,7 +741,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "peer": true, + "dev": true, "engines": { "node": ">=6" } @@ -765,7 +750,7 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "peer": true, + "dev": true, "dependencies": { "camelcase": "^5.3.1", "map-obj": "^4.0.0", @@ -781,7 +766,8 @@ "node_modules/cardinal": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz", - "integrity": "sha1-fMEFXYItISlU0HsIXeolHMe8VQU=", + "integrity": "sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==", + "dev": true, "peer": true, "dependencies": { "ansicolors": "~0.3.2", @@ -795,6 +781,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -808,41 +795,47 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, "engines": { "node": ">=6" } }, "node_modules/cli-table3": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz", - "integrity": "sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "dev": true, "peer": true, "dependencies": { - "object-assign": "^4.1.0", "string-width": "^4.2.0" }, "engines": { "node": "10.* || >= 12.*" }, "optionalDependencies": { - "colors": "^1.1.2" + "@colors/colors": "1.5.0" } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, "peer": true, "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -850,23 +843,14 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "optional": true, - "peer": true, - "engines": { - "node": ">=0.1.90" - } + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", - "peer": true, + "dev": true, "dependencies": { "array-ify": "^1.0.0", "dot-prop": "^5.1.0" @@ -875,14 +859,26 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, "peer": true }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "peer": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, "node_modules/conventional-changelog-angular": { "version": "5.0.13", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", - "peer": true, + "dev": true, "dependencies": { "compare-func": "^2.0.0", "q": "^1.5.1" @@ -892,14 +888,14 @@ } }, "node_modules/conventional-changelog-writer": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.0.tgz", - "integrity": "sha512-HnDh9QHLNWfL6E1uHz6krZEQOgm8hN7z/m7tT16xwd802fwgMN0Wqd7AQYVkhpsjDUx/99oo+nGgvKF657XP5g==", - "peer": true, + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz", + "integrity": "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==", + "dev": true, "dependencies": { "conventional-commits-filter": "^2.0.7", "dateformat": "^3.0.0", - "handlebars": "^4.7.6", + "handlebars": "^4.7.7", "json-stringify-safe": "^5.0.1", "lodash": "^4.17.15", "meow": "^8.0.0", @@ -918,7 +914,7 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "peer": true, + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -927,7 +923,7 @@ "version": "2.0.7", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", - "peer": true, + "dev": true, "dependencies": { "lodash.ismatch": "^4.4.0", "modify-values": "^1.0.0" @@ -937,10 +933,10 @@ } }, "node_modules/conventional-commits-parser": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz", - "integrity": "sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g==", - "peer": true, + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", + "dev": true, "dependencies": { "is-text-path": "^1.0.1", "JSONStream": "^1.0.4", @@ -960,28 +956,32 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "peer": true + "dev": true }, "node_modules/cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.0.tgz", + "integrity": "sha512-0tLZ9URlPGU7JsKq0DQOQ3FoRsYX8xDZ7xMiATQfaiGMz7EHowNkbU9u1coAOmnh9p/1ySpm0RB3JNWRXM5GCg==", + "dev": true, "peer": true, "dependencies": { - "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "path-type": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" } }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -995,6 +995,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, "peer": true, "engines": { "node": ">=8" @@ -1004,15 +1005,16 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "peer": true, + "dev": true, "engines": { "node": "*" } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -1028,30 +1030,33 @@ "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "peer": true, + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "peer": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, "dependencies": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" }, "engines": { "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/decamelize-keys/node_modules/map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "peer": true, + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1060,15 +1065,17 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, "peer": true, "engines": { "node": ">=4.0.0" } }, "node_modules/del": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", - "integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-6.1.1.tgz", + "integrity": "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==", + "dev": true, "peer": true, "dependencies": { "globby": "^11.0.1", @@ -1091,6 +1098,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, "peer": true, "dependencies": { "aggregate-error": "^3.0.0" @@ -1105,12 +1113,14 @@ "node_modules/deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -1122,7 +1132,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "peer": true, + "dev": true, "dependencies": { "is-obj": "^2.0.0" }, @@ -1133,7 +1143,8 @@ "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "dev": true, "peer": true, "dependencies": { "readable-stream": "^2.0.2" @@ -1143,34 +1154,146 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, "peer": true }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "node_modules/env-ci": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-8.0.0.tgz", + "integrity": "sha512-W+3BqGZozFua9MPeXpmTm5eYEBtGgL76jGu/pwMVp/L8PdECSCEWaIp7d4Mw7kuUrbUldK0oV0bNd6ZZjLiMiA==", + "dev": true, "peer": true, "dependencies": { - "once": "^1.4.0" + "execa": "^6.1.0", + "java-properties": "^1.0.2" + }, + "engines": { + "node": "^16.10 || >=18" } }, - "node_modules/env-ci": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-5.0.2.tgz", - "integrity": "sha512-Xc41mKvjouTXD3Oy9AqySz1IeyvJvHZ20Twf5ZLYbNpPPIuCnL/qHCmNlD01LoNy0JTunw9HPYVptD19Ac7Mbw==", + "node_modules/env-ci/node_modules/execa": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", + "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "dev": true, "peer": true, "dependencies": { - "execa": "^4.0.0", - "java-properties": "^1.0.0" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^3.0.1", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=10.13" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/env-ci/node_modules/human-signals": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", + "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/env-ci/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "peer": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/env-ci/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -1179,6 +1302,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, "peer": true, "engines": { "node": ">=6" @@ -1187,7 +1311,8 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, "engines": { "node": ">=0.8.0" } @@ -1196,6 +1321,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, "peer": true, "bin": { "esparse": "bin/esparse.js", @@ -1206,19 +1332,19 @@ } }, "node_modules/execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "peer": true, + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" }, "engines": { @@ -1229,9 +1355,10 @@ } }, "node_modules/fast-glob": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz", - "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1240,27 +1367,43 @@ "micromatch": "^4.0.4" }, "engines": { - "node": ">=8" + "node": ">=8.6.0" } }, "node_modules/fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, "dependencies": { "reusify": "^1.0.4" } }, "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "dev": true, "peer": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" }, "engines": { - "node": ">=8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1270,6 +1413,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1278,28 +1422,33 @@ } }, "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, "peer": true, "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-5.1.0.tgz", + "integrity": "sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==", + "dev": true, "peer": true, "dependencies": { - "semver-regex": "^3.1.2" + "semver-regex": "^4.0.5" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1308,58 +1457,57 @@ "node_modules/from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "peer": true, + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" } }, "node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", + "dev": true, "dependencies": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=14.14" } }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, "peer": true }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "peer": true + "dev": true }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, "peer": true, "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "peer": true, - "dependencies": { - "pump": "^3.0.0" - }, + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1368,7 +1516,8 @@ "node_modules/git-log-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", - "integrity": "sha1-LmpMGxP8AAKCB7p5WnrDFme5/Uo=", + "integrity": "sha512-rnCVNfkTL8tdNryFuaY0fYiBWEBcgF748O6ZI61rslBvr2o7U65c2/6npCRqH40vuAhtgtDiqLTJjBVdrejCzA==", + "dev": true, "peer": true, "dependencies": { "argv-formatter": "~1.0.0", @@ -1382,7 +1531,8 @@ "node_modules/git-log-parser/node_modules/split2": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", - "integrity": "sha1-UuLiIdiMdfmnP5BVbiY/+WdysxQ=", + "integrity": "sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==", + "dev": true, "peer": true, "dependencies": { "through2": "~2.0.0" @@ -1392,6 +1542,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, "peer": true, "dependencies": { "readable-stream": "~2.3.6", @@ -1399,15 +1550,16 @@ } }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -1422,6 +1574,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -1430,15 +1583,16 @@ } }, "node_modules/globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" }, "engines": { @@ -1449,15 +1603,16 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, "node_modules/handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", - "peer": true, + "dev": true, "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.0", @@ -1478,7 +1633,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "peer": true, + "dev": true, "engines": { "node": ">=6" } @@ -1487,7 +1642,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "peer": true, + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -1498,36 +1653,43 @@ "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, "engines": { "node": ">=4" } }, "node_modules/hook-std": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", - "integrity": "sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-3.0.0.tgz", + "integrity": "sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==", + "dev": true, "peer": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hosted-git-info": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", - "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "dev": true, "peer": true, "dependencies": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=10" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/http-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, "dependencies": { "@tootallnate/once": "2", "agent-base": "6", @@ -1538,9 +1700,10 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -1550,18 +1713,19 @@ } }, "node_modules/human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "peer": true, + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, "engines": { - "node": ">=8.12.0" + "node": ">=10.17.0" } }, "node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, "engines": { "node": ">= 4" } @@ -1570,6 +1734,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, "peer": true, "dependencies": { "parent-module": "^1.0.0", @@ -1586,6 +1751,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, "peer": true, "engines": { "node": ">=4" @@ -1595,7 +1761,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz", "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==", - "peer": true, + "dev": true, "engines": { "node": ">=12.2" }, @@ -1607,6 +1773,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, "engines": { "node": ">=8" } @@ -1614,7 +1781,8 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "peer": true, "dependencies": { "once": "^1.3.0", @@ -1625,19 +1793,20 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "peer": true + "dev": true }, "node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, "peer": true }, "node_modules/into-stream": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", - "peer": true, + "dev": true, "dependencies": { "from2": "^2.3.0", "p-is-promise": "^3.0.0" @@ -1652,13 +1821,14 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true }, "node_modules/is-core-module": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.7.0.tgz", - "integrity": "sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ==", - "peer": true, + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -1669,7 +1839,8 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1678,15 +1849,17 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "peer": true, "engines": { "node": ">=8" } }, "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1698,6 +1871,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -1706,7 +1880,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "peer": true, + "dev": true, "engines": { "node": ">=8" } @@ -1715,6 +1889,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true, "peer": true, "engines": { "node": ">=6" @@ -1724,6 +1899,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, "peer": true, "engines": { "node": ">=8" @@ -1732,8 +1908,8 @@ "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "peer": true, + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1742,23 +1918,28 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-text-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", - "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", - "peer": true, + "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", + "dev": true, "dependencies": { "text-extensions": "^1.0.0" }, @@ -1766,21 +1947,36 @@ "node": ">=0.10.0" } }, + "node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "peer": true + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/issue-parser": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", + "dev": true, "dependencies": { "lodash.capitalize": "^4.2.1", "lodash.escaperegexp": "^4.1.2", @@ -1796,6 +1992,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", + "dev": true, "peer": true, "engines": { "node": ">= 0.6.0" @@ -1804,29 +2001,46 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true, "peer": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "peer": true + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, "dependencies": { "universalify": "^2.0.0" }, @@ -1837,17 +2051,17 @@ "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, "engines": [ "node >= 0.2.0" - ], - "peer": true + ] }, "node_modules/JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "peer": true, + "dev": true, "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -1863,20 +2077,22 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "peer": true, + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true }, "node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, "peer": true, "dependencies": { "graceful-fs": "^4.1.2", @@ -1891,7 +2107,8 @@ "node_modules/load-json-file/node_modules/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, "peer": true, "dependencies": { "error-ex": "^1.3.1", @@ -1902,70 +2119,85 @@ } }, "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, "peer": true, "dependencies": { - "p-locate": "^4.1.0" + "p-locate": "^6.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true, + "peer": true }, "node_modules/lodash.capitalize": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", - "integrity": "sha1-+CbJtOKoUR2E46yinbBeGk87cqk=" + "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", + "dev": true }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "dev": true }, "node_modules/lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", - "peer": true + "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", + "dev": true }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dev": true }, "node_modules/lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", - "integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=" + "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", + "dev": true }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, "peer": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/map-obj": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", - "peer": true, + "dev": true, "engines": { "node": ">=8" }, @@ -1974,134 +2206,169 @@ } }, "node_modules/marked": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", + "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", + "dev": true, "peer": true, "bin": { - "marked": "bin/marked" + "marked": "bin/marked.js" }, "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/marked-terminal": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-4.2.0.tgz", - "integrity": "sha512-DQfNRV9svZf0Dm9Cf5x5xaVJ1+XjxQW6XjFJ5HFkVyK52SDpj5PCBzS5X5r2w9nHr3mlB0T5201UMLue9fmhUw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-5.1.1.tgz", + "integrity": "sha512-+cKTOx9P4l7HwINYhzbrBSyzgxO2HaHKGZGuB1orZsMIgXYaJyfidT81VXRdpelW/PcHEWxywscePVgI/oUF6g==", + "dev": true, "peer": true, "dependencies": { - "ansi-escapes": "^4.3.1", + "ansi-escapes": "^5.0.0", "cardinal": "^2.1.1", - "chalk": "^4.1.0", - "cli-table3": "^0.6.0", - "node-emoji": "^1.10.0", - "supports-hyperlinks": "^2.1.0" + "chalk": "^5.0.0", + "cli-table3": "^0.6.1", + "node-emoji": "^1.11.0", + "supports-hyperlinks": "^2.2.0" + }, + "engines": { + "node": ">=14.13.1 || >=16.0.0" }, "peerDependencies": { - "marked": "^1.0.0 || ^2.0.0" + "marked": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" } }, - "node_modules/marked-terminal/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/marked-terminal/node_modules/chalk": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", + "dev": true, "peer": true, - "dependencies": { - "color-convert": "^2.0.1" - }, "engines": { - "node": ">=8" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/marked-terminal/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "peer": true, + "node_modules/meow": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", + "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", + "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/marked-terminal/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "peer": true, + "node_modules/meow/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "dependencies": { - "color-name": "~1.1.4" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=8" } }, - "node_modules/marked-terminal/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "peer": true - }, - "node_modules/marked-terminal/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "peer": true, + "node_modules/meow/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, "engines": { "node": ">=8" } }, - "node_modules/marked-terminal/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "peer": true, + "node_modules/meow/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, - "node_modules/meow": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", - "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", - "peer": true, + "node_modules/meow/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/meow/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, "dependencies": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^3.0.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.18.0", - "yargs-parser": "^20.2.3" + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" }, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/meow/node_modules/type-fest": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", - "peer": true, + "dev": true, "engines": { "node": ">=10" }, @@ -2112,23 +2379,26 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "engines": { "node": ">= 8" } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -2138,6 +2408,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true, "bin": { "mime": "cli.js" }, @@ -2149,6 +2420,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, "engines": { "node": ">=6" } @@ -2157,15 +2429,16 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "peer": true, + "dev": true, "engines": { "node": ">=4" } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "peer": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -2175,16 +2448,19 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "peer": true + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/minimist-options": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "peer": true, + "dev": true, "dependencies": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", @@ -2198,7 +2474,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", - "peer": true, + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2206,33 +2482,37 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "peer": true + "dev": true }, "node_modules/nerf-dart": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", - "integrity": "sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo=", + "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", + "dev": true, "peer": true }, "node_modules/node-emoji": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "dev": true, "peer": true, "dependencies": { "lodash": "^4.17.21" } }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", + "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", + "dev": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -2252,7 +2532,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "peer": true, + "dev": true, "dependencies": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", @@ -2263,10 +2543,35 @@ "node": ">=10" } }, + "node_modules/normalize-package-data/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-package-data/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/normalize-url": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "dev": true, "peer": true, "engines": { "node": ">=10" @@ -2276,20 +2581,19 @@ } }, "node_modules/npm": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/npm/-/npm-7.24.2.tgz", - "integrity": "sha512-120p116CE8VMMZ+hk8IAb1inCPk4Dj3VZw29/n2g6UI77urJKVYb7FZUDW8hY+EBnfsjI/2yrobBgFyzo7YpVQ==", + "version": "8.19.4", + "resolved": "https://registry.npmjs.org/npm/-/npm-8.19.4.tgz", + "integrity": "sha512-3HANl8i9DKnUA89P4KEgVNN28EjSeDCmvEqbzOAuxCFDzdBZzjUl99zgnGpOUumvW5lvJo2HKcjrsc+tfyv1Hw==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", "@npmcli/ci-detect", "@npmcli/config", + "@npmcli/fs", "@npmcli/map-workspaces", "@npmcli/package-json", "@npmcli/run-script", "abbrev", - "ansicolors", - "ansistyles", "archy", "cacache", "chalk", @@ -2298,6 +2602,7 @@ "cli-table3", "columnify", "fastest-levenshtein", + "fs-minipass", "glob", "graceful-fs", "hosted-git-info", @@ -2317,6 +2622,7 @@ "libnpmteam", "libnpmversion", "make-fetch-happen", + "minimatch", "minipass", "minipass-pipeline", "mkdirp", @@ -2333,8 +2639,10 @@ "npm-user-validate", "npmlog", "opener", + "p-map", "pacote", "parse-conflict-json", + "proc-log", "qrcode-terminal", "read", "read-package-json", @@ -2351,91 +2659,96 @@ "which", "write-file-atomic" ], - "peer": true, - "dependencies": { - "@isaacs/string-locale-compare": "*", - "@npmcli/arborist": "*", - "@npmcli/ci-detect": "*", - "@npmcli/config": "*", - "@npmcli/map-workspaces": "*", - "@npmcli/package-json": "*", - "@npmcli/run-script": "*", - "abbrev": "*", - "ansicolors": "*", - "ansistyles": "*", - "archy": "*", - "cacache": "*", - "chalk": "*", - "chownr": "*", - "cli-columns": "*", - "cli-table3": "*", - "columnify": "*", - "fastest-levenshtein": "*", - "glob": "*", - "graceful-fs": "*", - "hosted-git-info": "*", - "ini": "*", - "init-package-json": "*", - "is-cidr": "*", - "json-parse-even-better-errors": "*", - "libnpmaccess": "*", - "libnpmdiff": "*", - "libnpmexec": "*", - "libnpmfund": "*", - "libnpmhook": "*", - "libnpmorg": "*", - "libnpmpack": "*", - "libnpmpublish": "*", - "libnpmsearch": "*", - "libnpmteam": "*", - "libnpmversion": "*", - "make-fetch-happen": "*", - "minipass": "*", - "minipass-pipeline": "*", - "mkdirp": "*", - "mkdirp-infer-owner": "*", - "ms": "*", - "node-gyp": "*", - "nopt": "*", - "npm-audit-report": "*", - "npm-install-checks": "*", - "npm-package-arg": "*", - "npm-pick-manifest": "*", - "npm-profile": "*", - "npm-registry-fetch": "*", - "npm-user-validate": "*", - "npmlog": "*", - "opener": "*", - "pacote": "*", - "parse-conflict-json": "*", - "qrcode-terminal": "*", - "read": "*", - "read-package-json": "*", - "read-package-json-fast": "*", - "readdir-scoped-modules": "*", - "rimraf": "*", - "semver": "*", - "ssri": "*", - "tar": "*", - "text-table": "*", - "tiny-relative-date": "*", - "treeverse": "*", - "validate-npm-package-name": "*", - "which": "*", - "write-file-atomic": "*" + "dev": true, + "peer": true, + "dependencies": { + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/arborist": "^5.6.3", + "@npmcli/ci-detect": "^2.0.0", + "@npmcli/config": "^4.2.1", + "@npmcli/fs": "^2.1.0", + "@npmcli/map-workspaces": "^2.0.3", + "@npmcli/package-json": "^2.0.0", + "@npmcli/run-script": "^4.2.1", + "abbrev": "~1.1.1", + "archy": "~1.0.0", + "cacache": "^16.1.3", + "chalk": "^4.1.2", + "chownr": "^2.0.0", + "cli-columns": "^4.0.0", + "cli-table3": "^0.6.2", + "columnify": "^1.6.0", + "fastest-levenshtein": "^1.0.12", + "fs-minipass": "^2.1.0", + "glob": "^8.0.1", + "graceful-fs": "^4.2.10", + "hosted-git-info": "^5.2.1", + "ini": "^3.0.1", + "init-package-json": "^3.0.2", + "is-cidr": "^4.0.2", + "json-parse-even-better-errors": "^2.3.1", + "libnpmaccess": "^6.0.4", + "libnpmdiff": "^4.0.5", + "libnpmexec": "^4.0.14", + "libnpmfund": "^3.0.5", + "libnpmhook": "^8.0.4", + "libnpmorg": "^4.0.4", + "libnpmpack": "^4.1.3", + "libnpmpublish": "^6.0.5", + "libnpmsearch": "^5.0.4", + "libnpmteam": "^4.0.4", + "libnpmversion": "^3.0.7", + "make-fetch-happen": "^10.2.0", + "minimatch": "^5.1.0", + "minipass": "^3.1.6", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", + "mkdirp-infer-owner": "^2.0.0", + "ms": "^2.1.2", + "node-gyp": "^9.1.0", + "nopt": "^6.0.0", + "npm-audit-report": "^3.0.0", + "npm-install-checks": "^5.0.0", + "npm-package-arg": "^9.1.0", + "npm-pick-manifest": "^7.0.2", + "npm-profile": "^6.2.0", + "npm-registry-fetch": "^13.3.1", + "npm-user-validate": "^1.0.1", + "npmlog": "^6.0.2", + "opener": "^1.5.2", + "p-map": "^4.0.0", + "pacote": "^13.6.2", + "parse-conflict-json": "^2.0.2", + "proc-log": "^2.0.1", + "qrcode-terminal": "^0.12.0", + "read": "~1.0.7", + "read-package-json": "^5.0.2", + "read-package-json-fast": "^2.0.3", + "readdir-scoped-modules": "^1.1.0", + "rimraf": "^3.0.2", + "semver": "^7.3.7", + "ssri": "^9.0.1", + "tar": "^6.1.11", + "text-table": "~0.2.0", + "tiny-relative-date": "^1.3.0", + "treeverse": "^2.0.0", + "validate-npm-package-name": "^4.0.0", + "which": "^2.0.2", + "write-file-atomic": "^4.0.1" }, "bin": { "npm": "bin/npm-cli.js", "npx": "bin/npx-cli.js" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, "dependencies": { "path-key": "^3.0.0" }, @@ -2443,88 +2756,116 @@ "node": ">=8" } }, + "node_modules/npm/node_modules/@colors/colors": { + "version": "1.5.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/npm/node_modules/@gar/promisify": { - "version": "1.1.2", + "version": "1.1.3", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "2.9.0", + "version": "5.6.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@isaacs/string-locale-compare": "^1.0.1", + "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/map-workspaces": "^1.0.2", - "@npmcli/metavuln-calculator": "^1.1.0", - "@npmcli/move-file": "^1.1.0", + "@npmcli/map-workspaces": "^2.0.3", + "@npmcli/metavuln-calculator": "^3.0.1", + "@npmcli/move-file": "^2.0.0", "@npmcli/name-from-folder": "^1.0.1", - "@npmcli/node-gyp": "^1.0.1", - "@npmcli/package-json": "^1.0.1", - "@npmcli/run-script": "^1.8.2", - "bin-links": "^2.2.1", - "cacache": "^15.0.3", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/package-json": "^2.0.0", + "@npmcli/query": "^1.2.0", + "@npmcli/run-script": "^4.1.3", + "bin-links": "^3.0.3", + "cacache": "^16.1.3", "common-ancestor-path": "^1.0.1", + "hosted-git-info": "^5.2.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", + "minimatch": "^5.1.0", "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", - "npm-install-checks": "^4.0.0", - "npm-package-arg": "^8.1.5", - "npm-pick-manifest": "^6.1.0", - "npm-registry-fetch": "^11.0.0", - "pacote": "^11.3.5", - "parse-conflict-json": "^1.1.1", - "proc-log": "^1.0.0", + "nopt": "^6.0.0", + "npm-install-checks": "^5.0.0", + "npm-package-arg": "^9.0.0", + "npm-pick-manifest": "^7.0.2", + "npm-registry-fetch": "^13.0.0", + "npmlog": "^6.0.2", + "pacote": "^13.6.1", + "parse-conflict-json": "^2.0.1", + "proc-log": "^2.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^1.0.1", "read-package-json-fast": "^2.0.2", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", - "semver": "^7.3.5", - "ssri": "^8.0.1", - "treeverse": "^1.0.4", + "semver": "^7.3.7", + "ssri": "^9.0.0", + "treeverse": "^2.0.0", "walk-up-path": "^1.0.0" }, "bin": { "arborist": "bin/index.js" }, "engines": { - "node": ">= 10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/ci-detect": { - "version": "1.3.0", + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", - "peer": true + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } }, "node_modules/npm/node_modules/@npmcli/config": { - "version": "2.3.0", + "version": "4.2.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "ini": "^2.0.0", + "@npmcli/map-workspaces": "^2.0.2", + "ini": "^3.0.0", "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", - "semver": "^7.3.4", + "nopt": "^6.0.0", + "proc-log": "^2.0.0", + "read-package-json-fast": "^2.0.3", + "semver": "^7.3.5", "walk-up-path": "^1.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/disparity-colors": { - "version": "1.0.1", + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -2532,37 +2873,47 @@ "ansi-styles": "^4.3.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/fs": { - "version": "1.0.0", + "version": "2.1.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@gar/promisify": "^1.0.1", + "@gar/promisify": "^1.1.3", "semver": "^7.3.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/git": { - "version": "2.1.0", + "version": "3.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/promise-spawn": "^1.3.2", - "lru-cache": "^6.0.0", + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", "mkdirp": "^1.0.4", - "npm-pick-manifest": "^6.1.1", + "npm-pick-manifest": "^7.0.0", + "proc-log": "^2.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", "which": "^2.0.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "1.0.7", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -2577,34 +2928,51 @@ "node": ">= 10" } }, + "node_modules/npm/node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled": { + "version": "1.1.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } + }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { - "version": "1.0.4", + "version": "2.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "@npmcli/name-from-folder": "^1.0.1", - "glob": "^7.1.6", - "minimatch": "^3.0.4", - "read-package-json-fast": "^2.0.1" + "glob": "^8.0.1", + "minimatch": "^5.0.1", + "read-package-json-fast": "^2.0.3" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { - "version": "1.1.1", + "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "cacache": "^15.0.5", - "pacote": "^11.1.11", - "semver": "^7.3.2" + "cacache": "^16.0.0", + "json-parse-even-better-errors": "^2.3.1", + "pacote": "^13.0.3", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/move-file": { - "version": "1.1.2", + "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2613,68 +2981,104 @@ "rimraf": "^3.0.2" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/@npmcli/node-gyp": { - "version": "1.0.2", + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", - "peer": true + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/npm/node_modules/@npmcli/package-json": { - "version": "1.0.1", + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "json-parse-even-better-errors": "^2.3.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { - "version": "1.3.2", + "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "infer-owner": "^1.0.4" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm/node_modules/@npmcli/query": { + "version": "1.2.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "npm-package-arg": "^9.1.0", + "postcss-selector-parser": "^6.0.10", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@npmcli/run-script": { - "version": "1.8.6", + "version": "4.2.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/node-gyp": "^1.0.2", - "@npmcli/promise-spawn": "^1.3.2", - "node-gyp": "^7.1.0", - "read-package-json-fast": "^2.0.1" + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^2.0.3", + "which": "^2.0.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/@tootallnate/once": { - "version": "1.1.2", + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "engines": { - "node": ">= 6" + "node": ">= 10" } }, "node_modules/npm/node_modules/abbrev": { "version": "1.1.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/agent-base": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2686,7 +3090,8 @@ } }, "node_modules/npm/node_modules/agentkeepalive": { - "version": "4.1.4", + "version": "4.2.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2701,6 +3106,7 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2712,33 +3118,19 @@ "node": ">=8" } }, - "node_modules/npm/node_modules/ajv": { - "version": "6.12.6", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/npm/node_modules/ansi-regex": { - "version": "2.1.1", + "version": "5.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/npm/node_modules/ansi-styles": { "version": "4.3.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2752,32 +3144,23 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/npm/node_modules/ansicolors": { - "version": "0.3.2", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/ansistyles": { - "version": "0.1.3", - "inBundle": true, - "license": "MIT", - "peer": true - }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/are-we-there-yet": { - "version": "1.1.6", + "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -2786,88 +3169,54 @@ "readable-stream": "^3.6.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/asap": { "version": "2.0.6", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/asn1": { - "version": "0.2.4", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/npm/node_modules/assert-plus": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/npm/node_modules/asynckit": { - "version": "0.4.0", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/aws-sign2": { - "version": "0.7.0", - "inBundle": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/npm/node_modules/aws4": { - "version": "1.11.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, - "node_modules/npm/node_modules/bcrypt-pbkdf": { - "version": "1.0.2", + "node_modules/npm/node_modules/bin-links": { + "version": "3.0.3", + "dev": true, "inBundle": true, - "license": "BSD-3-Clause", + "license": "ISC", "peer": true, "dependencies": { - "tweetnacl": "^0.14.3" + "cmd-shim": "^5.0.0", + "mkdirp-infer-owner": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0", + "read-cmd-shim": "^3.0.0", + "rimraf": "^3.0.0", + "write-file-atomic": "^4.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm/node_modules/bin-links": { - "version": "2.2.1", + "node_modules/npm/node_modules/bin-links/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, - "dependencies": { - "cmd-shim": "^4.0.1", - "mkdirp": "^1.0.3", - "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^2.0.0", - "rimraf": "^3.0.0", - "write-file-atomic": "^3.0.3" - }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.2.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2876,58 +3225,58 @@ } }, "node_modules/npm/node_modules/brace-expansion": { - "version": "1.1.11", + "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/npm/node_modules/builtins": { - "version": "1.0.3", + "version": "5.0.1", + "dev": true, "inBundle": true, "license": "MIT", - "peer": true + "peer": true, + "dependencies": { + "semver": "^7.0.0" + } }, "node_modules/npm/node_modules/cacache": { - "version": "15.3.0", + "version": "16.1.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", + "@npmcli/fs": "^2.1.0", + "@npmcli/move-file": "^2.0.0", "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", + "fs-minipass": "^2.1.0", + "glob": "^8.0.1", "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" + "ssri": "^9.0.0", + "tar": "^6.1.11", + "unique-filename": "^2.0.0" }, "engines": { - "node": ">= 10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm/node_modules/caseless": { - "version": "0.12.0", - "inBundle": true, - "license": "Apache-2.0", - "peer": true - }, "node_modules/npm/node_modules/chalk": { "version": "4.1.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2944,6 +3293,7 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -2953,6 +3303,7 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "peer": true, @@ -2965,6 +3316,7 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -2973,80 +3325,38 @@ } }, "node_modules/npm/node_modules/cli-columns": { - "version": "3.1.2", + "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "string-width": "^2.0.0", - "strip-ansi": "^3.0.1" + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">= 4" + "node": ">= 10" } }, "node_modules/npm/node_modules/cli-table3": { - "version": "0.6.0", + "version": "0.6.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "object-assign": "^4.1.0", "string-width": "^4.2.0" }, "engines": { "node": "10.* || >= 12.*" }, "optionalDependencies": { - "colors": "^1.1.2" - } - }, - "node_modules/npm/node_modules/cli-table3/node_modules/ansi-regex": { - "version": "5.0.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/cli-table3/node_modules/string-width": { - "version": "4.2.2", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/cli-table3/node_modules/strip-ansi": { - "version": "6.0.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" + "@colors/colors": "1.5.0" } }, "node_modules/npm/node_modules/clone": { "version": "1.0.4", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3055,7 +3365,8 @@ } }, "node_modules/npm/node_modules/cmd-shim": { - "version": "4.1.0", + "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -3063,20 +3374,12 @@ "mkdirp-infer-owner": "^2.0.0" }, "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/code-point-at": { - "version": "1.1.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3089,12 +3392,14 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/color-support": { "version": "1.1.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -3102,76 +3407,57 @@ "color-support": "bin.js" } }, - "node_modules/npm/node_modules/colors": { - "version": "1.4.0", - "inBundle": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/npm/node_modules/columnify": { - "version": "1.5.4", + "version": "1.6.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "strip-ansi": "^3.0.0", + "strip-ansi": "^6.0.1", "wcwidth": "^1.0.0" - } - }, - "node_modules/npm/node_modules/combined-stream": { - "version": "1.0.8", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "delayed-stream": "~1.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">=8.0.0" } }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/concat-map": { "version": "0.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/console-control-strings": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, - "node_modules/npm/node_modules/core-util-is": { - "version": "1.0.2", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/dashdash": { - "version": "1.14.1", + "node_modules/npm/node_modules/cssesc": { + "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, - "dependencies": { - "assert-plus": "^1.0.0" + "bin": { + "cssesc": "bin/cssesc" }, "engines": { - "node": ">=0.10" + "node": ">=4" } }, "node_modules/npm/node_modules/debug": { - "version": "4.3.2", + "version": "4.3.4", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3189,12 +3475,14 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/debuglog": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3204,6 +3492,7 @@ }, "node_modules/npm/node_modules/defaults": { "version": "1.0.3", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3211,23 +3500,16 @@ "clone": "^1.0.2" } }, - "node_modules/npm/node_modules/delayed-stream": { - "version": "1.0.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/npm/node_modules/delegates": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/depd": { "version": "1.1.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3236,7 +3518,8 @@ } }, "node_modules/npm/node_modules/dezalgo": { - "version": "1.0.3", + "version": "1.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -3246,7 +3529,8 @@ } }, "node_modules/npm/node_modules/diff": { - "version": "5.0.0", + "version": "5.1.0", + "dev": true, "inBundle": true, "license": "BSD-3-Clause", "peer": true, @@ -3254,24 +3538,16 @@ "node": ">=0.3.1" } }, - "node_modules/npm/node_modules/ecc-jsbn": { - "version": "0.1.2", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/npm/node_modules/emoji-regex": { - "version": "8.0.0", + "node_modules/npm/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -3282,6 +3558,7 @@ }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3291,54 +3568,21 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/extend": { - "version": "3.0.2", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/extsprintf": { - "version": "1.3.0", - "engines": [ - "node >=0.6.0" - ], - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/fast-deep-equal": { - "version": "3.1.3", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/fast-json-stable-stringify": { - "version": "2.1.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.12", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, - "node_modules/npm/node_modules/forever-agent": { - "version": "0.6.1", - "inBundle": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "*" - } - }, "node_modules/npm/node_modules/fs-minipass": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -3351,47 +3595,41 @@ }, "node_modules/npm/node_modules/fs.realpath": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/function-bind": { "version": "1.1.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/gauge": { - "version": "3.0.1", + "version": "4.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1 || ^2.0.0", - "strip-ansi": "^3.0.1 || ^4.0.0", - "wide-align": "^1.1.2" + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" }, "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/getpass": { - "version": "0.1.7", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "assert-plus": "^1.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/glob": { - "version": "7.2.0", + "version": "8.0.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -3399,47 +3637,26 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/npm/node_modules/graceful-fs": { - "version": "4.2.8", + "version": "4.2.10", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, - "node_modules/npm/node_modules/har-schema": { - "version": "2.0.0", - "inBundle": true, - "license": "ISC", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/npm/node_modules/har-validator": { - "version": "5.1.5", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/npm/node_modules/has": { "version": "1.0.3", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3452,6 +3669,7 @@ }, "node_modules/npm/node_modules/has-flag": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3461,35 +3679,39 @@ }, "node_modules/npm/node_modules/has-unicode": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/hosted-git-info": { - "version": "4.0.2", + "version": "5.2.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/http-cache-semantics": { - "version": "4.1.0", + "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "peer": true }, "node_modules/npm/node_modules/http-proxy-agent": { - "version": "4.0.1", + "version": "5.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, @@ -3497,23 +3719,9 @@ "node": ">= 6" } }, - "node_modules/npm/node_modules/http-signature": { - "version": "1.2.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/npm/node_modules/https-proxy-agent": { - "version": "5.0.0", + "version": "5.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3527,6 +3735,7 @@ }, "node_modules/npm/node_modules/humanize-ms": { "version": "1.2.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3536,6 +3745,7 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -3548,16 +3758,21 @@ } }, "node_modules/npm/node_modules/ignore-walk": { - "version": "3.0.4", + "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "minimatch": "^3.0.4" + "minimatch": "^5.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3567,6 +3782,7 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3576,12 +3792,14 @@ }, "node_modules/npm/node_modules/infer-owner": { "version": "1.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/inflight": { "version": "1.0.6", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -3592,45 +3810,50 @@ }, "node_modules/npm/node_modules/inherits": { "version": "2.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/ini": { - "version": "2.0.0", + "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/init-package-json": { - "version": "2.0.5", + "version": "3.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-package-arg": "^8.1.5", + "npm-package-arg": "^9.0.1", "promzard": "^0.3.0", - "read": "~1.0.1", - "read-package-json": "^4.1.1", + "read": "^1.0.7", + "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^3.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/ip": { - "version": "1.1.5", + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/ip-regex": { "version": "4.3.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3640,6 +3863,7 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "4.0.2", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "peer": true, @@ -3651,7 +3875,8 @@ } }, "node_modules/npm/node_modules/is-core-module": { - "version": "2.7.0", + "version": "2.10.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -3663,63 +3888,39 @@ } }, "node_modules/npm/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", + "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/is-typedarray": { - "version": "1.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, - "node_modules/npm/node_modules/isstream": { - "version": "0.1.2", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/jsbn": { - "version": "0.1.1", - "inBundle": true, - "license": "MIT", - "peer": true - }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "2.3.1", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/json-schema": { - "version": "0.2.3", - "inBundle": true, - "peer": true - }, - "node_modules/npm/node_modules/json-schema-traverse": { - "version": "0.4.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -3727,14 +3928,9 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/json-stringify-safe": { - "version": "5.0.1", - "inBundle": true, - "license": "ISC", - "peer": true - }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", + "dev": true, "engines": [ "node >= 0.2.0" ], @@ -3742,266 +3938,253 @@ "license": "MIT", "peer": true }, - "node_modules/npm/node_modules/jsprim": { - "version": "1.4.1", - "engines": [ - "node >=0.6.0" - ], - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "node_modules/npm/node_modules/just-diff": { - "version": "3.1.1", + "version": "5.1.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/just-diff-apply": { - "version": "3.0.0", + "version": "5.4.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/libnpmaccess": { - "version": "4.0.3", + "version": "6.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^2.0.0", "minipass": "^3.1.1", - "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^11.0.0" + "npm-package-arg": "^9.0.1", + "npm-registry-fetch": "^13.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmdiff": { - "version": "2.0.4", + "version": "4.0.5", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/disparity-colors": "^1.0.1", + "@npmcli/disparity-colors": "^2.0.0", "@npmcli/installed-package-contents": "^1.0.7", "binary-extensions": "^2.2.0", - "diff": "^5.0.0", - "minimatch": "^3.0.4", - "npm-package-arg": "^8.1.4", - "pacote": "^11.3.4", + "diff": "^5.1.0", + "minimatch": "^5.0.1", + "npm-package-arg": "^9.0.1", + "pacote": "^13.6.1", "tar": "^6.1.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "2.0.1", + "version": "4.0.14", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/arborist": "^2.3.0", - "@npmcli/ci-detect": "^1.3.0", - "@npmcli/run-script": "^1.8.4", + "@npmcli/arborist": "^5.6.3", + "@npmcli/ci-detect": "^2.0.0", + "@npmcli/fs": "^2.1.1", + "@npmcli/run-script": "^4.2.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", - "npm-package-arg": "^8.1.2", - "pacote": "^11.3.1", - "proc-log": "^1.0.0", + "npm-package-arg": "^9.0.1", + "npmlog": "^6.0.2", + "pacote": "^13.6.1", + "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", + "semver": "^7.3.7", "walk-up-path": "^1.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmfund": { - "version": "1.1.0", + "version": "3.0.5", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/arborist": "^2.5.0" + "@npmcli/arborist": "^5.6.3" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmhook": { - "version": "6.0.3", + "version": "8.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^13.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmorg": { - "version": "2.0.3", + "version": "4.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^13.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmpack": { - "version": "2.0.1", + "version": "4.1.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/run-script": "^1.8.3", - "npm-package-arg": "^8.1.0", - "pacote": "^11.2.6" + "@npmcli/run-script": "^4.1.3", + "npm-package-arg": "^9.0.1", + "pacote": "^13.6.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmpublish": { - "version": "4.0.2", + "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "normalize-package-data": "^3.0.2", - "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^11.0.0", - "semver": "^7.1.3", - "ssri": "^8.0.1" + "normalize-package-data": "^4.0.0", + "npm-package-arg": "^9.0.1", + "npm-registry-fetch": "^13.0.0", + "semver": "^7.3.7", + "ssri": "^9.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmsearch": { - "version": "3.1.2", + "version": "5.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^13.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmteam": { - "version": "2.0.4", + "version": "4.0.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^13.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/libnpmversion": { - "version": "1.2.1", + "version": "3.0.7", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/git": "^2.0.7", - "@npmcli/run-script": "^1.8.4", + "@npmcli/git": "^3.0.0", + "@npmcli/run-script": "^4.1.3", "json-parse-even-better-errors": "^2.3.1", - "semver": "^7.3.5", - "stringify-package": "^1.0.1" + "proc-log": "^2.0.0", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/lru-cache": { - "version": "6.0.0", + "version": "7.13.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/npm/node_modules/make-fetch-happen": { - "version": "9.1.0", + "version": "10.2.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", + "agentkeepalive": "^4.2.1", + "cacache": "^16.1.0", "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", + "minipass-fetch": "^2.0.3", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", + "negotiator": "^0.6.3", "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/npm/node_modules/mime-db": { - "version": "1.49.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/npm/node_modules/mime-types": { - "version": "2.1.32", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "mime-db": "1.49.0" + "socks-proxy-agent": "^7.0.0", + "ssri": "^9.0.0" }, "engines": { - "node": ">= 0.6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/minimatch": { - "version": "3.0.4", + "version": "5.1.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/npm/node_modules/minipass": { - "version": "3.1.5", + "version": "3.3.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4014,6 +4197,7 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4025,24 +4209,26 @@ } }, "node_modules/npm/node_modules/minipass-fetch": { - "version": "1.4.1", + "version": "2.1.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "minipass": "^3.1.0", + "minipass": "^3.1.6", "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" + "minizlib": "^2.1.2" }, "engines": { - "node": ">=8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "optionalDependencies": { - "encoding": "^0.1.12" + "encoding": "^0.1.13" } }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4055,6 +4241,7 @@ }, "node_modules/npm/node_modules/minipass-json-stream": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4065,6 +4252,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4077,6 +4265,7 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4089,6 +4278,7 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4102,6 +4292,7 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4114,6 +4305,7 @@ }, "node_modules/npm/node_modules/mkdirp-infer-owner": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4128,18 +4320,21 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/mute-stream": { "version": "0.0.8", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/negotiator": { - "version": "0.6.2", + "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4148,121 +4343,126 @@ } }, "node_modules/npm/node_modules/node-gyp": { - "version": "7.1.2", + "version": "9.1.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", - "graceful-fs": "^4.2.3", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^10.0.3", "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", + "npmlog": "^6.0.0", "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", "which": "^2.0.2" }, "bin": { "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": ">= 10.12.0" + "node": "^12.22 || ^14.13 || >=16" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/aproba": { - "version": "1.2.0", - "inBundle": true, - "license": "ISC", - "peer": true - }, - "node_modules/npm/node_modules/node-gyp/node_modules/gauge": { - "version": "2.7.4", + "node_modules/npm/node_modules/node-gyp/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, "inBundle": true, - "license": "ISC", + "license": "MIT", "peer": true, "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", + "node_modules/npm/node_modules/node-gyp/node_modules/glob": { + "version": "7.2.3", + "dev": true, "inBundle": true, - "license": "MIT", + "license": "ISC", "peer": true, "dependencies": { - "number-is-nan": "^1.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/npmlog": { - "version": "4.1.2", + "node_modules/npm/node_modules/node-gyp/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/string-width": { - "version": "1.0.2", + "node_modules/npm/node_modules/node-gyp/node_modules/nopt": { + "version": "5.0.0", + "dev": true, "inBundle": true, - "license": "MIT", + "license": "ISC", "peer": true, "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, "node_modules/npm/node_modules/nopt": { - "version": "5.0.0", + "version": "6.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "abbrev": "1" + "abbrev": "^1.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": ">=6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/normalize-package-data": { - "version": "3.0.3", + "version": "4.0.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "peer": true, "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" + "hosted-git-info": "^5.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-audit-report": { - "version": "2.1.5", + "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4270,20 +4470,35 @@ "chalk": "^4.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-bundled": { - "version": "1.1.2", + "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-normalize-package-bin": "^1.0.1" + "npm-normalize-package-bin": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm/node_modules/npm-bundled/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-install-checks": { - "version": "4.0.0", + "version": "5.0.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "peer": true, @@ -4291,148 +4506,146 @@ "semver": "^7.1.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/npm-package-arg": { - "version": "8.1.5", + "version": "9.1.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "hosted-git-info": "^4.0.1", - "semver": "^7.3.4", - "validate-npm-package-name": "^3.0.0" + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-packlist": { - "version": "2.2.2", + "version": "5.1.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "glob": "^7.1.6", - "ignore-walk": "^3.0.3", - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" + "glob": "^8.0.1", + "ignore-walk": "^5.0.1", + "npm-bundled": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0" }, "bin": { "npm-packlist": "bin/index.js" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm/node_modules/npm-packlist/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-pick-manifest": { - "version": "6.1.1", + "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-install-checks": "^4.0.0", - "npm-normalize-package-bin": "^1.0.1", - "npm-package-arg": "^8.1.2", - "semver": "^7.3.4" + "npm-install-checks": "^5.0.0", + "npm-normalize-package-bin": "^2.0.0", + "npm-package-arg": "^9.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-profile": { - "version": "5.0.4", + "version": "6.2.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^13.0.1", + "proc-log": "^2.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-registry-fetch": { - "version": "11.0.0", + "version": "13.3.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "make-fetch-happen": "^9.0.1", - "minipass": "^3.1.3", - "minipass-fetch": "^1.3.0", + "make-fetch-happen": "^10.0.6", + "minipass": "^3.1.6", + "minipass-fetch": "^2.0.3", "minipass-json-stream": "^1.0.1", - "minizlib": "^2.0.0", - "npm-package-arg": "^8.0.0" + "minizlib": "^2.1.2", + "npm-package-arg": "^9.0.1", + "proc-log": "^2.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/npm-user-validate": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "peer": true }, "node_modules/npm/node_modules/npmlog": { - "version": "5.0.1", + "version": "6.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "are-we-there-yet": "^2.0.0", + "are-we-there-yet": "^3.0.0", "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", + "gauge": "^4.0.3", "set-blocking": "^2.0.0" - } - }, - "node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet": { - "version": "2.0.0", - "inBundle": true, - "license": "ISC", - "peer": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" }, "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/number-is-nan": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm/node_modules/oauth-sign": { - "version": "0.9.0", - "inBundle": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/npm/node_modules/object-assign": { - "version": "4.1.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/once": { "version": "1.4.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4442,6 +4655,7 @@ }, "node_modules/npm/node_modules/opener": { "version": "1.5.2", + "dev": true, "inBundle": true, "license": "(WTFPL OR MIT)", "peer": true, @@ -4451,6 +4665,7 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4465,51 +4680,59 @@ } }, "node_modules/npm/node_modules/pacote": { - "version": "11.3.5", + "version": "13.6.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "@npmcli/git": "^2.1.0", - "@npmcli/installed-package-contents": "^1.0.6", - "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^1.8.2", - "cacache": "^15.0.5", + "@npmcli/git": "^3.0.0", + "@npmcli/installed-package-contents": "^1.0.7", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/run-script": "^4.1.0", + "cacache": "^16.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "infer-owner": "^1.0.4", - "minipass": "^3.1.3", - "mkdirp": "^1.0.3", - "npm-package-arg": "^8.0.1", - "npm-packlist": "^2.1.4", - "npm-pick-manifest": "^6.0.0", - "npm-registry-fetch": "^11.0.0", + "minipass": "^3.1.6", + "mkdirp": "^1.0.4", + "npm-package-arg": "^9.0.0", + "npm-packlist": "^5.1.0", + "npm-pick-manifest": "^7.0.0", + "npm-registry-fetch": "^13.0.1", + "proc-log": "^2.0.0", "promise-retry": "^2.0.1", - "read-package-json-fast": "^2.0.1", + "read-package-json": "^5.0.0", + "read-package-json-fast": "^2.0.3", "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.1.0" + "ssri": "^9.0.0", + "tar": "^6.1.11" }, "bin": { "pacote": "lib/bin.js" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/parse-conflict-json": { - "version": "1.1.1", + "version": "2.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "json-parse-even-better-errors": "^2.3.0", - "just-diff": "^3.0.1", - "just-diff-apply": "^3.0.0" + "json-parse-even-better-errors": "^2.3.1", + "just-diff": "^5.0.1", + "just-diff-apply": "^5.2.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/path-is-absolute": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4517,20 +4740,33 @@ "node": ">=0.10.0" } }, - "node_modules/npm/node_modules/performance-now": { - "version": "2.1.0", + "node_modules/npm/node_modules/postcss-selector-parser": { + "version": "6.0.10", + "dev": true, "inBundle": true, "license": "MIT", - "peer": true + "peer": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } }, "node_modules/npm/node_modules/proc-log": { - "version": "1.0.0", + "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", - "peer": true + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4540,6 +4776,7 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4549,12 +4786,14 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4568,6 +4807,7 @@ }, "node_modules/npm/node_modules/promzard": { "version": "0.3.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4575,40 +4815,18 @@ "read": "1" } }, - "node_modules/npm/node_modules/psl": { - "version": "1.8.0", - "inBundle": true, - "license": "MIT", - "peer": true - }, - "node_modules/npm/node_modules/punycode": { - "version": "2.1.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", + "dev": true, "inBundle": true, "peer": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" } }, - "node_modules/npm/node_modules/qs": { - "version": "6.5.2", - "inBundle": true, - "license": "BSD-3-Clause", - "peer": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/npm/node_modules/read": { "version": "1.0.7", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4620,28 +4838,34 @@ } }, "node_modules/npm/node_modules/read-cmd-shim": { - "version": "2.0.0", + "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", - "peer": true + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/npm/node_modules/read-package-json": { - "version": "4.1.1", + "version": "5.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "glob": "^7.1.1", - "json-parse-even-better-errors": "^2.3.0", - "normalize-package-data": "^3.0.0", - "npm-normalize-package-bin": "^1.0.0" + "glob": "^8.0.1", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^2.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "2.0.3", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4653,8 +4877,19 @@ "node": ">=10" } }, + "node_modules/npm/node_modules/read-package-json/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "peer": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/npm/node_modules/readable-stream": { "version": "3.6.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4669,6 +4904,7 @@ }, "node_modules/npm/node_modules/readdir-scoped-modules": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4679,90 +4915,80 @@ "once": "^1.3.0" } }, - "node_modules/npm/node_modules/request": { - "version": "2.88.2", + "node_modules/npm/node_modules/retry": { + "version": "0.12.0", + "dev": true, "inBundle": true, - "license": "Apache-2.0", + "license": "MIT", "peer": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, "engines": { - "node": ">= 6" + "node": ">= 4" } }, - "node_modules/npm/node_modules/request/node_modules/form-data": { - "version": "2.3.3", + "node_modules/npm/node_modules/rimraf": { + "version": "3.0.2", + "dev": true, "inBundle": true, - "license": "MIT", + "license": "ISC", "peer": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "glob": "^7.1.3" }, - "engines": { - "node": ">= 0.12" + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/request/node_modules/tough-cookie": { - "version": "2.5.0", + "node_modules/npm/node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, "inBundle": true, - "license": "BSD-3-Clause", + "license": "MIT", "peer": true, "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/npm/node_modules/retry": { - "version": "0.12.0", + "node_modules/npm/node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "dev": true, "inBundle": true, - "license": "MIT", + "license": "ISC", "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, "engines": { - "node": ">= 4" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/npm/node_modules/rimraf": { - "version": "3.0.2", + "node_modules/npm/node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "brace-expansion": "^1.1.7" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": "*" } }, "node_modules/npm/node_modules/safe-buffer": { "version": "5.2.1", + "dev": true, "funding": [ { "type": "github", @@ -4783,12 +5009,15 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", + "optional": true, "peer": true }, "node_modules/npm/node_modules/semver": { - "version": "7.3.5", + "version": "7.3.7", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4802,20 +5031,36 @@ "node": ">=10" } }, + "node_modules/npm/node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/npm/node_modules/set-blocking": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/signal-exit": { - "version": "3.0.3", + "version": "3.0.7", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4825,13 +5070,14 @@ } }, "node_modules/npm/node_modules/socks": { - "version": "2.6.1", + "version": "2.7.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "ip": "^1.1.5", - "smart-buffer": "^4.1.0" + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" }, "engines": { "node": ">= 10.13.0", @@ -4839,14 +5085,15 @@ } }, "node_modules/npm/node_modules/socks-proxy-agent": { - "version": "6.1.0", + "version": "7.0.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { "agent-base": "^6.0.2", - "debug": "^4.3.1", - "socks": "^2.6.1" + "debug": "^4.3.3", + "socks": "^2.6.2" }, "engines": { "node": ">= 10" @@ -4854,6 +5101,7 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "peer": true, @@ -4864,12 +5112,14 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.3.0", + "dev": true, "inBundle": true, "license": "CC-BY-3.0", "peer": true }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4879,38 +5129,15 @@ } }, "node_modules/npm/node_modules/spdx-license-ids": { - "version": "3.0.10", + "version": "3.0.11", + "dev": true, "inBundle": true, "license": "CC0-1.0", "peer": true }, - "node_modules/npm/node_modules/sshpk": { - "version": "1.16.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/npm/node_modules/ssri": { - "version": "8.0.1", + "version": "9.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -4918,11 +5145,12 @@ "minipass": "^3.1.1" }, "engines": { - "node": ">= 8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/string_decoder": { "version": "1.3.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -4931,71 +5159,49 @@ } }, "node_modules/npm/node_modules/string-width": { - "version": "2.1.1", + "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/npm/node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.0", + "node_modules/npm/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/npm/node_modules/string-width/node_modules/strip-ansi": { - "version": "4.0.0", + "node_modules/npm/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, "dependencies": { - "ansi-regex": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/npm/node_modules/stringify-package": { - "version": "1.0.1", - "inBundle": true, - "license": "ISC", - "peer": true - }, - "node_modules/npm/node_modules/strip-ansi": { - "version": "3.0.1", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm/node_modules/supports-color": { - "version": "7.2.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "node": ">=8" } }, "node_modules/npm/node_modules/tar": { "version": "6.1.11", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -5013,93 +5219,64 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, "node_modules/npm/node_modules/treeverse": { - "version": "1.0.4", + "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", - "peer": true - }, - "node_modules/npm/node_modules/tunnel-agent": { - "version": "0.6.0", - "inBundle": true, - "license": "Apache-2.0", "peer": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, "engines": { - "node": "*" - } - }, - "node_modules/npm/node_modules/tweetnacl": { - "version": "0.14.5", - "inBundle": true, - "license": "Unlicense", - "peer": true - }, - "node_modules/npm/node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "is-typedarray": "^1.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/unique-filename": { - "version": "1.1.1", + "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "unique-slug": "^2.0.0" + "unique-slug": "^3.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/unique-slug": { - "version": "2.0.2", + "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "imurmurhash": "^0.1.4" - } - }, - "node_modules/npm/node_modules/uri-js": { - "version": "4.4.1", - "inBundle": true, - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "punycode": "^2.1.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT", "peer": true }, - "node_modules/npm/node_modules/uuid": { - "version": "3.4.0", - "inBundle": true, - "license": "MIT", - "peer": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "peer": true, @@ -5109,36 +5286,28 @@ } }, "node_modules/npm/node_modules/validate-npm-package-name": { - "version": "3.0.0", + "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "builtins": "^1.0.3" - } - }, - "node_modules/npm/node_modules/verror": { - "version": "1.10.0", - "engines": [ - "node >=0.6.0" - ], - "inBundle": true, - "license": "MIT", - "peer": true, - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/walk-up-path": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/wcwidth": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT", "peer": true, @@ -5148,6 +5317,7 @@ }, "node_modules/npm/node_modules/which": { "version": "2.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, @@ -5162,51 +5332,48 @@ } }, "node_modules/npm/node_modules/wide-align": { - "version": "1.1.3", + "version": "1.1.5", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "node_modules/npm/node_modules/wrappy": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, "node_modules/npm/node_modules/write-file-atomic": { - "version": "3.0.3", + "version": "4.0.2", + "dev": true, "inBundle": true, "license": "ISC", "peer": true, "dependencies": { "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "peer": true }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -5215,6 +5382,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -5226,12 +5394,13 @@ } }, "node_modules/p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", + "integrity": "sha512-lastgtAdoH9YaLyDa5i5z64q+kzOcQHsQ5SsZJD3q0VEyI8mq872S3geuNbRUQLVAE9siMfgKrpj7MloKFHruw==", + "dev": true, "peer": true, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5241,6 +5410,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", + "dev": true, "dependencies": { "p-map": "^2.0.0" }, @@ -5252,42 +5422,48 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "peer": true, + "dev": true, "engines": { "node": ">=8" } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, "peer": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^1.0.0" }, "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, "peer": true, "dependencies": { - "p-limit": "^2.2.0" + "p-limit": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true, "engines": { "node": ">=6" } @@ -5296,16 +5472,18 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==", + "dev": true, "engines": { "node": ">=8" } }, "node_modules/p-retry": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.0.tgz", - "integrity": "sha512-SAHbQEwg3X5DRNaLmWjT+DlGc93ba5i+aP3QLfVNDncQEQO4xjbYW4N/lcVTSuP0aJietGfx2t94dJLzfBMpXw==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", + "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "dev": true, "dependencies": { - "@types/retry": "^0.12.0", + "@types/retry": "0.12.0", "retry": "^0.13.1" }, "engines": { @@ -5316,7 +5494,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "peer": true, + "dev": true, "engines": { "node": ">=6" } @@ -5325,6 +5503,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "peer": true, "dependencies": { "callsites": "^3.0.0" @@ -5337,6 +5516,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -5351,18 +5531,20 @@ } }, "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, "peer": true, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "peer": true, "engines": { "node": ">=0.10.0" @@ -5372,6 +5554,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "engines": { "node": ">=8" } @@ -5380,20 +5563,22 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "peer": true + "dev": true }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } }, "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -5404,7 +5589,8 @@ "node_modules/pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, "peer": true, "engines": { "node": ">=4" @@ -5413,7 +5599,8 @@ "node_modules/pkg-conf": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", + "integrity": "sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==", + "dev": true, "peer": true, "dependencies": { "find-up": "^2.0.0", @@ -5426,7 +5613,8 @@ "node_modules/pkg-conf/node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, "peer": true, "dependencies": { "locate-path": "^2.0.0" @@ -5438,7 +5626,8 @@ "node_modules/pkg-conf/node_modules/locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, "peer": true, "dependencies": { "p-locate": "^2.0.0", @@ -5452,6 +5641,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, "peer": true, "dependencies": { "p-try": "^1.0.0" @@ -5463,7 +5653,8 @@ "node_modules/pkg-conf/node_modules/p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, "peer": true, "dependencies": { "p-limit": "^1.1.0" @@ -5475,7 +5666,8 @@ "node_modules/pkg-conf/node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, "peer": true, "engines": { "node": ">=4" @@ -5484,7 +5676,8 @@ "node_modules/pkg-conf/node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, "peer": true, "engines": { "node": ">=4" @@ -5494,23 +5687,20 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "peer": true + "dev": true }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "peer": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true, + "peer": true }, "node_modules/q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "peer": true, + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "dev": true, "engines": { "node": ">=0.6.0", "teleport": ">=0.2.0" @@ -5520,6 +5710,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -5539,7 +5730,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "peer": true, + "dev": true, "engines": { "node": ">=8" } @@ -5548,6 +5739,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, "peer": true, "dependencies": { "deep-extend": "^0.6.0", @@ -5563,7 +5755,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "peer": true, + "dev": true, "dependencies": { "@types/normalize-package-data": "^2.4.0", "normalize-package-data": "^2.5.0", @@ -5575,42 +5767,66 @@ } }, "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-9.1.0.tgz", + "integrity": "sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==", + "dev": true, "peer": true, "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "find-up": "^6.3.0", + "read-pkg": "^7.1.0", + "type-fest": "^2.5.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/read-pkg": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-7.1.0.tgz", + "integrity": "sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^2.0.0" + }, + "engines": { + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, "peer": true, "engines": { - "node": ">=8" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/read-pkg/node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "peer": true + "dev": true }, "node_modules/read-pkg/node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "peer": true, + "dev": true, "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -5622,7 +5838,7 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "peer": true, + "dev": true, "bin": { "semver": "bin/semver" } @@ -5631,16 +5847,16 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "peer": true, + "dev": true, "engines": { "node": ">=8" } }, "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "peer": true, + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -5655,7 +5871,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "peer": true, + "dev": true, "dependencies": { "indent-string": "^4.0.0", "strip-indent": "^3.0.0" @@ -5667,41 +5883,48 @@ "node_modules/redeyed": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", - "integrity": "sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs=", + "integrity": "sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==", + "dev": true, "peer": true, "dependencies": { "esprima": "~4.0.0" } }, "node_modules/registry-auth-token": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", - "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", + "dev": true, "peer": true, "dependencies": { - "rc": "^1.2.8" + "@pnpm/npm-conf": "^2.1.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=14" } }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, "peer": true, "engines": { "node": ">=0.10.0" } }, "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "peer": true, + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5711,6 +5934,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, "peer": true, "engines": { "node": ">=8" @@ -5720,6 +5944,7 @@ "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "dev": true, "engines": { "node": ">= 4" } @@ -5728,6 +5953,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -5737,6 +5963,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "peer": true, "dependencies": { "glob": "^7.1.3" @@ -5752,6 +5979,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -5774,155 +6002,302 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "peer": true + "dev": true }, "node_modules/semantic-release": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-18.0.0.tgz", - "integrity": "sha512-/Szyhq5DTZCYry/aZqpBbK/kqv10ydn6oiiaYOXtPgDbAIkqidZcQOm+mfYFJ0sBTUaOYCKMlcPMgJycP7jDYQ==", + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-20.1.1.tgz", + "integrity": "sha512-jXDr8y7ozo42N4+G9m/P5Qyx5oQO4aOS66a+Up8XECzEOFIpEoo3ngnr4R5lSix/sVJW69/fgNkOUZhsGFiQ5g==", + "dev": true, "peer": true, "dependencies": { - "@semantic-release/commit-analyzer": "^9.0.0", + "@semantic-release/commit-analyzer": "^9.0.2", "@semantic-release/error": "^3.0.0", "@semantic-release/github": "^8.0.0", - "@semantic-release/npm": "^8.0.0", + "@semantic-release/npm": "^9.0.0", "@semantic-release/release-notes-generator": "^10.0.0", - "aggregate-error": "^3.0.0", - "cosmiconfig": "^7.0.0", + "aggregate-error": "^4.0.1", + "cosmiconfig": "^8.0.0", "debug": "^4.0.0", - "env-ci": "^5.0.0", - "execa": "^5.0.0", - "figures": "^3.0.0", - "find-versions": "^4.0.0", + "env-ci": "^8.0.0", + "execa": "^7.0.0", + "figures": "^5.0.0", + "find-versions": "^5.1.0", "get-stream": "^6.0.0", "git-log-parser": "^1.2.0", - "hook-std": "^2.0.0", - "hosted-git-info": "^4.0.0", - "lodash": "^4.17.21", - "marked": "^2.0.0", - "marked-terminal": "^4.1.1", + "hook-std": "^3.0.0", + "hosted-git-info": "^6.0.0", + "lodash-es": "^4.17.21", + "marked": "^4.1.0", + "marked-terminal": "^5.1.1", "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "p-reduce": "^2.0.0", - "read-pkg-up": "^7.0.0", + "p-each-series": "^3.0.0", + "p-reduce": "^3.0.0", + "read-pkg-up": "^9.1.0", "resolve-from": "^5.0.0", "semver": "^7.3.2", - "semver-diff": "^3.1.1", + "semver-diff": "^4.0.0", "signale": "^1.2.1", - "yargs": "^16.2.0" + "yargs": "^17.5.1" }, "bin": { "semantic-release": "bin/semantic-release.js" }, "engines": { - "node": ">=14.17" + "node": ">=18" } }, - "node_modules/semantic-release/node_modules/@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", + "node_modules/semantic-release/node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, "peer": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, "engines": { - "node": ">=14.17" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semantic-release/node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "node_modules/semantic-release/node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, "peer": true, "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semantic-release/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "node_modules/semantic-release/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, "peer": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semantic-release/node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "node_modules/semantic-release/node_modules/execa": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.0.0.tgz", + "integrity": "sha512-tQbH0pH/8LHTnwTrsKWideqi6rFB/QNUawEwrn+WHyz7PX1Tuz2u7wfTvbaNBdP5JD5LVWxNo8/A8CHNZ3bV6g==", + "dev": true, "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, "engines": { - "node": ">=10.17.0" + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/semantic-release/node_modules/human-signals": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.0.tgz", + "integrity": "sha512-zyzVyMjpGBX2+6cDVZeFPCdtOtdsxOeseRhB9tkQ6xXmGUNrcnBzdEKPy3VPNYz+4gy1oukVOXcrJCunSyc6QQ==", + "dev": true, "peer": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, "engines": { - "node": ">=10" + "node": ">=14.18.0" } }, - "node_modules/semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "node_modules/semantic-release/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, "peer": true, - "dependencies": { - "semver": "^6.3.0" - }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semver-diff/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/semantic-release/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, "peer": true, - "bin": { - "semver": "bin/semver.js" + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semver-regex": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", - "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", + "node_modules/semantic-release/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, "peer": true, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/shebang-command": { - "version": "2.0.0", + "node_modules/semantic-release/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "peer": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/p-reduce": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-3.0.0.tgz", + "integrity": "sha512-xsrIUgI0Kn6iyDYm9StOpOeK29XM1aboGji26+QEortiFST1hGZaUQOLhtEbqHErPpGW/aSz6allwK2qcptp0Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semantic-release/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", + "integrity": "sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==", + "dev": true, + "peer": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semver-regex": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -5934,19 +6309,22 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, "engines": { "node": ">=8" } }, "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/signale": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", + "dev": true, "peer": true, "dependencies": { "chalk": "^2.3.2", @@ -5960,7 +6338,8 @@ "node_modules/signale/node_modules/figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, "peer": true, "dependencies": { "escape-string-regexp": "^1.0.5" @@ -5973,6 +6352,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -5981,7 +6361,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "peer": true, + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5989,14 +6369,15 @@ "node_modules/spawn-error-forwarder": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", - "integrity": "sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk=", + "integrity": "sha512-gRjMgK5uFjbCvdibeGJuy3I5OYz6VLoVdsOJdA6wV0WlfQVLFueoqMxwwYD9RODdgb6oUIvlRlsyFSiQkMKu0g==", + "dev": true, "peer": true }, "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "peer": true, + "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -6006,29 +6387,29 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "peer": true + "dev": true }, "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "peer": true, + "dev": true, "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-license-ids": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", - "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", - "peer": true + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", + "dev": true }, "node_modules/split": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "peer": true, + "dev": true, "dependencies": { "through": "2" }, @@ -6040,16 +6421,16 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "peer": true, + "dev": true, "dependencies": { "readable-stream": "^3.0.0" } }, "node_modules/split2/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "peer": true, + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.1.tgz", + "integrity": "sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -6062,7 +6443,8 @@ "node_modules/stream-combiner2": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", + "dev": true, "peer": true, "dependencies": { "duplexer2": "~0.1.0", @@ -6073,7 +6455,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "peer": true, + "dev": true, "dependencies": { "safe-buffer": "~5.1.0" } @@ -6082,6 +6464,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "peer": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -6096,6 +6479,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "peer": true, "dependencies": { "ansi-regex": "^5.0.1" @@ -6107,7 +6491,8 @@ "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, "peer": true, "engines": { "node": ">=4" @@ -6117,6 +6502,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, "engines": { "node": ">=6" } @@ -6125,7 +6511,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "peer": true, + "dev": true, "dependencies": { "min-indent": "^1.0.0" }, @@ -6136,7 +6522,8 @@ "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, "peer": true, "engines": { "node": ">=0.10.0" @@ -6146,6 +6533,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -6154,9 +6542,10 @@ } }, "node_modules/supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "dev": true, "peer": true, "dependencies": { "has-flag": "^4.0.0", @@ -6170,6 +6559,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "peer": true, "engines": { "node": ">=8" @@ -6179,6 +6569,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "peer": true, "dependencies": { "has-flag": "^4.0.0" @@ -6187,10 +6578,23 @@ "node": ">=8" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", + "dev": true, "peer": true, "engines": { "node": ">=8" @@ -6200,6 +6604,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/tempy/-/tempy-1.0.1.tgz", "integrity": "sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==", + "dev": true, "peer": true, "dependencies": { "del": "^6.0.0", @@ -6219,6 +6624,7 @@ "version": "0.16.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "dev": true, "peer": true, "engines": { "node": ">=10" @@ -6231,7 +6637,7 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", - "peer": true, + "dev": true, "engines": { "node": ">=0.10" } @@ -6239,23 +6645,23 @@ "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "peer": true + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true }, "node_modules/through2": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", - "peer": true, + "dev": true, "dependencies": { "readable-stream": "3" } }, "node_modules/through2/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "peer": true, + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.1.tgz", + "integrity": "sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -6269,6 +6675,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -6279,27 +6686,33 @@ "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true }, "node_modules/traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", - "peer": true + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", + "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", - "peer": true, + "dev": true, "engines": { "node": ">=8" } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, "peer": true, "engines": { "node": ">=10" @@ -6309,11 +6722,11 @@ } }, "node_modules/uglify-js": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", - "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==", + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, "optional": true, - "peer": true, "bin": { "uglifyjs": "bin/uglifyjs" }, @@ -6325,6 +6738,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, "peer": true, "dependencies": { "crypto-random-string": "^2.0.0" @@ -6336,12 +6750,14 @@ "node_modules/universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, "engines": { "node": ">= 10.0.0" } @@ -6349,19 +6765,20 @@ "node_modules/url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", + "dev": true }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "peer": true + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "peer": true, + "dev": true, "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -6370,12 +6787,14 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -6385,6 +6804,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -6398,13 +6818,14 @@ "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "peer": true + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "peer": true, "dependencies": { "ansi-styles": "^4.0.0", @@ -6422,6 +6843,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "peer": true, "dependencies": { "color-convert": "^2.0.1" @@ -6437,6 +6859,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "peer": true, "dependencies": { "color-name": "~1.1.4" @@ -6449,17 +6872,20 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, "peer": true }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, "peer": true, "engines": { "node": ">=0.4" @@ -6469,6 +6895,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, "peer": true, "engines": { "node": ">=10" @@ -6478,4837 +6905,58 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "peer": true - }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "peer": true, - "engines": { - "node": ">= 6" - } + "dev": true }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", + "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", + "dev": true, "peer": true, "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "peer": true, + "dev": true, "engines": { "node": ">=10" } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", - "requires": { - "@babel/highlight": "^7.14.5" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==" - }, - "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "requires": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - }, - "@nodelib/fs.walk": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", - "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@octokit/auth-token": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.0.tgz", - "integrity": "sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ==", - "requires": { - "@octokit/types": "^6.0.3" - } - }, - "@octokit/core": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.4.tgz", - "integrity": "sha512-sUpR/hc4Gc7K34o60bWC7WUH6Q7T6ftZ2dUmepSyJr9PRF76/qqkWjE2SOEzCqLA5W83SaISymwKtxks+96hPQ==", - "requires": { - "@octokit/auth-token": "^3.0.0", - "@octokit/graphql": "^5.0.0", - "@octokit/request": "^6.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/endpoint": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.0.tgz", - "integrity": "sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ==", - "requires": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/graphql": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.0.tgz", - "integrity": "sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ==", - "requires": { - "@octokit/request": "^6.0.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/openapi-types": { - "version": "12.11.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", - "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==" - }, - "@octokit/plugin-paginate-rest": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.1.0.tgz", - "integrity": "sha512-+cfc40pMzWcLkoDcLb1KXqjX0jTGYXjKuQdFQDc6UAknISJHnZTiBqld6HDwRJvD4DsouDKrWXNbNV0lE/3AXA==", - "requires": { - "@octokit/types": "^6.41.0" - } - }, - "@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "requires": {} - }, - "@octokit/plugin-rest-endpoint-methods": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.2.0.tgz", - "integrity": "sha512-PZ+yfkbZAuRUtqu6Y191/V3eM0KBPx+Yq7nh+ONPdpm3EX4pd5UnK2y2XgO/0AtNum5a4aJCDjqsDuUZ2hWRXw==", - "requires": { - "@octokit/types": "^6.41.0", - "deprecation": "^2.3.1" - } - }, - "@octokit/request": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.0.tgz", - "integrity": "sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q==", - "requires": { - "@octokit/endpoint": "^7.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - } - }, - "@octokit/request-error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.0.tgz", - "integrity": "sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==", - "requires": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "@octokit/rest": { - "version": "19.0.3", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.3.tgz", - "integrity": "sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ==", - "requires": { - "@octokit/core": "^4.0.0", - "@octokit/plugin-paginate-rest": "^3.0.0", - "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-rest-endpoint-methods": "^6.0.0" - } - }, - "@octokit/types": { - "version": "6.41.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", - "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", - "requires": { - "@octokit/openapi-types": "^12.11.0" - } - }, - "@semantic-release/changelog": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.1.tgz", - "integrity": "sha512-FT+tAGdWHr0RCM3EpWegWnvXJ05LQtBkQUaQRIExONoXjVjLuOILNm4DEKNaV+GAQyJjbLRVs57ti//GypH6PA==", - "requires": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "fs-extra": "^9.0.0", - "lodash": "^4.17.4" - }, - "dependencies": { - "@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==" - } - } }, - "@semantic-release/commit-analyzer": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-9.0.1.tgz", - "integrity": "sha512-ncNsnrLmiykhgNZUXNvhhAjNN0me7VGIb0X5hu3ogyi5DDPapjGAHdEffO5vi+HX1BFWLRD/Ximx5PjGAKjAqQ==", + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, "peer": true, - "requires": { - "conventional-changelog-angular": "^5.0.0", - "conventional-commits-filter": "^2.0.0", - "conventional-commits-parser": "^3.0.7", - "debug": "^4.0.0", - "import-from": "^4.0.0", - "lodash": "^4.17.4", - "micromatch": "^4.0.2" + "engines": { + "node": ">=12" } }, - "@semantic-release/error": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-2.2.0.tgz", - "integrity": "sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg==" - }, - "@semantic-release/exec": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@semantic-release/exec/-/exec-6.0.3.tgz", - "integrity": "sha512-bxAq8vLOw76aV89vxxICecEa8jfaWwYITw6X74zzlO0mc/Bgieqx9kBRz9z96pHectiTAtsCwsQcUyLYWnp3VQ==", - "requires": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "debug": "^4.0.0", - "execa": "^5.0.0", - "lodash": "^4.17.4", - "parse-json": "^5.0.0" + "node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.20" }, - "dependencies": { - "@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==" - }, - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } - }, - "@semantic-release/git": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", - "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", - "requires": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "debug": "^4.0.0", - "dir-glob": "^3.0.0", - "execa": "^5.0.0", - "lodash": "^4.17.4", - "micromatch": "^4.0.0", - "p-reduce": "^2.0.0" - }, - "dependencies": { - "@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==" - }, - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" - } - } - }, - "@semantic-release/github": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-8.0.5.tgz", - "integrity": "sha512-9pGxRM3gv1hgoZ/muyd4pWnykdIUVfCiev6MXE9lOyGQof4FQy95GFE26nDcifs9ZG7bBzV8ue87bo/y1zVf0g==", - "requires": { - "@octokit/rest": "^19.0.0", - "@semantic-release/error": "^2.2.0", - "aggregate-error": "^3.0.0", - "bottleneck": "^2.18.1", - "debug": "^4.0.0", - "dir-glob": "^3.0.0", - "fs-extra": "^10.0.0", - "globby": "^11.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "issue-parser": "^6.0.0", - "lodash": "^4.17.4", - "mime": "^3.0.0", - "p-filter": "^2.0.0", - "p-retry": "^4.0.0", - "url-join": "^4.0.0" - }, - "dependencies": { - "fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - } - } - }, - "@semantic-release/npm": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-8.0.0.tgz", - "integrity": "sha512-MAlynjIaN5XwBEzsq3xbZ8I+riD9zhLvpPqGCPaZ0j/ySbR0Sg3YG1MYv03fC1aygPFFC5RwefMxKids9llvDg==", - "peer": true, - "requires": { - "@semantic-release/error": "^2.2.0", - "aggregate-error": "^3.0.0", - "execa": "^5.0.0", - "fs-extra": "^10.0.0", - "lodash": "^4.17.15", - "nerf-dart": "^1.0.0", - "normalize-url": "^6.0.0", - "npm": "^7.0.0", - "rc": "^1.2.8", - "read-pkg": "^5.0.0", - "registry-auth-token": "^4.0.0", - "semver": "^7.1.2", - "tempy": "^1.0.0" - }, - "dependencies": { - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "peer": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "fs-extra": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", - "peer": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "peer": true - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "peer": true - } - } - }, - "@semantic-release/release-notes-generator": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-10.0.2.tgz", - "integrity": "sha512-I4eavIcDan8fNQHskZ2cbWkFMimvgxNkqR2UfuYNwYBgswEl3SJsN8XMf9gZWObt6nXDc2QfDwhjy8DjTZqS3w==", - "peer": true, - "requires": { - "conventional-changelog-angular": "^5.0.0", - "conventional-changelog-writer": "^5.0.0", - "conventional-commits-filter": "^2.0.0", - "conventional-commits-parser": "^3.0.0", - "debug": "^4.0.0", - "get-stream": "^6.0.0", - "import-from": "^4.0.0", - "into-stream": "^6.0.0", - "lodash": "^4.17.4", - "read-pkg-up": "^7.0.0" - }, - "dependencies": { - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "peer": true - } - } - }, - "@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" - }, - "@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "peer": true - }, - "@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "peer": true - }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "peer": true - }, - "@types/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" - }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "peer": true, - "requires": { - "type-fest": "^0.21.3" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "peer": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "ansicolors": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", - "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", - "peer": true - }, - "argv-formatter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", - "integrity": "sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk=", - "peer": true - }, - "array-ify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", - "peer": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "peer": true - }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "peer": true - }, - "before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" - }, - "bottleneck": { - "version": "2.19.5", - "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", - "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "peer": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "peer": true - }, - "camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "peer": true, - "requires": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - } - }, - "cardinal": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz", - "integrity": "sha1-fMEFXYItISlU0HsIXeolHMe8VQU=", - "peer": true, - "requires": { - "ansicolors": "~0.3.2", - "redeyed": "~2.1.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" - }, - "cli-table3": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz", - "integrity": "sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ==", - "peer": true, - "requires": { - "colors": "^1.1.2", - "object-assign": "^4.1.0", - "string-width": "^4.2.0" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "peer": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "optional": true, - "peer": true - }, - "compare-func": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", - "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", - "peer": true, - "requires": { - "array-ify": "^1.0.0", - "dot-prop": "^5.1.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "peer": true - }, - "conventional-changelog-angular": { - "version": "5.0.13", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", - "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", - "peer": true, - "requires": { - "compare-func": "^2.0.0", - "q": "^1.5.1" - } - }, - "conventional-changelog-writer": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.0.tgz", - "integrity": "sha512-HnDh9QHLNWfL6E1uHz6krZEQOgm8hN7z/m7tT16xwd802fwgMN0Wqd7AQYVkhpsjDUx/99oo+nGgvKF657XP5g==", - "peer": true, - "requires": { - "conventional-commits-filter": "^2.0.7", - "dateformat": "^3.0.0", - "handlebars": "^4.7.6", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.15", - "meow": "^8.0.0", - "semver": "^6.0.0", - "split": "^1.0.0", - "through2": "^4.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "peer": true - } - } - }, - "conventional-commits-filter": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", - "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", - "peer": true, - "requires": { - "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.0" - } - }, - "conventional-commits-parser": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz", - "integrity": "sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g==", - "peer": true, - "requires": { - "is-text-path": "^1.0.1", - "JSONStream": "^1.0.4", - "lodash": "^4.17.15", - "meow": "^8.0.0", - "split2": "^3.0.0", - "through2": "^4.0.0" - } - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "peer": true - }, - "cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", - "peer": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - } - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "peer": true - }, - "dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "peer": true - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "peer": true - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "peer": true, - "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "peer": true - } - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "peer": true - }, - "del": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", - "integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==", - "peer": true, - "requires": { - "globby": "^11.0.1", - "graceful-fs": "^4.2.4", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.2", - "p-map": "^4.0.0", - "rimraf": "^3.0.2", - "slash": "^3.0.0" - }, - "dependencies": { - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "peer": true, - "requires": { - "aggregate-error": "^3.0.0" - } - } - } - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "requires": { - "path-type": "^4.0.0" - } - }, - "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "peer": true, - "requires": { - "is-obj": "^2.0.0" - } - }, - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "peer": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "peer": true - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "peer": true, - "requires": { - "once": "^1.4.0" - } - }, - "env-ci": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-5.0.2.tgz", - "integrity": "sha512-Xc41mKvjouTXD3Oy9AqySz1IeyvJvHZ20Twf5ZLYbNpPPIuCnL/qHCmNlD01LoNy0JTunw9HPYVptD19Ac7Mbw==", - "peer": true, - "requires": { - "execa": "^4.0.0", - "java-properties": "^1.0.0" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "peer": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "peer": true - }, - "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "peer": true, - "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - } - }, - "fast-glob": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz", - "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "requires": { - "reusify": "^1.0.4" - } - }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "peer": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "peer": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "find-versions": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", - "peer": true, - "requires": { - "semver-regex": "^3.1.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "peer": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "peer": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "peer": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "peer": true - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "peer": true, - "requires": { - "pump": "^3.0.0" - } - }, - "git-log-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", - "integrity": "sha1-LmpMGxP8AAKCB7p5WnrDFme5/Uo=", - "peer": true, - "requires": { - "argv-formatter": "~1.0.0", - "spawn-error-forwarder": "~1.0.0", - "split2": "~1.0.0", - "stream-combiner2": "~1.1.1", - "through2": "~2.0.0", - "traverse": "~0.6.6" - }, - "dependencies": { - "split2": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", - "integrity": "sha1-UuLiIdiMdfmnP5BVbiY/+WdysxQ=", - "peer": true, - "requires": { - "through2": "~2.0.0" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "peer": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" - }, - "handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", - "peer": true, - "requires": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4", - "wordwrap": "^1.0.0" - } - }, - "hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "peer": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "peer": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "hook-std": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", - "integrity": "sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g==", - "peer": true - }, - "hosted-git-info": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", - "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", - "peer": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "requires": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - } - }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "peer": true - }, - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "peer": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "peer": true - } - } - }, - "import-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-from/-/import-from-4.0.0.tgz", - "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==", - "peer": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "peer": true - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "peer": true - }, - "into-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", - "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", - "peer": true, - "requires": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-core-module": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.7.0.tgz", - "integrity": "sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ==", - "peer": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "peer": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "peer": true - }, - "is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "peer": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "peer": true - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "peer": true - }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" - }, - "is-text-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", - "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", - "peer": true, - "requires": { - "text-extensions": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "peer": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "issue-parser": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", - "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", - "requires": { - "lodash.capitalize": "^4.2.1", - "lodash.escaperegexp": "^4.1.2", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.uniqby": "^4.7.0" - } - }, - "java-properties": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", - "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", - "peer": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "peer": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "peer": true - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "peer": true - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "peer": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "peer": true - }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "peer": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "peer": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - } - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "peer": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.capitalize": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", - "integrity": "sha1-+CbJtOKoUR2E46yinbBeGk87cqk=" - }, - "lodash.escaperegexp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" - }, - "lodash.ismatch": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", - "peer": true - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" - }, - "lodash.uniqby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", - "integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=" - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "peer": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "map-obj": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", - "peer": true - }, - "marked": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", - "peer": true - }, - "marked-terminal": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-4.2.0.tgz", - "integrity": "sha512-DQfNRV9svZf0Dm9Cf5x5xaVJ1+XjxQW6XjFJ5HFkVyK52SDpj5PCBzS5X5r2w9nHr3mlB0T5201UMLue9fmhUw==", - "peer": true, - "requires": { - "ansi-escapes": "^4.3.1", - "cardinal": "^2.1.1", - "chalk": "^4.1.0", - "cli-table3": "^0.6.0", - "node-emoji": "^1.10.0", - "supports-hyperlinks": "^2.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "peer": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "peer": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "peer": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "meow": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", - "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", - "peer": true, - "requires": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^3.0.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.18.0", - "yargs-parser": "^20.2.3" - }, - "dependencies": { - "type-fest": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", - "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", - "peer": true - } - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==" - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - }, - "min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "peer": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "peer": true - }, - "minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "peer": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - } - }, - "modify-values": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", - "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", - "peer": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "peer": true - }, - "nerf-dart": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", - "integrity": "sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo=", - "peer": true - }, - "node-emoji": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", - "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", - "peer": true, - "requires": { - "lodash": "^4.17.21" - } - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "peer": true, - "requires": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "peer": true - }, - "npm": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/npm/-/npm-7.24.2.tgz", - "integrity": "sha512-120p116CE8VMMZ+hk8IAb1inCPk4Dj3VZw29/n2g6UI77urJKVYb7FZUDW8hY+EBnfsjI/2yrobBgFyzo7YpVQ==", - "peer": true, - "requires": { - "@isaacs/string-locale-compare": "*", - "@npmcli/arborist": "*", - "@npmcli/ci-detect": "*", - "@npmcli/config": "*", - "@npmcli/map-workspaces": "*", - "@npmcli/package-json": "*", - "@npmcli/run-script": "*", - "abbrev": "*", - "ansicolors": "*", - "ansistyles": "*", - "archy": "*", - "cacache": "*", - "chalk": "*", - "chownr": "*", - "cli-columns": "*", - "cli-table3": "*", - "columnify": "*", - "fastest-levenshtein": "*", - "glob": "*", - "graceful-fs": "*", - "hosted-git-info": "*", - "ini": "*", - "init-package-json": "*", - "is-cidr": "*", - "json-parse-even-better-errors": "*", - "libnpmaccess": "*", - "libnpmdiff": "*", - "libnpmexec": "*", - "libnpmfund": "*", - "libnpmhook": "*", - "libnpmorg": "*", - "libnpmpack": "*", - "libnpmpublish": "*", - "libnpmsearch": "*", - "libnpmteam": "*", - "libnpmversion": "*", - "make-fetch-happen": "*", - "minipass": "*", - "minipass-pipeline": "*", - "mkdirp": "*", - "mkdirp-infer-owner": "*", - "ms": "*", - "node-gyp": "*", - "nopt": "*", - "npm-audit-report": "*", - "npm-install-checks": "*", - "npm-package-arg": "*", - "npm-pick-manifest": "*", - "npm-profile": "*", - "npm-registry-fetch": "*", - "npm-user-validate": "*", - "npmlog": "*", - "opener": "*", - "pacote": "*", - "parse-conflict-json": "*", - "qrcode-terminal": "*", - "read": "*", - "read-package-json": "*", - "read-package-json-fast": "*", - "readdir-scoped-modules": "*", - "rimraf": "*", - "semver": "*", - "ssri": "*", - "tar": "*", - "text-table": "*", - "tiny-relative-date": "*", - "treeverse": "*", - "validate-npm-package-name": "*", - "which": "*", - "write-file-atomic": "*" - }, - "dependencies": { - "@gar/promisify": { - "version": "1.1.2", - "bundled": true, - "peer": true - }, - "@isaacs/string-locale-compare": { - "version": "1.1.0", - "bundled": true, - "peer": true - }, - "@npmcli/arborist": { - "version": "2.9.0", - "bundled": true, - "peer": true, - "requires": { - "@isaacs/string-locale-compare": "^1.0.1", - "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/map-workspaces": "^1.0.2", - "@npmcli/metavuln-calculator": "^1.1.0", - "@npmcli/move-file": "^1.1.0", - "@npmcli/name-from-folder": "^1.0.1", - "@npmcli/node-gyp": "^1.0.1", - "@npmcli/package-json": "^1.0.1", - "@npmcli/run-script": "^1.8.2", - "bin-links": "^2.2.1", - "cacache": "^15.0.3", - "common-ancestor-path": "^1.0.1", - "json-parse-even-better-errors": "^2.3.1", - "json-stringify-nice": "^1.1.4", - "mkdirp": "^1.0.4", - "mkdirp-infer-owner": "^2.0.0", - "npm-install-checks": "^4.0.0", - "npm-package-arg": "^8.1.5", - "npm-pick-manifest": "^6.1.0", - "npm-registry-fetch": "^11.0.0", - "pacote": "^11.3.5", - "parse-conflict-json": "^1.1.1", - "proc-log": "^1.0.0", - "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^1.0.1", - "read-package-json-fast": "^2.0.2", - "readdir-scoped-modules": "^1.1.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "ssri": "^8.0.1", - "treeverse": "^1.0.4", - "walk-up-path": "^1.0.0" - } - }, - "@npmcli/ci-detect": { - "version": "1.3.0", - "bundled": true, - "peer": true - }, - "@npmcli/config": { - "version": "2.3.0", - "bundled": true, - "peer": true, - "requires": { - "ini": "^2.0.0", - "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", - "semver": "^7.3.4", - "walk-up-path": "^1.0.0" - } - }, - "@npmcli/disparity-colors": { - "version": "1.0.1", - "bundled": true, - "peer": true, - "requires": { - "ansi-styles": "^4.3.0" - } - }, - "@npmcli/fs": { - "version": "1.0.0", - "bundled": true, - "peer": true, - "requires": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "@npmcli/git": { - "version": "2.1.0", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/promise-spawn": "^1.3.2", - "lru-cache": "^6.0.0", - "mkdirp": "^1.0.4", - "npm-pick-manifest": "^6.1.1", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^2.0.2" - } - }, - "@npmcli/installed-package-contents": { - "version": "1.0.7", - "bundled": true, - "peer": true, - "requires": { - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "@npmcli/map-workspaces": { - "version": "1.0.4", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/name-from-folder": "^1.0.1", - "glob": "^7.1.6", - "minimatch": "^3.0.4", - "read-package-json-fast": "^2.0.1" - } - }, - "@npmcli/metavuln-calculator": { - "version": "1.1.1", - "bundled": true, - "peer": true, - "requires": { - "cacache": "^15.0.5", - "pacote": "^11.1.11", - "semver": "^7.3.2" - } - }, - "@npmcli/move-file": { - "version": "1.1.2", - "bundled": true, - "peer": true, - "requires": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - } - }, - "@npmcli/name-from-folder": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "@npmcli/node-gyp": { - "version": "1.0.2", - "bundled": true, - "peer": true - }, - "@npmcli/package-json": { - "version": "1.0.1", - "bundled": true, - "peer": true, - "requires": { - "json-parse-even-better-errors": "^2.3.1" - } - }, - "@npmcli/promise-spawn": { - "version": "1.3.2", - "bundled": true, - "peer": true, - "requires": { - "infer-owner": "^1.0.4" - } - }, - "@npmcli/run-script": { - "version": "1.8.6", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/node-gyp": "^1.0.2", - "@npmcli/promise-spawn": "^1.3.2", - "node-gyp": "^7.1.0", - "read-package-json-fast": "^2.0.1" - } - }, - "@tootallnate/once": { - "version": "1.1.2", - "bundled": true, - "peer": true - }, - "abbrev": { - "version": "1.1.1", - "bundled": true, - "peer": true - }, - "agent-base": { - "version": "6.0.2", - "bundled": true, - "peer": true, - "requires": { - "debug": "4" - } - }, - "agentkeepalive": { - "version": "4.1.4", - "bundled": true, - "peer": true, - "requires": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - } - }, - "aggregate-error": { - "version": "3.1.0", - "bundled": true, - "peer": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "bundled": true, - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "peer": true - }, - "ansi-styles": { - "version": "4.3.0", - "bundled": true, - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "ansicolors": { - "version": "0.3.2", - "bundled": true, - "peer": true - }, - "ansistyles": { - "version": "0.1.3", - "bundled": true, - "peer": true - }, - "aproba": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "are-we-there-yet": { - "version": "1.1.6", - "bundled": true, - "peer": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, - "asap": { - "version": "2.0.6", - "bundled": true, - "peer": true - }, - "asn1": { - "version": "0.2.4", - "bundled": true, - "peer": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "peer": true - }, - "aws-sign2": { - "version": "0.7.0", - "bundled": true, - "peer": true - }, - "aws4": { - "version": "1.11.0", - "bundled": true, - "peer": true - }, - "balanced-match": { - "version": "1.0.2", - "bundled": true, - "peer": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "bundled": true, - "peer": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bin-links": { - "version": "2.2.1", - "bundled": true, - "peer": true, - "requires": { - "cmd-shim": "^4.0.1", - "mkdirp": "^1.0.3", - "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^2.0.0", - "rimraf": "^3.0.0", - "write-file-atomic": "^3.0.3" - } - }, - "binary-extensions": { - "version": "2.2.0", - "bundled": true, - "peer": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "builtins": { - "version": "1.0.3", - "bundled": true, - "peer": true - }, - "cacache": { - "version": "15.3.0", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - } - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "peer": true - }, - "chalk": { - "version": "4.1.2", - "bundled": true, - "peer": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chownr": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "cidr-regex": { - "version": "3.1.1", - "bundled": true, - "peer": true, - "requires": { - "ip-regex": "^4.1.0" - } - }, - "clean-stack": { - "version": "2.2.0", - "bundled": true, - "peer": true - }, - "cli-columns": { - "version": "3.1.2", - "bundled": true, - "peer": true, - "requires": { - "string-width": "^2.0.0", - "strip-ansi": "^3.0.1" - } - }, - "cli-table3": { - "version": "0.6.0", - "bundled": true, - "peer": true, - "requires": { - "colors": "^1.1.2", - "object-assign": "^4.1.0", - "string-width": "^4.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "bundled": true, - "peer": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "bundled": true, - "peer": true - }, - "string-width": { - "version": "4.2.2", - "bundled": true, - "peer": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "bundled": true, - "peer": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, - "clone": { - "version": "1.0.4", - "bundled": true, - "peer": true - }, - "cmd-shim": { - "version": "4.1.0", - "bundled": true, - "peer": true, - "requires": { - "mkdirp-infer-owner": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "peer": true - }, - "color-convert": { - "version": "2.0.1", - "bundled": true, - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "bundled": true, - "peer": true - }, - "color-support": { - "version": "1.1.3", - "bundled": true, - "peer": true - }, - "colors": { - "version": "1.4.0", - "bundled": true, - "optional": true, - "peer": true - }, - "columnify": { - "version": "1.5.4", - "bundled": true, - "peer": true, - "requires": { - "strip-ansi": "^3.0.0", - "wcwidth": "^1.0.0" - } - }, - "combined-stream": { - "version": "1.0.8", - "bundled": true, - "peer": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "common-ancestor-path": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "peer": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "peer": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "peer": true - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "peer": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "4.3.2", - "bundled": true, - "peer": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "bundled": true, - "peer": true - } - } - }, - "debuglog": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "defaults": { - "version": "1.0.3", - "bundled": true, - "peer": true, - "requires": { - "clone": "^1.0.2" - } - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "depd": { - "version": "1.1.2", - "bundled": true, - "peer": true - }, - "dezalgo": { - "version": "1.0.3", - "bundled": true, - "peer": true, - "requires": { - "asap": "^2.0.0", - "wrappy": "1" - } - }, - "diff": { - "version": "5.0.0", - "bundled": true, - "peer": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "bundled": true, - "peer": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "bundled": true, - "peer": true - }, - "encoding": { - "version": "0.1.13", - "bundled": true, - "optional": true, - "peer": true, - "requires": { - "iconv-lite": "^0.6.2" - } - }, - "env-paths": { - "version": "2.2.1", - "bundled": true, - "peer": true - }, - "err-code": { - "version": "2.0.3", - "bundled": true, - "peer": true - }, - "extend": { - "version": "3.0.2", - "bundled": true, - "peer": true - }, - "extsprintf": { - "version": "1.3.0", - "bundled": true, - "peer": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "bundled": true, - "peer": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "bundled": true, - "peer": true - }, - "fastest-levenshtein": { - "version": "1.0.12", - "bundled": true, - "peer": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "peer": true - }, - "fs-minipass": { - "version": "2.1.0", - "bundled": true, - "peer": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "function-bind": { - "version": "1.1.1", - "bundled": true, - "peer": true - }, - "gauge": { - "version": "3.0.1", - "bundled": true, - "peer": true, - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1 || ^2.0.0", - "strip-ansi": "^3.0.1 || ^4.0.0", - "wide-align": "^1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "peer": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.2.0", - "bundled": true, - "peer": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.2.8", - "bundled": true, - "peer": true - }, - "har-schema": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "har-validator": { - "version": "5.1.5", - "bundled": true, - "peer": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "bundled": true, - "peer": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "bundled": true, - "peer": true - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "peer": true - }, - "hosted-git-info": { - "version": "4.0.2", - "bundled": true, - "peer": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "http-cache-semantics": { - "version": "4.1.0", - "bundled": true, - "peer": true - }, - "http-proxy-agent": { - "version": "4.0.1", - "bundled": true, - "peer": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } - }, - "http-signature": { - "version": "1.2.0", - "bundled": true, - "peer": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-proxy-agent": { - "version": "5.0.0", - "bundled": true, - "peer": true, - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "humanize-ms": { - "version": "1.2.1", - "bundled": true, - "peer": true, - "requires": { - "ms": "^2.0.0" - } - }, - "iconv-lite": { - "version": "0.6.3", - "bundled": true, - "optional": true, - "peer": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "ignore-walk": { - "version": "3.0.4", - "bundled": true, - "peer": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "peer": true - }, - "indent-string": { - "version": "4.0.0", - "bundled": true, - "peer": true - }, - "infer-owner": { - "version": "1.0.4", - "bundled": true, - "peer": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "peer": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true, - "peer": true - }, - "ini": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "init-package-json": { - "version": "2.0.5", - "bundled": true, - "peer": true, - "requires": { - "npm-package-arg": "^8.1.5", - "promzard": "^0.3.0", - "read": "~1.0.1", - "read-package-json": "^4.1.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^3.0.0" - } - }, - "ip": { - "version": "1.1.5", - "bundled": true, - "peer": true - }, - "ip-regex": { - "version": "4.3.0", - "bundled": true, - "peer": true - }, - "is-cidr": { - "version": "4.0.2", - "bundled": true, - "peer": true, - "requires": { - "cidr-regex": "^3.1.1" - } - }, - "is-core-module": { - "version": "2.7.0", - "bundled": true, - "peer": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "is-lambda": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "peer": true - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "peer": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "bundled": true, - "peer": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "peer": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "bundled": true, - "peer": true - }, - "json-stringify-nice": { - "version": "1.1.4", - "bundled": true, - "peer": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "peer": true - }, - "jsonparse": { - "version": "1.3.1", - "bundled": true, - "peer": true - }, - "jsprim": { - "version": "1.4.1", - "bundled": true, - "peer": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "just-diff": { - "version": "3.1.1", - "bundled": true, - "peer": true - }, - "just-diff-apply": { - "version": "3.0.0", - "bundled": true, - "peer": true - }, - "libnpmaccess": { - "version": "4.0.3", - "bundled": true, - "peer": true, - "requires": { - "aproba": "^2.0.0", - "minipass": "^3.1.1", - "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^11.0.0" - } - }, - "libnpmdiff": { - "version": "2.0.4", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/disparity-colors": "^1.0.1", - "@npmcli/installed-package-contents": "^1.0.7", - "binary-extensions": "^2.2.0", - "diff": "^5.0.0", - "minimatch": "^3.0.4", - "npm-package-arg": "^8.1.4", - "pacote": "^11.3.4", - "tar": "^6.1.0" - } - }, - "libnpmexec": { - "version": "2.0.1", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/arborist": "^2.3.0", - "@npmcli/ci-detect": "^1.3.0", - "@npmcli/run-script": "^1.8.4", - "chalk": "^4.1.0", - "mkdirp-infer-owner": "^2.0.0", - "npm-package-arg": "^8.1.2", - "pacote": "^11.3.1", - "proc-log": "^1.0.0", - "read": "^1.0.7", - "read-package-json-fast": "^2.0.2", - "walk-up-path": "^1.0.0" - } - }, - "libnpmfund": { - "version": "1.1.0", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/arborist": "^2.5.0" - } - }, - "libnpmhook": { - "version": "6.0.3", - "bundled": true, - "peer": true, - "requires": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" - } - }, - "libnpmorg": { - "version": "2.0.3", - "bundled": true, - "peer": true, - "requires": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" - } - }, - "libnpmpack": { - "version": "2.0.1", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/run-script": "^1.8.3", - "npm-package-arg": "^8.1.0", - "pacote": "^11.2.6" - } - }, - "libnpmpublish": { - "version": "4.0.2", - "bundled": true, - "peer": true, - "requires": { - "normalize-package-data": "^3.0.2", - "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^11.0.0", - "semver": "^7.1.3", - "ssri": "^8.0.1" - } - }, - "libnpmsearch": { - "version": "3.1.2", - "bundled": true, - "peer": true, - "requires": { - "npm-registry-fetch": "^11.0.0" - } - }, - "libnpmteam": { - "version": "2.0.4", - "bundled": true, - "peer": true, - "requires": { - "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" - } - }, - "libnpmversion": { - "version": "1.2.1", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/git": "^2.0.7", - "@npmcli/run-script": "^1.8.4", - "json-parse-even-better-errors": "^2.3.1", - "semver": "^7.3.5", - "stringify-package": "^1.0.1" - } - }, - "lru-cache": { - "version": "6.0.0", - "bundled": true, - "peer": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "make-fetch-happen": { - "version": "9.1.0", - "bundled": true, - "peer": true, - "requires": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - } - }, - "mime-db": { - "version": "1.49.0", - "bundled": true, - "peer": true - }, - "mime-types": { - "version": "2.1.32", - "bundled": true, - "peer": true, - "requires": { - "mime-db": "1.49.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minipass": { - "version": "3.1.5", - "bundled": true, - "peer": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "minipass-collect": { - "version": "1.0.2", - "bundled": true, - "peer": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-fetch": { - "version": "1.4.1", - "bundled": true, - "peer": true, - "requires": { - "encoding": "^0.1.12", - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - } - }, - "minipass-flush": { - "version": "1.0.5", - "bundled": true, - "peer": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-json-stream": { - "version": "1.0.1", - "bundled": true, - "peer": true, - "requires": { - "jsonparse": "^1.3.1", - "minipass": "^3.0.0" - } - }, - "minipass-pipeline": { - "version": "1.2.4", - "bundled": true, - "peer": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-sized": { - "version": "1.0.3", - "bundled": true, - "peer": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "bundled": true, - "peer": true, - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "bundled": true, - "peer": true - }, - "mkdirp-infer-owner": { - "version": "2.0.0", - "bundled": true, - "peer": true, - "requires": { - "chownr": "^2.0.0", - "infer-owner": "^1.0.4", - "mkdirp": "^1.0.3" - } - }, - "ms": { - "version": "2.1.3", - "bundled": true, - "peer": true - }, - "mute-stream": { - "version": "0.0.8", - "bundled": true, - "peer": true - }, - "negotiator": { - "version": "0.6.2", - "bundled": true, - "peer": true - }, - "node-gyp": { - "version": "7.1.2", - "bundled": true, - "peer": true, - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.3", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", - "which": "^2.0.2" - }, - "dependencies": { - "aproba": { - "version": "1.2.0", - "bundled": true, - "peer": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "peer": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "peer": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "peer": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "peer": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - } - } - }, - "nopt": { - "version": "5.0.0", - "bundled": true, - "peer": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-package-data": { - "version": "3.0.3", - "bundled": true, - "peer": true, - "requires": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-audit-report": { - "version": "2.1.5", - "bundled": true, - "peer": true, - "requires": { - "chalk": "^4.0.0" - } - }, - "npm-bundled": { - "version": "1.1.2", - "bundled": true, - "peer": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-install-checks": { - "version": "4.0.0", - "bundled": true, - "peer": true, - "requires": { - "semver": "^7.1.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "npm-package-arg": { - "version": "8.1.5", - "bundled": true, - "peer": true, - "requires": { - "hosted-git-info": "^4.0.1", - "semver": "^7.3.4", - "validate-npm-package-name": "^3.0.0" - } - }, - "npm-packlist": { - "version": "2.2.2", - "bundled": true, - "peer": true, - "requires": { - "glob": "^7.1.6", - "ignore-walk": "^3.0.3", - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-pick-manifest": { - "version": "6.1.1", - "bundled": true, - "peer": true, - "requires": { - "npm-install-checks": "^4.0.0", - "npm-normalize-package-bin": "^1.0.1", - "npm-package-arg": "^8.1.2", - "semver": "^7.3.4" - } - }, - "npm-profile": { - "version": "5.0.4", - "bundled": true, - "peer": true, - "requires": { - "npm-registry-fetch": "^11.0.0" - } - }, - "npm-registry-fetch": { - "version": "11.0.0", - "bundled": true, - "peer": true, - "requires": { - "make-fetch-happen": "^9.0.1", - "minipass": "^3.1.3", - "minipass-fetch": "^1.3.0", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.0.0", - "npm-package-arg": "^8.0.0" - } - }, - "npm-user-validate": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "npmlog": { - "version": "5.0.1", - "bundled": true, - "peer": true, - "requires": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - }, - "dependencies": { - "are-we-there-yet": { - "version": "2.0.0", - "bundled": true, - "peer": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - } - } - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "oauth-sign": { - "version": "0.9.0", - "bundled": true, - "peer": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "peer": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "peer": true, - "requires": { - "wrappy": "1" - } - }, - "opener": { - "version": "1.5.2", - "bundled": true, - "peer": true - }, - "p-map": { - "version": "4.0.0", - "bundled": true, - "peer": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "pacote": { - "version": "11.3.5", - "bundled": true, - "peer": true, - "requires": { - "@npmcli/git": "^2.1.0", - "@npmcli/installed-package-contents": "^1.0.6", - "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^1.8.2", - "cacache": "^15.0.5", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "infer-owner": "^1.0.4", - "minipass": "^3.1.3", - "mkdirp": "^1.0.3", - "npm-package-arg": "^8.0.1", - "npm-packlist": "^2.1.4", - "npm-pick-manifest": "^6.0.0", - "npm-registry-fetch": "^11.0.0", - "promise-retry": "^2.0.1", - "read-package-json-fast": "^2.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.1.0" - } - }, - "parse-conflict-json": { - "version": "1.1.1", - "bundled": true, - "peer": true, - "requires": { - "json-parse-even-better-errors": "^2.3.0", - "just-diff": "^3.0.1", - "just-diff-apply": "^3.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "performance-now": { - "version": "2.1.0", - "bundled": true, - "peer": true - }, - "proc-log": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "promise-all-reject-late": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "promise-call-limit": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "promise-inflight": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "promise-retry": { - "version": "2.0.1", - "bundled": true, - "peer": true, - "requires": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - } - }, - "promzard": { - "version": "0.3.0", - "bundled": true, - "peer": true, - "requires": { - "read": "1" - } - }, - "psl": { - "version": "1.8.0", - "bundled": true, - "peer": true - }, - "punycode": { - "version": "2.1.1", - "bundled": true, - "peer": true - }, - "qrcode-terminal": { - "version": "0.12.0", - "bundled": true, - "peer": true - }, - "qs": { - "version": "6.5.2", - "bundled": true, - "peer": true - }, - "read": { - "version": "1.0.7", - "bundled": true, - "peer": true, - "requires": { - "mute-stream": "~0.0.4" - } - }, - "read-cmd-shim": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "read-package-json": { - "version": "4.1.1", - "bundled": true, - "peer": true, - "requires": { - "glob": "^7.1.1", - "json-parse-even-better-errors": "^2.3.0", - "normalize-package-data": "^3.0.0", - "npm-normalize-package-bin": "^1.0.0" - } - }, - "read-package-json-fast": { - "version": "2.0.3", - "bundled": true, - "peer": true, - "requires": { - "json-parse-even-better-errors": "^2.3.0", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "readable-stream": { - "version": "3.6.0", - "bundled": true, - "peer": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdir-scoped-modules": { - "version": "1.1.0", - "bundled": true, - "peer": true, - "requires": { - "debuglog": "^1.0.1", - "dezalgo": "^1.0.0", - "graceful-fs": "^4.1.2", - "once": "^1.3.0" - } - }, - "request": { - "version": "2.88.2", - "bundled": true, - "peer": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "bundled": true, - "peer": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "tough-cookie": { - "version": "2.5.0", - "bundled": true, - "peer": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } - } - }, - "retry": { - "version": "0.12.0", - "bundled": true, - "peer": true - }, - "rimraf": { - "version": "3.0.2", - "bundled": true, - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.2.1", - "bundled": true, - "peer": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "peer": true - }, - "semver": { - "version": "7.3.5", - "bundled": true, - "peer": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "peer": true - }, - "signal-exit": { - "version": "3.0.3", - "bundled": true, - "peer": true - }, - "smart-buffer": { - "version": "4.2.0", - "bundled": true, - "peer": true - }, - "socks": { - "version": "2.6.1", - "bundled": true, - "peer": true, - "requires": { - "ip": "^1.1.5", - "smart-buffer": "^4.1.0" - } - }, - "socks-proxy-agent": { - "version": "6.1.0", - "bundled": true, - "peer": true, - "requires": { - "agent-base": "^6.0.2", - "debug": "^4.3.1", - "socks": "^2.6.1" - } - }, - "spdx-correct": { - "version": "3.1.1", - "bundled": true, - "peer": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "bundled": true, - "peer": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "bundled": true, - "peer": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.10", - "bundled": true, - "peer": true - }, - "sshpk": { - "version": "1.16.1", - "bundled": true, - "peer": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "ssri": { - "version": "8.0.1", - "bundled": true, - "peer": true, - "requires": { - "minipass": "^3.1.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "bundled": true, - "peer": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "peer": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "peer": true - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "peer": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "stringify-package": { - "version": "1.0.1", - "bundled": true, - "peer": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "peer": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "bundled": true, - "peer": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "tar": { - "version": "6.1.11", - "bundled": true, - "peer": true, - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, - "text-table": { - "version": "0.2.0", - "bundled": true, - "peer": true - }, - "tiny-relative-date": { - "version": "1.3.0", - "bundled": true, - "peer": true - }, - "treeverse": { - "version": "1.0.4", - "bundled": true, - "peer": true - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "peer": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "peer": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "bundled": true, - "peer": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "unique-filename": { - "version": "1.1.1", - "bundled": true, - "peer": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "bundled": true, - "peer": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "uri-js": { - "version": "4.4.1", - "bundled": true, - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "peer": true - }, - "uuid": { - "version": "3.4.0", - "bundled": true, - "peer": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "bundled": true, - "peer": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "validate-npm-package-name": { - "version": "3.0.0", - "bundled": true, - "peer": true, - "requires": { - "builtins": "^1.0.3" - } - }, - "verror": { - "version": "1.10.0", - "bundled": true, - "peer": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "walk-up-path": { - "version": "1.0.0", - "bundled": true, - "peer": true - }, - "wcwidth": { - "version": "1.0.1", - "bundled": true, - "peer": true, - "requires": { - "defaults": "^1.0.3" - } - }, - "which": { - "version": "2.0.2", - "bundled": true, - "peer": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "peer": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "peer": true - }, - "write-file-atomic": { - "version": "3.0.3", - "bundled": true, - "peer": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "yallist": { - "version": "4.0.0", - "bundled": true, - "peer": true - } - } - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "requires": { - "path-key": "^3.0.0" - } - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "peer": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", - "peer": true - }, - "p-filter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", - "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", - "requires": { - "p-map": "^2.0.0" - } - }, - "p-is-promise": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "peer": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "peer": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "peer": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==" - }, - "p-reduce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz", - "integrity": "sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw==" - }, - "p-retry": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.0.tgz", - "integrity": "sha512-SAHbQEwg3X5DRNaLmWjT+DlGc93ba5i+aP3QLfVNDncQEQO4xjbYW4N/lcVTSuP0aJietGfx2t94dJLzfBMpXw==", - "requires": { - "@types/retry": "^0.12.0", - "retry": "^0.13.1" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "peer": true - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "peer": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "peer": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "peer": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "peer": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - }, - "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "peer": true - }, - "pkg-conf": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", - "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", - "peer": true, - "requires": { - "find-up": "^2.0.0", - "load-json-file": "^4.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "peer": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "peer": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "peer": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "peer": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "peer": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "peer": true - } - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "peer": true - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "peer": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "peer": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - }, - "quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "peer": true - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "peer": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "peer": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "peer": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "peer": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "peer": true - }, - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "peer": true - } - } - }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "peer": true, - "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "peer": true - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "peer": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "peer": true, - "requires": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - } - }, - "redeyed": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", - "integrity": "sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs=", - "peer": true, - "requires": { - "esprima": "~4.0.0" - } - }, - "registry-auth-token": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", - "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", - "peer": true, - "requires": { - "rc": "^1.2.8" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "peer": true - }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "peer": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "peer": true - }, - "retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==" - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "peer": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "peer": true - }, - "semantic-release": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-18.0.0.tgz", - "integrity": "sha512-/Szyhq5DTZCYry/aZqpBbK/kqv10ydn6oiiaYOXtPgDbAIkqidZcQOm+mfYFJ0sBTUaOYCKMlcPMgJycP7jDYQ==", - "peer": true, - "requires": { - "@semantic-release/commit-analyzer": "^9.0.0", - "@semantic-release/error": "^3.0.0", - "@semantic-release/github": "^8.0.0", - "@semantic-release/npm": "^8.0.0", - "@semantic-release/release-notes-generator": "^10.0.0", - "aggregate-error": "^3.0.0", - "cosmiconfig": "^7.0.0", - "debug": "^4.0.0", - "env-ci": "^5.0.0", - "execa": "^5.0.0", - "figures": "^3.0.0", - "find-versions": "^4.0.0", - "get-stream": "^6.0.0", - "git-log-parser": "^1.2.0", - "hook-std": "^2.0.0", - "hosted-git-info": "^4.0.0", - "lodash": "^4.17.21", - "marked": "^2.0.0", - "marked-terminal": "^4.1.1", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "p-reduce": "^2.0.0", - "read-pkg-up": "^7.0.0", - "resolve-from": "^5.0.0", - "semver": "^7.3.2", - "semver-diff": "^3.1.1", - "signale": "^1.2.1", - "yargs": "^16.2.0" - }, - "dependencies": { - "@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", - "peer": true - }, - "execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "peer": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "peer": true - }, - "human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "peer": true - } - } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "peer": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "peer": true, - "requires": { - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "peer": true - } - } - }, - "semver-regex": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", - "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", - "peer": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" - }, - "signale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/signale/-/signale-1.4.0.tgz", - "integrity": "sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==", - "peer": true, - "requires": { - "chalk": "^2.3.2", - "figures": "^2.0.0", - "pkg-conf": "^2.1.0" - }, - "dependencies": { - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "peer": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - } - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "peer": true - }, - "spawn-error-forwarder": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", - "integrity": "sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk=", - "peer": true - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "peer": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "peer": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "peer": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", - "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", - "peer": true - }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "peer": true, - "requires": { - "through": "2" - } - }, - "split2": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", - "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", - "peer": true, - "requires": { - "readable-stream": "^3.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "peer": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", - "peer": true, - "requires": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "peer": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "peer": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "peer": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "peer": true - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" - }, - "strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "peer": true, - "requires": { - "min-indent": "^1.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "peer": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "peer": true, - "requires": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "peer": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "peer": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "temp-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", - "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", - "peer": true - }, - "tempy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tempy/-/tempy-1.0.1.tgz", - "integrity": "sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==", - "peer": true, - "requires": { - "del": "^6.0.0", - "is-stream": "^2.0.0", - "temp-dir": "^2.0.0", - "type-fest": "^0.16.0", - "unique-string": "^2.0.0" - }, - "dependencies": { - "type-fest": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", - "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", - "peer": true - } - } - }, - "text-extensions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", - "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", - "peer": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "peer": true - }, - "through2": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", - "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", - "peer": true, - "requires": { - "readable-stream": "3" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "peer": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", - "peer": true - }, - "trim-newlines": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", - "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", - "peer": true - }, - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "peer": true - }, - "uglify-js": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", - "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==", - "optional": true, - "peer": true - }, - "unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "peer": true, - "requires": { - "crypto-random-string": "^2.0.0" - } - }, - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" - }, - "url-join": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "peer": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "peer": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "peer": true - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "peer": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "peer": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "peer": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "peer": true - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "peer": true - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "peer": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "peer": true - }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "peer": true - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "peer": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "peer": true } } } diff --git a/package.json b/package.json index 6ef9f5b0..a73fb16d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { - "dependencies": { - "@semantic-release/changelog": "^6.0.1", + "devDependencies": { + "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^8.0.5" + "@semantic-release/github": "^8.0.7", + "@semantic-release/release-notes-generator": "^10.0.3" } } diff --git a/pom.xml b/pom.xml index 0a0faf0c..2e800e8a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,71 +1,52 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - - scc + security-and-compliance-center-sdk - - IBM Cloud Security & Compliance Center Java SDK + IBM Cloud Security and Compliance Center Service Java SDK - - Java Client Library to access the IBM Cloud Security & Compliance Center + Java Client Library to access the IBM Cloud Security and Compliance Center APIs - - https://github.ibm.com/CloudEngineering/java-sdk-template + https://github.com/IBM/security-and-compliance-center-api-java-sdk com.ibm.cloud - 3.0.0 + 2.0.0 pom UTF-8 - - 9.13.3 + 9.17.4 - - scc-java-sdk + security-and-compliance-center-java-sdk - 7.1.0 - 4.9.0 - 3.0.0-M3 - 0.8.5 - 3.0.0-M1 - 1.6.8 - 1.6 - 3.1.0 - 3.2.2 - 3.2.0 - 3.1.1 - 3.8.1 - 3.7.1 - 3.1.0 - 3.0.0 - 3.0.0-M4 - 1.4 - 2.0.5 - 3.2.4 - 1.7.28 + 7.4.0 + 4.10.0 + 3.0.0-M7 + 0.8.8 + 3.0.0 + 1.6.13 + 3.0.1 + 3.2.1 + 3.3.0 + 3.2.2 + 3.4.1 + 3.10.1 + 3.12.1 + 3.2.0 + 8.41 + 3.4.1 + 3.0.0-M7 + 3.0.0 + 2.0.6 + 4.13.2 - modules/common - - - modules/configuration-governance - - + modules/security-and-compliance-center-api modules/coverage-reports - - - - modules/examples @@ -79,29 +60,18 @@ IBM Cloud - - scm:git:https://github.com/IBM/scc-java-sdk - scm:git:https://github.com/IBM/scc-java-sdk - https://github.com/IBM/scc-java-sdk/tree/main + scm:git:https://github.com/IBM/security-and-compliance-center-api-java-sdk + scm:git:https://github.com/IBM/security-and-compliance-center-api-java-sdk + https://github.com/IBM/security-and-compliance-center-api-java-sdk/tree/master - Github - https://github.com/IBM/scc-java-sdk/issues + https://github.com/IBM/security-and-compliance-center-api-java-sdk/issues - - - Travis-CI - https://travis.com/IBM/scc-java-sdk/ - - - + @@ -111,17 +81,13 @@ sdk-core ${sdk-core-version} - - - - common + security-and-compliance-center-sdk-common ${project.groupId} ${project.version} - - common + security-and-compliance-center-sdk-common ${project.groupId} ${project.version} test-jar @@ -136,6 +102,12 @@ ${testng-version} test + + junit + junit + ${junit-version} + test + com.squareup.okhttp3 okhttp @@ -148,18 +120,10 @@ test - org.powermock - powermock-api-mockito2 - ${powermock-version} - test - - - org.powermock - powermock-module-testng - ${powermock-version} - test + org.slf4j + slf4j-api + ${slf4j-version} - org.slf4j slf4j-jdk14 @@ -351,8 +315,8 @@ - + org.apache.maven.plugins maven-deploy-plugin @@ -408,12 +372,12 @@ maven-checkstyle-plugin - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-version} - - ${skip.unit.tests} - + org.apache.maven.plugins + maven-surefire-plugin + ${surefire-version} + + ${skip.unit.tests} + org.apache.maven.plugins @@ -469,18 +433,13 @@ - central - - - - ossrh From a80ecca703a5efc039c1ca996261f57280970948 Mon Sep 17 00:00:00 2001 From: Pavan K Manda Date: Tue, 29 Aug 2023 10:16:21 +0530 Subject: [PATCH 5/5] commit_3: modify generated code Signed-off-by: Pavan K Manda --- .bumpversion.cfg | 10 +- .github/workflows/main.yaml | 37 +- README.md | 6 +- build/publishCodeCoverage.sh | 4 +- build/testScript.sh | 4 +- ...ecurityAndComplianceCenterApiExamples.java | 1249 +++++++++-------- .../v3/SecurityAndComplianceCenterApi.java | 334 +++-- .../v3/model/ControlSpecifications.java | 26 +- .../v3/model/CreateAttachmentOptions.java | 57 +- .../CreateProviderTypeInstanceOptions.java | 10 +- .../v3/model/CreateRuleOptions.java | 46 +- .../v3/model/DeleteCustomProfileOptions.java | 34 +- .../model/DeleteProfileAttachmentOptions.java | 34 +- .../v3/model/GetProfileAttachmentOptions.java | 34 +- .../v3/model/GetProfileOptions.java | 34 +- .../v3/model/ListAttachmentsOptions.java | 34 +- .../model/ListReportEvaluationsOptions.java | 52 + .../v3/model/ProfileCollection.java | 2 +- .../model/ProviderTypeInstanceAttributes.java | 27 + .../v3/model/ProviderTypeInstanceItem.java | 5 +- .../ReplaceProfileAttachmentOptions.java | 58 +- .../v3/model/ReplaceProfileOptions.java | 34 +- .../v3/model/ReplaceRuleOptions.java | 46 +- .../v3/model/RequiredConfig.java | 4 +- ...dConfigAnd.java => RequiredConfigAnd.java} | 34 +- .../v3/model/RequiredConfigBase.java | 237 ++++ .../v3/model/RequiredConfigItems.java | 12 +- ...edConfigItemsRequiredConfigAndDepth1.java} | 42 +- ...redConfigItemsRequiredConfigOrDepth1.java} | 40 +- ...redConfigOr.java => RequiredConfigOr.java} | 32 +- .../v3/model/Target.java | 140 +- .../v3/model/TargetPrototype.java | 183 +++ .../UpdateProviderTypeInstanceOptions.java | 60 +- .../UpdateProviderTypeInstanceRequest.java | 55 + ...nstancePrototypeForPatchingAttributes.java | 91 ++ ...rTypeInstancePrototypeForPatchingName.java | 89 ++ .../v3/SecurityAndComplianceCenterApiIT.java | 264 ++-- .../SecurityAndComplianceCenterApiTest.java | 316 +++-- .../v3/model/ControlLibraryTest.java | 4 +- .../v3/model/ControlSpecificationsTest.java | 6 +- .../v3/model/ControlsInControlLibTest.java | 4 +- .../v3/model/CreateAttachmentOptionsTest.java | 2 - ...CreateCustomControlLibraryOptionsTest.java | 4 +- .../v3/model/CreateRuleOptionsTest.java | 40 +- .../model/DeleteCustomProfileOptionsTest.java | 4 +- .../DeleteProfileAttachmentOptionsTest.java | 4 +- .../v3/model/EventNotificationsTest.java | 12 +- .../GetProfileAttachmentOptionsTest.java | 4 +- .../v3/model/GetProfileOptionsTest.java | 4 +- .../v3/model/ListAttachmentsOptionsTest.java | 4 +- .../ListReportEvaluationsOptionsTest.java | 4 + ...> ProviderTypeInstanceAttributesTest.java} | 20 +- .../model/ProviderTypeInstanceItemTest.java | 1 + .../ProviderTypeInstancesResponseTest.java | 1 + .../ProviderTypesInstancesResponseTest.java | 1 + ...eplaceCustomControlLibraryOptionsTest.java | 4 +- .../ReplaceProfileAttachmentOptionsTest.java | 2 - .../v3/model/ReplaceProfileOptionsTest.java | 3 +- .../v3/model/ReplaceRuleOptionsTest.java | 40 +- .../v3/model/RequiredConfigAndTest.java | 67 + .../v3/model/RequiredConfigBaseTest.java | 60 + ...onfigItemsRequiredConfigAndDepth1Test.java | 59 + ...ConfigItemsRequiredConfigOrDepth1Test.java | 59 + .../v3/model/RequiredConfigItemsTest.java | 1 + .../v3/model/RequiredConfigOrTest.java | 67 + .../RequiredConfigRequiredConfigAndTest.java | 53 - .../RequiredConfigRequiredConfigOrTest.java | 53 - .../v3/model/RequiredConfigTest.java | 3 +- .../v3/model/RuleTest.java | 5 +- .../v3/model/RulesPageBaseTest.java | 5 +- .../v3/model/SettingsTest.java | 8 +- .../v3/model/TargetPrototypeTest.java | 66 + .../v3/model/TargetTest.java | 38 +- ...UpdateProviderTypeInstanceOptionsTest.java | 12 +- ...ncePrototypeForPatchingAttributesTest.java | 51 + ...eInstancePrototypeForPatchingNameTest.java | 51 + ...pdateProviderTypeInstanceRequestTest.java} | 21 +- .../v3/model/UpdateSettingsOptionsTest.java | 8 +- 78 files changed, 2739 insertions(+), 1892 deletions(-) create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceAttributes.java rename modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/{RequiredConfigRequiredConfigAnd.java => RequiredConfigAnd.java} (67%) create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBase.java rename modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/{RequiredConfigItemsRequiredConfigAnd.java => RequiredConfigItemsRequiredConfigAndDepth1.java} (58%) rename modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/{RequiredConfigItemsRequiredConfigOr.java => RequiredConfigItemsRequiredConfigOrDepth1.java} (60%) rename modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/{RequiredConfigRequiredConfigOr.java => RequiredConfigOr.java} (68%) create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototype.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequest.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.java create mode 100644 modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.java rename modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/{RequiredConfigItemsRequiredConfigOrTest.java => ProviderTypeInstanceAttributesTest.java} (56%) create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigAndTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBaseTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndDepth1Test.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrDepth1Test.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigOrTest.java delete mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java delete mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototypeTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesTest.java create mode 100644 modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameTest.java rename modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/{RequiredConfigItemsRequiredConfigAndTest.java => UpdateProviderTypeInstanceRequestTest.java} (55%) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b34fb7ef..a8a3d7d0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.0.0 +current_version = 4.0.0 commit = True message = Update version {current_version} -> {new_version} @@ -19,10 +19,6 @@ replace = {new_version} search = {current_version} replace = {new_version} -[bumpversion:file:modules/configuration-governance/pom.xml] +[bumpversion:file:modules/security-and-compliance-center-api/pom.xml] search = {current_version} -replace = {new_version} - -[bumpversion:file:modules/examples/pom.xml] -search = {current_version} -replace = {new_version} +replace = {new_version} \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ccb1704a..a84c6ae3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,5 +1,9 @@ name: CI/CD Pipeline -on: [push, pull_request, workflow_dispatch] +on: + push: + branches: [main] + pull_request: + workflow_dispatch: jobs: verify: @@ -46,9 +50,8 @@ jobs: - name: running integration tests env: - ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }} - CONFIGURATION_GOVERNANCE_ENV: ${{ secrets.CONFIGURATION_GOVERNANCE_ENV }} - RESOURCE_GROUP_ID: ${{ secrets.RESOURCE_GROUP_ID }} + SCC_ENV: ${{ secrets.SCC_ENV }} + SECURITY_AND_COMPLIANCE_CENTER_API_IAM_PROFILE_ID: ${{ secrets.SCC_IAM_PROFILE_ID }} run: build/testScript.sh release: @@ -62,7 +65,12 @@ jobs: - name: setting up nodejs uses: actions/setup-node@v2 with: - node-version: '16' + node-version: '18' + + - name: setup python + uses: actions/setup-python@v2 + with: + python-version: 3.8 - name: releasing using semantic-release env: @@ -72,13 +80,13 @@ jobs: GIT_COMMITTER_NAME: sccdeveloper GIT_COMMITTER_EMAIL: scccomm@in.ibm.com run: | - sudo apt-get update - sudo apt-get install python pip install --user bumpversion npm install @semantic-release/changelog npm install @semantic-release/exec npm install @semantic-release/git npm install @semantic-release/github + rm -rf package.json + rm -rf package-lock.json npx semantic-release publish: @@ -134,10 +142,17 @@ jobs: run: build/prepareJavadoc.sh - name: deploying javadocs to gh-pages - uses: crazy-max/ghaction-github-pages@v1 - with: - target_branch: gh-pages - build_dir: javadocs + run: | + git config --global user.email "scccomm@in.ibm.com" + git config --global user.name "sccdeveloper" + git config --global user.password "${{ secrets.ADMIN_TOKEN }}" + cd v4/dist + git init + git add . + git commit -m "Deploy to GitHub pages" + git branch -m gh-pages + git remote add origin https://github.com/IBM/scc-java-sdk + git push -f origin gh-pages env: GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }} GIT_AUTHOR_NAME: sccdeveloper diff --git a/README.md b/README.md index 80de59b8..bfac38f7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Maven Central](https://img.shields.io/maven-central/v/com.ibm.cloud/scc.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.ibm.cloud%22%20AND%20a:%22scc%22) # IBM Cloud Security & Compliance Center Java SDK Version 3.0.0 -Java client library to interact with various [IBM Cloud Security & Compliance Center](https://cloud.ibm.com/docs?tab=api-docs&category=platform_services%2Csecurity). +Java client library to interact with various [IBM Cloud Security & Compliance Center](https://cloud.ibm.com/apidocs/security-compliance?code=java). Disclaimer: this SDK is being released initially as a **pre-release** version. Changes might occur which impact applications that use this SDK. @@ -46,7 +46,7 @@ The IBM Cloud Security & Compliance Center Java SDK allows developers to program Service Name | Imported Class Name --- | --- -[ConfigurationGovernanceApi](https://cloud.ibm.com/apidocs/security-compliance/config) | ConfigurationGovernanceApi:3.0.0 +[Security and Compliance Center](https://cloud.ibm.com/apidocs/security-compliance) | SecurityAndComplianceCenterApi:3.0.0 ## Prerequisites @@ -108,4 +108,4 @@ See [CONTRIBUTING](CONTRIBUTING.md). ## License The IBM Cloud MySDK Java SDK is released under the Apache 2.0 license. -The license's full text can be found in [LICENSE](LICENSE). +The license's full text can be found in [LICENSE](LICENSE). \ No newline at end of file diff --git a/build/publishCodeCoverage.sh b/build/publishCodeCoverage.sh index a04c28ee..c0ccfacf 100755 --- a/build/publishCodeCoverage.sh +++ b/build/publishCodeCoverage.sh @@ -6,8 +6,8 @@ printf ">>>>> Publishing code coverage info\n" JACOCO_SOURCE_PATH=modules/common/src/main/java ./cc-test-reporter format-coverage modules/common/target/site/jacoco/jacoco.xml -d -o common.json -t jacoco -JACOCO_SOURCE_PATH=modules/configuration-governance/src/main/java ./cc-test-reporter format-coverage modules/configuration-governance/target/site/jacoco/jacoco.xml -d -o configuration-governance.json -t jacoco +JACOCO_SOURCE_PATH=modules/security-and-compliance-center-api/src/main/java ./cc-test-reporter format-coverage modules/security-and-compliance-center-api/target/site/jacoco/jacoco.xml -d -o security-and-compliance-center-api.json -t jacoco -./cc-test-reporter sum-coverage common.json configuration-governance.json -o coverage.json -d +./cc-test-reporter sum-coverage common.json security-and-compliance-center-api.json -o coverage.json -d ./cc-test-reporter upload-coverage --input coverage.json diff --git a/build/testScript.sh b/build/testScript.sh index 8c62e7b5..6c9a6221 100755 --- a/build/testScript.sh +++ b/build/testScript.sh @@ -1,7 +1,5 @@ #!/bin/bash set -euo pipefail - -curl https://us-south.functions.appdomain.cloud/api/v1/web/e6b54af6-ab44-4149-a8e4-e906dcc58136/default/secadvstg-location-shift.json -echo "${CONFIGURATION_GOVERNANCE_ENV}" | base64 -d >> configuration_governance_v1.env +echo "${SCC_ENV}" | base64 -d >> security_and_compliance_center_api_v3.env mvn clean verify diff --git a/examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java b/examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java index 7f74754d..38fe6e49 100644 --- a/examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java +++ b/examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java @@ -103,17 +103,18 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportTags; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportsPager; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigBase; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RuleInfo; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RulesPageBase; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Scan; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Settings; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetPrototype; import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName; import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; import java.io.InputStream; import java.util.ArrayList; @@ -173,446 +174,252 @@ public static void main(String[] args) throws Exception { String reportIdForReportLink = null; String ruleIdLink = null; String typeForReportLink = null; + String xCorrelationIdLink = null; try { - System.out.println("getSettings() result:"); - // begin-get_settings - GetSettingsOptions getSettingsOptions = new GetSettingsOptions.Builder() - .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") - .build(); - - Response response = securityAndComplianceCenterApiService.getSettings(getSettingsOptions).execute(); - Settings settings = response.getResult(); - - System.out.println(settings); - // end-get_settings - - eventNotificationsCrnForUpdateSettingsLink = settings.eventNotifications().instanceCrn(); - objectStorageCrnForUpdateSettingsLink = settings.objectStorage().instanceCrn(); - objectStorageBucketForUpdateSettingsLink = settings.objectStorage().bucket(); - objectStorageLocationForUpdateSettingsLink = settings.objectStorage().bucketLocation(); - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("createRule() result:"); - // begin-create_rule - AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() - .name("location") - .operator("string_equals") - .value("us-east") - .build(); - Target targetModel = new Target.Builder() - .serviceName("cloud-object-storage") - .resourceKind("bucket") - .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) - .build(); - RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() - .property("hard_quota") - .operator("num_equals") - .value("${hard_quota}") - .build(); - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() - .description("The Cloud Object Storage rule.") - .and(java.util.Arrays.asList(requiredConfigItemsModel)) - .build(); - Parameter parameterModel = new Parameter.Builder() - .name("hard_quota") - .displayName("The Cloud Object Storage bucket quota.") - .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") - .type("numeric") - .build(); - Import importModel = new Import.Builder() - .parameters(java.util.Arrays.asList(parameterModel)) - .build(); - CreateRuleOptions createRuleOptions = new CreateRuleOptions.Builder() - .description("Example rule") - .target(targetModel) - .requiredConfig(requiredConfigModel) - .version("1.0.0") - .xImport(importModel) - .labels(java.util.Arrays.asList()) - .build(); - - Response response = securityAndComplianceCenterApiService.createRule(createRuleOptions).execute(); - Rule rule = response.getResult(); - - System.out.println(rule); - // end-create_rule - - ruleIdLink = rule.getId(); - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("getRule() result:"); - // begin-get_rule - GetRuleOptions getRuleOptions = new GetRuleOptions.Builder() - .ruleId(ruleIdLink) - .build(); - - Response response = securityAndComplianceCenterApiService.getRule(getRuleOptions).execute(); - Rule rule = response.getResult(); - - System.out.println(rule); - // end-get_rule - - eTagLink = response.getHeaders().values("ETag").get(0); - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("getLatestReports() result:"); - // begin-get_latest_reports - GetLatestReportsOptions getLatestReportsOptions = new GetLatestReportsOptions.Builder() - .sort("profile_name") + System.out.println("getReportViolationsDrift() result:"); + // begin-get_report_violations_drift + GetReportViolationsDriftOptions getReportViolationsDriftOptions = new GetReportViolationsDriftOptions.Builder() + .reportId(reportIdForReportLink) .build(); - Response response = securityAndComplianceCenterApiService.getLatestReports(getLatestReportsOptions).execute(); - ReportLatest reportLatest = response.getResult(); + Response response = securityAndComplianceCenterApiService.getReportViolationsDrift(getReportViolationsDriftOptions).execute(); + ReportViolationsDrift reportViolationsDrift = response.getResult(); - System.out.println(reportLatest); - // end-get_latest_reports + System.out.println(reportViolationsDrift); + // end-get_report_violations_drift - accountIdForReportLink = reportLatest.getReports().get(0).getAccount().getId(); - reportIdForReportLink = reportLatest.getReports().get(0).getId(); - attachmentIdForReportLink = reportLatest.getReports().get(0).getAttachment().getId(); - groupIdForReportLink = reportLatest.getReports().get(0).getGroupId(); - profileIdForReportLink = reportLatest.getReports().get(0).getProfile().getId(); - typeForReportLink = reportLatest.getReports().get(0).getType(); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("updateSettings() result:"); - // begin-update_settings - EventNotifications eventNotificationsModel = new EventNotifications.Builder() - .instanceCrn(eventNotificationsCrnForUpdateSettingsLink) - .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") - .sourceName("compliance") - .build(); - ObjectStorage objectStorageModel = new ObjectStorage.Builder() - .instanceCrn(objectStorageCrnForUpdateSettingsLink) - .bucket(objectStorageBucketForUpdateSettingsLink) - .bucketLocation(objectStorageLocationForUpdateSettingsLink) - .build(); - UpdateSettingsOptions updateSettingsOptions = new UpdateSettingsOptions.Builder() - .eventNotifications(eventNotificationsModel) - .objectStorage(objectStorageModel) - .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + System.out.println("getReportTags() result:"); + // begin-get_report_tags + GetReportTagsOptions getReportTagsOptions = new GetReportTagsOptions.Builder() + .reportId(reportIdForReportLink) .build(); - Response response = securityAndComplianceCenterApiService.updateSettings(updateSettingsOptions).execute(); - Settings settings = response.getResult(); - - System.out.println(settings); - // end-update_settings - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("postTestEvent() result:"); - // begin-post_test_event - PostTestEventOptions postTestEventOptions = new PostTestEventOptions.Builder() - .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") - .build(); + Response response = securityAndComplianceCenterApiService.getReportTags(getReportTagsOptions).execute(); + ReportTags reportTags = response.getResult(); - Response response = securityAndComplianceCenterApiService.postTestEvent(postTestEventOptions).execute(); - TestEvent testEvent = response.getResult(); + System.out.println(reportTags); + // end-get_report_tags - System.out.println(testEvent); - // end-post_test_event + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("createCustomControlLibrary() result:"); - // begin-create_custom_control_library - ParameterInfo parameterInfoModel = new ParameterInfo.Builder() - .parameterName("session_invalidation_in_seconds") - .parameterDisplayName("Sign out due to inactivity in seconds") - .parameterType("numeric") - .build(); - Implementation implementationModel = new Implementation.Builder() - .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") - .assessmentMethod("ibm-cloud-rule") - .assessmentType("automated") - .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") - .parameters(java.util.Arrays.asList(parameterInfoModel)) - .build(); - ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() - .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") - .componentId("iam-identity") - .environment("ibm-cloud") - .controlSpecificationDescription("IBM cloud") - .assessments(java.util.Arrays.asList(implementationModel)) - .build(); - ControlDocs controlDocsModel = new ControlDocs.Builder() - .controlDocsId("sc-7") - .controlDocsType("ibm-cloud") - .build(); - ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() - .controlName("SC-7") - .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") - .controlDescription("Boundary Protection") - .controlCategory("System and Communications Protection") - .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) - .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) - .controlDocs(controlDocsModel) - .controlRequirement(true) - .build(); - CreateCustomControlLibraryOptions createCustomControlLibraryOptions = new CreateCustomControlLibraryOptions.Builder() - .controlLibraryName("IBM Cloud for Financial Services") - .controlLibraryDescription("IBM Cloud for Financial Services") - .controlLibraryType("custom") - .controls(java.util.Arrays.asList(controlsInControlLibModel)) - .versionGroupLabel("33fc7b80-0fa5-4f16-bbba-1f293f660f0d") - .controlLibraryVersion("1.0.0") + System.out.println("listReportResources() result:"); + // begin-list_report_resources + ListReportResourcesOptions listReportResourcesOptions = new ListReportResourcesOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId(xCorrelationIdLink) + .xRequestId("testString") + .id("testString") + .resourceName("testString") + .accountId(accountIdForReportLink) + .componentId("testString") + .status("compliant") + .sort("account_id") + .limit(Long.valueOf("10")) .build(); - Response response = securityAndComplianceCenterApiService.createCustomControlLibrary(createCustomControlLibraryOptions).execute(); - ControlLibrary controlLibrary = response.getResult(); - - System.out.println(controlLibrary); - // end-create_custom_control_library + ReportResourcesPager pager = new ReportResourcesPager(securityAndComplianceCenterApiService, listReportResourcesOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } - controlLibraryIdLink = controlLibrary.id(); + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_report_resources } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listControlLibraries() result:"); - // begin-list_control_libraries - ListControlLibrariesOptions listControlLibrariesOptions = new ListControlLibrariesOptions.Builder() - .xCorrelationId("testString") + System.out.println("listReportEvaluations() result:"); + // begin-list_report_evaluations + ListReportEvaluationsOptions listReportEvaluationsOptions = new ListReportEvaluationsOptions.Builder() + .reportId(reportIdForReportLink) + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") - .limit(Long.valueOf("50")) - .controlLibraryType("custom") + .assessmentId("testString") + .assessmentMethod("testString") + .componentId("testString") + .targetId("testString") + .targetEnv("testString") + .targetName("testString") + .status("failure") + .limit(Long.valueOf("10")) .build(); - ControlLibrariesPager pager = new ControlLibrariesPager(securityAndComplianceCenterApiService, listControlLibrariesOptions); - List allResults = new ArrayList<>(); + ReportEvaluationsPager pager = new ReportEvaluationsPager(securityAndComplianceCenterApiService, listReportEvaluationsOptions); + List allResults = new ArrayList<>(); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults)); - // end-list_control_libraries + // end-list_report_evaluations } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getControlLibrary() result:"); - // begin-get_control_library - GetControlLibraryOptions getControlLibraryOptions = new GetControlLibraryOptions.Builder() - .controlLibrariesId(controlLibraryIdLink) + System.out.println("getReportRule() result:"); + // begin-get_report_rule + GetReportRuleOptions getReportRuleOptions = new GetReportRuleOptions.Builder() + .reportId(reportIdForReportLink) + .ruleId("rule-8d444f8c-fd1d-48de-bcaa-f43732568761") .build(); - Response response = securityAndComplianceCenterApiService.getControlLibrary(getControlLibraryOptions).execute(); - ControlLibrary controlLibrary = response.getResult(); - - System.out.println(controlLibrary); - // end-get_control_library - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("replaceCustomControlLibrary() result:"); - // begin-replace_custom_control_library - ParameterInfo parameterInfoModel = new ParameterInfo.Builder() - .parameterName("session_invalidation_in_seconds") - .parameterDisplayName("Sign out due to inactivity in seconds") - .parameterType("numeric") - .build(); - Implementation implementationModel = new Implementation.Builder() - .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") - .assessmentMethod("ibm-cloud-rule") - .assessmentType("automated") - .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") - .parameters(java.util.Arrays.asList(parameterInfoModel)) - .build(); - ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() - .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") - .responsibility("user") - .componentId("iam-identity") - .environment("ibm-cloud") - .controlSpecificationDescription("IBM cloud") - .assessments(java.util.Arrays.asList(implementationModel)) - .build(); - ControlDocs controlDocsModel = new ControlDocs.Builder() - .controlDocsId("sc-7") - .controlDocsType("ibm-cloud") - .build(); - ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() - .controlName("SC-7") - .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") - .controlDescription("Boundary Protection") - .controlCategory("System and Communications Protection") - .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) - .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) - .controlDocs(controlDocsModel) - .controlRequirement(true) - .build(); - ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions = new ReplaceCustomControlLibraryOptions.Builder() - .controlLibrariesId(controlLibraryIdLink) - .controlLibraryName("IBM Cloud for Financial Services") - .controlLibraryDescription("IBM Cloud for Financial Services") - .controlLibraryType("custom") - .controlLibraryVersion("1.1.0") - .controls(java.util.Arrays.asList(controlsInControlLibModel)) - .build(); + Response response = securityAndComplianceCenterApiService.getReportRule(getReportRuleOptions).execute(); + RuleInfo ruleInfo = response.getResult(); - Response response = securityAndComplianceCenterApiService.replaceCustomControlLibrary(replaceCustomControlLibraryOptions).execute(); - ControlLibrary controlLibrary = response.getResult(); + System.out.println(ruleInfo); + // end-get_report_rule - System.out.println(controlLibrary); - // end-replace_custom_control_library + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("createProfile() result:"); - // begin-create_profile - ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() - .controlLibraryId(controlLibraryIdLink) - .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") - .build(); - DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() - .assessmentType("Automated") - .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") - .parameterName("session_invalidation_in_seconds") - .parameterDefaultValue("120") - .parameterDisplayName("Sign out due to inactivity in seconds") - .parameterType("numeric") - .build(); - CreateProfileOptions createProfileOptions = new CreateProfileOptions.Builder() - .profileName("test_profile1") - .profileDescription("test_description1") - .profileType("custom") - .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) - .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + System.out.println("getReportControls() result:"); + // begin-get_report_controls + GetReportControlsOptions getReportControlsOptions = new GetReportControlsOptions.Builder() + .reportId(reportIdForReportLink) + .status("compliant") .build(); - Response response = securityAndComplianceCenterApiService.createProfile(createProfileOptions).execute(); - Profile profile = response.getResult(); + Response response = securityAndComplianceCenterApiService.getReportControls(getReportControlsOptions).execute(); + ReportControls reportControls = response.getResult(); - System.out.println(profile); - // end-create_profile + System.out.println(reportControls); + // end-get_report_controls - profileIdLink = profile.getId(); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listProfiles() result:"); - // begin-list_profiles - ListProfilesOptions listProfilesOptions = new ListProfilesOptions.Builder() - .xCorrelationId("testString") - .xRequestId("testString") - .limit(Long.valueOf("10")) - .profileType("custom") + System.out.println("getReportEvaluation() result:"); + // begin-get_report_evaluation + GetReportEvaluationOptions getReportEvaluationOptions = new GetReportEvaluationOptions.Builder() + .reportId(reportIdForReportLink) .build(); - ProfilesPager pager = new ProfilesPager(securityAndComplianceCenterApiService, listProfilesOptions); - List allResults = new ArrayList<>(); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - allResults.addAll(nextPage); - } + Response response = securityAndComplianceCenterApiService.getReportEvaluation(getReportEvaluationOptions).execute(); + InputStream inputStream = response.getResult(); - System.out.println(GsonSingleton.getGson().toJson(allResults)); - // end-list_profiles + System.out.println(inputStream); + // end-get_report_evaluation + + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getProfile() result:"); - // begin-get_profile - GetProfileOptions getProfileOptions = new GetProfileOptions.Builder() - .profilesId(profileIdLink) + System.out.println("getReportSummary() result:"); + // begin-get_report_summary + GetReportSummaryOptions getReportSummaryOptions = new GetReportSummaryOptions.Builder() + .reportId(reportIdForReportLink) .build(); - Response response = securityAndComplianceCenterApiService.getProfile(getProfileOptions).execute(); - Profile profile = response.getResult(); + Response response = securityAndComplianceCenterApiService.getReportSummary(getReportSummaryOptions).execute(); + ReportSummary reportSummary = response.getResult(); - System.out.println(profile); - // end-get_profile + System.out.println(reportSummary); + // end-get_report_summary + + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("replaceProfile() result:"); - // begin-replace_profile - ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() - .controlLibraryId(controlLibraryIdLink) - .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") - .build(); - DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() - .assessmentType("Automated") - .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") - .parameterName("session_invalidation_in_seconds") - .parameterDefaultValue("120") - .parameterDisplayName("Sign out due to inactivity in seconds") - .parameterType("numeric") + System.out.println("getReport() result:"); + // begin-get_report + GetReportOptions getReportOptions = new GetReportOptions.Builder() + .reportId(reportIdForReportLink) .build(); - ReplaceProfileOptions replaceProfileOptions = new ReplaceProfileOptions.Builder() - .profilesId(profileIdLink) - .profileName("test_profile1") - .profileDescription("test_description1") - .profileType("custom") - .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) - .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) + + Response response = securityAndComplianceCenterApiService.getReport(getReportOptions).execute(); + Report report = response.getResult(); + + System.out.println(report); + // end-get_report + + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("listReports() result:"); + // begin-list_reports + ListReportsOptions listReportsOptions = new ListReportsOptions.Builder() + .xCorrelationId(xCorrelationIdLink) + .xRequestId("testString") + .attachmentId(attachmentIdForReportLink) + .groupId(groupIdForReportLink) + .profileId(profileIdForReportLink) + .type(typeForReportLink) + .limit(Long.valueOf("10")) + .sort("profile_name") .build(); - Response response = securityAndComplianceCenterApiService.replaceProfile(replaceProfileOptions).execute(); - Profile profile = response.getResult(); + ReportsPager pager = new ReportsPager(securityAndComplianceCenterApiService, listReportsOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } - System.out.println(profile); - // end-replace_profile + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_reports } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listRules() result:"); - // begin-list_rules - ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() - .type("system_defined") + System.out.println("getLatestReports() result:"); + // begin-get_latest_reports + GetLatestReportsOptions getLatestReportsOptions = new GetLatestReportsOptions.Builder() + .sort("profile_name") .build(); - Response response = securityAndComplianceCenterApiService.listRules(listRulesOptions).execute(); - RulesPageBase rulesPageBase = response.getResult(); + Response response = securityAndComplianceCenterApiService.getLatestReports(getLatestReportsOptions).execute(); + ReportLatest reportLatest = response.getResult(); - System.out.println(rulesPageBase); - // end-list_rules + System.out.println(reportLatest); + // end-get_latest_reports + + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); + accountIdForReportLink = reportLatest.getReports().get(0).getAccount().getId(); + reportIdForReportLink = reportLatest.getReports().get(0).getId(); + attachmentIdForReportLink = reportLatest.getReports().get(0).getAttachment().getId(); + groupIdForReportLink = reportLatest.getReports().get(0).getGroupId(); + profileIdForReportLink = reportLatest.getReports().get(0).getProfile().getId(); + typeForReportLink = reportLatest.getReports().get(0).getType(); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); @@ -626,9 +433,8 @@ public static void main(String[] args) throws Exception { .operator("string_equals") .value("us-south") .build(); - Target targetModel = new Target.Builder() + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() .serviceName("cloud-object-storage") - .serviceDisplayName("Cloud Object Storage") .resourceKind("bucket") .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); @@ -637,7 +443,7 @@ public static void main(String[] args) throws Exception { .operator("num_equals") .value("${hard_quota}") .build(); - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() .description("The Cloud Object Storage rule.") .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); @@ -654,9 +460,8 @@ public static void main(String[] args) throws Exception { .ruleId(ruleIdLink) .ifMatch(eTagLink) .description("Example rule") - .target(targetModel) + .target(targetPrototypeModel) .requiredConfig(requiredConfigModel) - .type("user_defined") .version("1.0.1") .xImport(importModel) .labels(java.util.Arrays.asList()) @@ -667,433 +472,618 @@ public static void main(String[] args) throws Exception { System.out.println(rule); // end-replace_rule + + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); + eTagLink = response.getHeaders().values("ETag").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("createAttachment() result:"); - // begin-create_attachment - PropertyItem propertyItemModel = new PropertyItem.Builder() - .name("scope_id") - .value("cg3335893hh1428692d6747cf300yeb5") + System.out.println("createRule() result:"); + // begin-create_rule + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("location") + .operator("string_equals") + .value("us-east") .build(); - MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() - .environment("ibm-cloud") - .xProperties(java.util.Arrays.asList(propertyItemModel)) + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() + .serviceName("cloud-object-storage") + .resourceKind("bucket") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); - FailedControls failedControlsModel = new FailedControls.Builder() - .thresholdLimit(Long.valueOf("15")) - .failedControlIds(java.util.Arrays.asList()) + RequiredConfigItemsRequiredConfigBase requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigBase.Builder() + .property("hard_quota") + .operator("num_equals") + .value("${hard_quota}") .build(); - AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() - .enabled(false) - .controls(failedControlsModel) + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() + .description("The Cloud Object Storage rule.") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); - AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() - .assessmentType("Automated") - .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + Parameter parameterModel = new Parameter.Builder() + .name("hard_quota") + .displayName("The Cloud Object Storage bucket quota.") + .description("The maximum bytes that are allocated to the Cloud Object Storage bucket.") + .type("numeric") + .build(); + Import importModel = new Import.Builder() + .parameters(java.util.Arrays.asList(parameterModel)) + .build(); + CreateRuleOptions createRuleOptions = new CreateRuleOptions.Builder() + .description("Example rule") + .target(targetPrototypeModel) + .requiredConfig(requiredConfigModel) + .version("1.0.0") + .xImport(importModel) + .labels(java.util.Arrays.asList()) + .build(); + + Response response = securityAndComplianceCenterApiService.createRule(createRuleOptions).execute(); + Rule rule = response.getResult(); + + System.out.println(rule); + // end-create_rule + + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); + eTagLink = response.getHeaders().values("ETag").get(0); + ruleIdLink = rule.getId(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getSettings() result:"); + // begin-get_settings + GetSettingsOptions getSettingsOptions = new GetSettingsOptions.Builder() + .xCorrelationId(xCorrelationIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getSettings(getSettingsOptions).execute(); + Settings settings = response.getResult(); + + System.out.println(settings); + // end-get_settings + + eventNotificationsCrnForUpdateSettingsLink = settings.eventNotifications().instanceCrn(); + objectStorageCrnForUpdateSettingsLink = settings.objectStorage().instanceCrn(); + objectStorageBucketForUpdateSettingsLink = settings.objectStorage().bucket(); + objectStorageLocationForUpdateSettingsLink = settings.objectStorage().bucketLocation(); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getRule() result:"); + // begin-get_rule + GetRuleOptions getRuleOptions = new GetRuleOptions.Builder() + .ruleId(ruleIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getRule(getRuleOptions).execute(); + Rule rule = response.getResult(); + + System.out.println(rule); + // end-get_rule + + eTagLink = response.getHeaders().values("ETag").get(0); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("updateSettings() result:"); + // begin-update_settings + EventNotifications eventNotificationsModel = new EventNotifications.Builder() + .instanceCrn(eventNotificationsCrnForUpdateSettingsLink) + .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") + .sourceName("compliance") + .build(); + ObjectStorage objectStorageModel = new ObjectStorage.Builder() + .instanceCrn(objectStorageCrnForUpdateSettingsLink) + .bucket(objectStorageBucketForUpdateSettingsLink) + .bucketLocation(objectStorageLocationForUpdateSettingsLink) + .build(); + UpdateSettingsOptions updateSettingsOptions = new UpdateSettingsOptions.Builder() + .eventNotifications(eventNotificationsModel) + .objectStorage(objectStorageModel) + .xCorrelationId(xCorrelationIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.updateSettings(updateSettingsOptions).execute(); + Settings settings = response.getResult(); + + System.out.println(settings); + // end-update_settings + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("postTestEvent() result:"); + // begin-post_test_event + PostTestEventOptions postTestEventOptions = new PostTestEventOptions.Builder() + .xCorrelationId(xCorrelationIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.postTestEvent(postTestEventOptions).execute(); + TestEvent testEvent = response.getResult(); + + System.out.println(testEvent); + // end-post_test_event + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("createCustomControlLibrary() result:"); + // begin-create_custom_control_library + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() .parameterName("session_invalidation_in_seconds") - .parameterValue("120") .parameterDisplayName("Sign out due to inactivity in seconds") .parameterType("numeric") .build(); - AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() - .name("account-0d8c3805dfea40aa8ad02265a18eb12b") - .description("Test description") - .scope(java.util.Arrays.asList(multiCloudScopeModel)) - .status("enabled") - .schedule("every_30_days") - .notifications(attachmentsNotificationsPrototypeModel) - .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameters(java.util.Arrays.asList(parameterInfoModel)) .build(); - CreateAttachmentOptions createAttachmentOptions = new CreateAttachmentOptions.Builder() - .profilesId(profileIdLink) - .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .componentId("iam-identity") + .componentName("IAM Identity Service") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessments(java.util.Arrays.asList(implementationModel)) + .build(); + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") + .build(); + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) + .build(); + CreateCustomControlLibraryOptions createCustomControlLibraryOptions = new CreateCustomControlLibraryOptions.Builder() + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .controls(java.util.Arrays.asList(controlsInControlLibModel)) + .versionGroupLabel("33fc7b80-0fa5-4f16-bbba-1f293f660f0d") + .controlLibraryVersion("1.0.0") .build(); - Response response = securityAndComplianceCenterApiService.createAttachment(createAttachmentOptions).execute(); - AttachmentPrototype attachmentPrototype = response.getResult(); - - System.out.println(attachmentPrototype); - // end-create_attachment + Response response = securityAndComplianceCenterApiService.createCustomControlLibrary(createCustomControlLibraryOptions).execute(); + ControlLibrary controlLibrary = response.getResult(); - attachmentIdLink = attachmentPrototype.attachments().get(0).id(); + System.out.println(controlLibrary); + // end-create_custom_control_library + + controlLibraryIdLink = controlLibrary.id(); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listAttachments() result:"); - // begin-list_attachments - ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() - .profilesId(profileIdLink) + System.out.println("listControlLibraries() result:"); + // begin-list_control_libraries + ListControlLibrariesOptions listControlLibrariesOptions = new ListControlLibrariesOptions.Builder() .xCorrelationId("testString") .xRequestId("testString") - .limit(Long.valueOf("10")) + .limit(Long.valueOf("50")) + .controlLibraryType("custom") .build(); - AttachmentsPager pager = new AttachmentsPager(securityAndComplianceCenterApiService, listAttachmentsOptions); - List allResults = new ArrayList<>(); + ControlLibrariesPager pager = new ControlLibrariesPager(securityAndComplianceCenterApiService, listControlLibrariesOptions); + List allResults = new ArrayList<>(); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults)); - // end-list_attachments + // end-list_control_libraries } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getProfileAttachment() result:"); - // begin-get_profile_attachment - GetProfileAttachmentOptions getProfileAttachmentOptions = new GetProfileAttachmentOptions.Builder() - .attachmentId(attachmentIdLink) - .profilesId(profileIdLink) + System.out.println("getControlLibrary() result:"); + // begin-get_control_library + GetControlLibraryOptions getControlLibraryOptions = new GetControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) .build(); - Response response = securityAndComplianceCenterApiService.getProfileAttachment(getProfileAttachmentOptions).execute(); - AttachmentItem attachmentItem = response.getResult(); + Response response = securityAndComplianceCenterApiService.getControlLibrary(getControlLibraryOptions).execute(); + ControlLibrary controlLibrary = response.getResult(); - System.out.println(attachmentItem); - // end-get_profile_attachment + System.out.println(controlLibrary); + // end-get_control_library } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("replaceProfileAttachment() result:"); - // begin-replace_profile_attachment - PropertyItem propertyItemModel = new PropertyItem.Builder() - .name("scope_id") - .value("cg3335893hh1428692d6747cf300yeb5") + System.out.println("replaceCustomControlLibrary() result:"); + // begin-replace_custom_control_library + ParameterInfo parameterInfoModel = new ParameterInfo.Builder() + .parameterName("session_invalidation_in_seconds") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") .build(); - MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() - .environment("ibm-cloud") - .xProperties(java.util.Arrays.asList(propertyItemModel)) + Implementation implementationModel = new Implementation.Builder() + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .assessmentMethod("ibm-cloud-rule") + .assessmentType("automated") + .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") + .parameters(java.util.Arrays.asList(parameterInfoModel)) .build(); - FailedControls failedControlsModel = new FailedControls.Builder() - .thresholdLimit(Long.valueOf("15")) - .failedControlIds(java.util.Arrays.asList()) + ControlSpecifications controlSpecificationsModel = new ControlSpecifications.Builder() + .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") + .responsibility("user") + .componentId("iam-identity") + .componentName("IAM Identity Service") + .environment("ibm-cloud") + .controlSpecificationDescription("IBM cloud") + .assessments(java.util.Arrays.asList(implementationModel)) .build(); - AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() - .enabled(false) - .controls(failedControlsModel) + ControlDocs controlDocsModel = new ControlDocs.Builder() + .controlDocsId("sc-7") + .controlDocsType("ibm-cloud") .build(); - AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() - .assessmentType("Automated") - .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") - .parameterName("session_invalidation_in_seconds") - .parameterValue("120") - .parameterDisplayName("Sign out due to inactivity in seconds") - .parameterType("numeric") + ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder() + .controlName("SC-7") + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") + .controlDescription("Boundary Protection") + .controlCategory("System and Communications Protection") + .controlTags(java.util.Arrays.asList("1fa45e17-9322-4e6c-bbd6-1c51db08e790")) + .controlSpecifications(java.util.Arrays.asList(controlSpecificationsModel)) + .controlDocs(controlDocsModel) + .controlRequirement(true) .build(); - ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions = new ReplaceProfileAttachmentOptions.Builder() - .attachmentId(attachmentIdLink) - .profilesId(profileIdLink) - .scope(java.util.Arrays.asList(multiCloudScopeModel)) - .status("enabled") - .schedule("every_30_days") - .notifications(attachmentsNotificationsPrototypeModel) - .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) - .name("account-0d8c3805dfea40aa8ad02265a18eb12b") - .description("Test description") + ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions = new ReplaceCustomControlLibraryOptions.Builder() + .controlLibrariesId(controlLibraryIdLink) + .controlLibraryName("IBM Cloud for Financial Services") + .controlLibraryDescription("IBM Cloud for Financial Services") + .controlLibraryType("custom") + .controlLibraryVersion("1.1.0") + .controls(java.util.Arrays.asList(controlsInControlLibModel)) .build(); - Response response = securityAndComplianceCenterApiService.replaceProfileAttachment(replaceProfileAttachmentOptions).execute(); - AttachmentItem attachmentItem = response.getResult(); + Response response = securityAndComplianceCenterApiService.replaceCustomControlLibrary(replaceCustomControlLibraryOptions).execute(); + ControlLibrary controlLibrary = response.getResult(); - System.out.println(attachmentItem); - // end-replace_profile_attachment + System.out.println(controlLibrary); + // end-replace_custom_control_library } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("createScan() result:"); - // begin-create_scan - CreateScanOptions createScanOptions = new CreateScanOptions.Builder() - .attachmentId(attachmentIdLink) + System.out.println("createProfile() result:"); + // begin-create_profile + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId(controlLibraryIdLink) + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") .build(); - - Response response = securityAndComplianceCenterApiService.createScan(createScanOptions).execute(); - Scan scan = response.getResult(); - - System.out.println(scan); - // end-create_scan - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("listAttachmentsAccount() result:"); - // begin-list_attachments_account - ListAttachmentsAccountOptions listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder() - .xCorrelationId("testString") - .xRequestId("testString") - .limit(Long.valueOf("10")) + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + CreateProfileOptions createProfileOptions = new CreateProfileOptions.Builder() + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) .build(); - AttachmentsAccountPager pager = new AttachmentsAccountPager(securityAndComplianceCenterApiService, listAttachmentsAccountOptions); - List allResults = new ArrayList<>(); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - allResults.addAll(nextPage); - } + Response response = securityAndComplianceCenterApiService.createProfile(createProfileOptions).execute(); + Profile profile = response.getResult(); - System.out.println(GsonSingleton.getGson().toJson(allResults)); - // end-list_attachments_account + System.out.println(profile); + // end-create_profile + + profileIdLink = profile.getId(); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listReports() result:"); - // begin-list_reports - ListReportsOptions listReportsOptions = new ListReportsOptions.Builder() + System.out.println("listProfiles() result:"); + // begin-list_profiles + ListProfilesOptions listProfilesOptions = new ListProfilesOptions.Builder() .xCorrelationId("testString") .xRequestId("testString") - .attachmentId(attachmentIdForReportLink) - .groupId(groupIdForReportLink) - .profileId(profileIdForReportLink) - .type(typeForReportLink) .limit(Long.valueOf("10")) - .sort("profile_name") + .profileType("custom") .build(); - ReportsPager pager = new ReportsPager(securityAndComplianceCenterApiService, listReportsOptions); - List allResults = new ArrayList<>(); + ProfilesPager pager = new ProfilesPager(securityAndComplianceCenterApiService, listProfilesOptions); + List allResults = new ArrayList<>(); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults)); - // end-list_reports - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("getReport() result:"); - // begin-get_report - GetReportOptions getReportOptions = new GetReportOptions.Builder() - .reportId(reportIdForReportLink) - .build(); - - Response response = securityAndComplianceCenterApiService.getReport(getReportOptions).execute(); - Report report = response.getResult(); - - System.out.println(report); - // end-get_report + // end-list_profiles } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getReportSummary() result:"); - // begin-get_report_summary - GetReportSummaryOptions getReportSummaryOptions = new GetReportSummaryOptions.Builder() - .reportId(reportIdForReportLink) + System.out.println("getProfile() result:"); + // begin-get_profile + GetProfileOptions getProfileOptions = new GetProfileOptions.Builder() + .profileId(profileIdLink) .build(); - Response response = securityAndComplianceCenterApiService.getReportSummary(getReportSummaryOptions).execute(); - ReportSummary reportSummary = response.getResult(); + Response response = securityAndComplianceCenterApiService.getProfile(getProfileOptions).execute(); + Profile profile = response.getResult(); - System.out.println(reportSummary); - // end-get_report_summary + System.out.println(profile); + // end-get_profile } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getReportEvaluation() result:"); - // begin-get_report_evaluation - GetReportEvaluationOptions getReportEvaluationOptions = new GetReportEvaluationOptions.Builder() - .reportId(reportIdForReportLink) + System.out.println("replaceProfile() result:"); + // begin-replace_profile + ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder() + .controlLibraryId(controlLibraryIdLink) + .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790") .build(); - - Response response = securityAndComplianceCenterApiService.getReportEvaluation(getReportEvaluationOptions).execute(); - InputStream inputStream = response.getResult(); - - System.out.println(inputStream); - // end-get_report_evaluation - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); - } - - try { - System.out.println("getReportControls() result:"); - // begin-get_report_controls - GetReportControlsOptions getReportControlsOptions = new GetReportControlsOptions.Builder() - .reportId(reportIdForReportLink) - .status("compliant") + DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterDefaultValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + ReplaceProfileOptions replaceProfileOptions = new ReplaceProfileOptions.Builder() + .profileId(profileIdLink) + .profileName("test_profile1") + .profileDescription("test_description1") + .profileType("custom") + .controls(java.util.Arrays.asList(profileControlsPrototypeModel)) + .defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel)) .build(); - Response response = securityAndComplianceCenterApiService.getReportControls(getReportControlsOptions).execute(); - ReportControls reportControls = response.getResult(); + Response response = securityAndComplianceCenterApiService.replaceProfile(replaceProfileOptions).execute(); + Profile profile = response.getResult(); - System.out.println(reportControls); - // end-get_report_controls + System.out.println(profile); + // end-replace_profile } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getReportRule() result:"); - // begin-get_report_rule - GetReportRuleOptions getReportRuleOptions = new GetReportRuleOptions.Builder() - .reportId(reportIdForReportLink) - .ruleId("rule-8d444f8c-fd1d-48de-bcaa-f43732568761") + System.out.println("listRules() result:"); + // begin-list_rules + ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() + .type("system_defined") .build(); - Response response = securityAndComplianceCenterApiService.getReportRule(getReportRuleOptions).execute(); - RuleInfo ruleInfo = response.getResult(); + Response response = securityAndComplianceCenterApiService.listRules(listRulesOptions).execute(); + RulesPageBase rulesPageBase = response.getResult(); - System.out.println(ruleInfo); - // end-get_report_rule + System.out.println(rulesPageBase); + // end-list_rules } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listReportEvaluations() result:"); - // begin-list_report_evaluations - ListReportEvaluationsOptions listReportEvaluationsOptions = new ListReportEvaluationsOptions.Builder() - .reportId(reportIdForReportLink) - .xCorrelationId("testString") - .xRequestId("testString") - .assessmentId("testString") - .componentId("testString") - .targetId("testString") - .targetName("testString") - .status("failure") - .limit(Long.valueOf("10")) + System.out.println("createAttachment() result:"); + // begin-create_attachment + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("scope_id") + .value("cg3335893hh1428692d6747cf300yeb5") + .build(); + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + AttachmentsPrototype attachmentsPrototypeModel = new AttachmentsPrototype.Builder() + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .build(); + CreateAttachmentOptions createAttachmentOptions = new CreateAttachmentOptions.Builder() + .profileId(profileIdLink) + .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) .build(); - ReportEvaluationsPager pager = new ReportEvaluationsPager(securityAndComplianceCenterApiService, listReportEvaluationsOptions); - List allResults = new ArrayList<>(); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - allResults.addAll(nextPage); - } + Response response = securityAndComplianceCenterApiService.createAttachment(createAttachmentOptions).execute(); + AttachmentPrototype attachmentPrototype = response.getResult(); - System.out.println(GsonSingleton.getGson().toJson(allResults)); - // end-list_report_evaluations + System.out.println(attachmentPrototype); + // end-create_attachment + + attachmentIdLink = attachmentPrototype.attachments().get(0).id(); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listReportResources() result:"); - // begin-list_report_resources - ListReportResourcesOptions listReportResourcesOptions = new ListReportResourcesOptions.Builder() - .reportId(reportIdForReportLink) + System.out.println("listAttachments() result:"); + // begin-list_attachments + ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() + .profileId(profileIdLink) .xCorrelationId("testString") .xRequestId("testString") - .id("testString") - .resourceName("testString") - .accountId(accountIdForReportLink) - .componentId("testString") - .status("compliant") - .sort("account_id") .limit(Long.valueOf("10")) .build(); - ReportResourcesPager pager = new ReportResourcesPager(securityAndComplianceCenterApiService, listReportResourcesOptions); - List allResults = new ArrayList<>(); + AttachmentsPager pager = new AttachmentsPager(securityAndComplianceCenterApiService, listAttachmentsOptions); + List allResults = new ArrayList<>(); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); allResults.addAll(nextPage); } System.out.println(GsonSingleton.getGson().toJson(allResults)); - // end-list_report_resources + // end-list_attachments } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getReportTags() result:"); - // begin-get_report_tags - GetReportTagsOptions getReportTagsOptions = new GetReportTagsOptions.Builder() - .reportId(reportIdForReportLink) + System.out.println("getProfileAttachment() result:"); + // begin-get_profile_attachment + GetProfileAttachmentOptions getProfileAttachmentOptions = new GetProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profileId(profileIdLink) .build(); - Response response = securityAndComplianceCenterApiService.getReportTags(getReportTagsOptions).execute(); - ReportTags reportTags = response.getResult(); + Response response = securityAndComplianceCenterApiService.getProfileAttachment(getProfileAttachmentOptions).execute(); + AttachmentItem attachmentItem = response.getResult(); - System.out.println(reportTags); - // end-get_report_tags + System.out.println(attachmentItem); + // end-get_profile_attachment } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getReportViolationsDrift() result:"); - // begin-get_report_violations_drift - GetReportViolationsDriftOptions getReportViolationsDriftOptions = new GetReportViolationsDriftOptions.Builder() - .reportId(reportIdForReportLink) + System.out.println("replaceProfileAttachment() result:"); + // begin-replace_profile_attachment + PropertyItem propertyItemModel = new PropertyItem.Builder() + .name("scope_id") + .value("cg3335893hh1428692d6747cf300yeb5") + .build(); + MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() + .environment("ibm-cloud") + .xProperties(java.util.Arrays.asList(propertyItemModel)) + .build(); + FailedControls failedControlsModel = new FailedControls.Builder() + .thresholdLimit(Long.valueOf("15")) + .failedControlIds(java.util.Arrays.asList()) + .build(); + AttachmentsNotificationsPrototype attachmentsNotificationsPrototypeModel = new AttachmentsNotificationsPrototype.Builder() + .enabled(false) + .controls(failedControlsModel) + .build(); + AttachmentParameterPrototype attachmentParameterPrototypeModel = new AttachmentParameterPrototype.Builder() + .assessmentType("Automated") + .assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1") + .parameterName("session_invalidation_in_seconds") + .parameterValue("120") + .parameterDisplayName("Sign out due to inactivity in seconds") + .parameterType("numeric") + .build(); + ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions = new ReplaceProfileAttachmentOptions.Builder() + .attachmentId(attachmentIdLink) + .profileId(profileIdLink) + .scope(java.util.Arrays.asList(multiCloudScopeModel)) + .status("enabled") + .schedule("every_30_days") + .notifications(attachmentsNotificationsPrototypeModel) + .attachmentParameters(java.util.Arrays.asList(attachmentParameterPrototypeModel)) + .name("account-0d8c3805dfea40aa8ad02265a18eb12b") + .description("Test description") .build(); - Response response = securityAndComplianceCenterApiService.getReportViolationsDrift(getReportViolationsDriftOptions).execute(); - ReportViolationsDrift reportViolationsDrift = response.getResult(); + Response response = securityAndComplianceCenterApiService.replaceProfileAttachment(replaceProfileAttachmentOptions).execute(); + AttachmentItem attachmentItem = response.getResult(); - System.out.println(reportViolationsDrift); - // end-get_report_violations_drift + System.out.println(attachmentItem); + // end-replace_profile_attachment } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("listProviderTypes() result:"); - // begin-list_provider_types - ListProviderTypesOptions listProviderTypesOptions = new ListProviderTypesOptions.Builder() + System.out.println("createScan() result:"); + // begin-create_scan + CreateScanOptions createScanOptions = new CreateScanOptions.Builder() + .attachmentId(attachmentIdLink) .build(); - Response response = securityAndComplianceCenterApiService.listProviderTypes(listProviderTypesOptions).execute(); - ProviderTypesCollection providerTypesCollection = response.getResult(); - - System.out.println(providerTypesCollection); - // end-list_provider_types + Response response = securityAndComplianceCenterApiService.createScan(createScanOptions).execute(); + Scan scan = response.getResult(); - providerTypeIdLink = providerTypesCollection.getProviderTypes().get(0).getId(); + System.out.println(scan); + // end-create_scan } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } try { - System.out.println("getProviderTypeById() result:"); - // begin-get_provider_type_by_id - GetProviderTypeByIdOptions getProviderTypeByIdOptions = new GetProviderTypeByIdOptions.Builder() - .providerTypeId(providerTypeIdLink) + System.out.println("listAttachmentsAccount() result:"); + // begin-list_attachments_account + ListAttachmentsAccountOptions listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .limit(Long.valueOf("10")) .build(); - Response response = securityAndComplianceCenterApiService.getProviderTypeById(getProviderTypeByIdOptions).execute(); - ProviderTypeItem providerTypeItem = response.getResult(); + AttachmentsAccountPager pager = new AttachmentsAccountPager(securityAndComplianceCenterApiService, listAttachmentsAccountOptions); + List allResults = new ArrayList<>(); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + allResults.addAll(nextPage); + } - System.out.println(providerTypeItem); - // end-get_provider_type_by_id + System.out.println(GsonSingleton.getGson().toJson(allResults)); + // end-list_attachments_account } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); @@ -1121,6 +1111,8 @@ public static void main(String[] args) throws Exception { // begin-create_provider_type_instance CreateProviderTypeInstanceOptions createProviderTypeInstanceOptions = new CreateProviderTypeInstanceOptions.Builder() .providerTypeId(providerTypeIdLink) + .name("workload-protection-instance-1") + .attributes(new java.util.HashMap()) .build(); Response response = securityAndComplianceCenterApiService.createProviderTypeInstance(createProviderTypeInstanceOptions).execute(); @@ -1156,9 +1148,13 @@ public static void main(String[] args) throws Exception { try { System.out.println("updateProviderTypeInstance() result:"); // begin-update_provider_type_instance + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName updateProviderTypeInstanceRequestModel = new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.Builder() + .name("workload-protection-instance-1") + .build(); UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptions = new UpdateProviderTypeInstanceOptions.Builder() .providerTypeId(providerTypeIdLink) .providerTypeInstanceId(providerTypeInstanceIdLink) + .updateProviderTypeInstanceRequest(updateProviderTypeInstanceRequestModel) .build(); Response response = securityAndComplianceCenterApiService.updateProviderTypeInstance(updateProviderTypeInstanceOptions).execute(); @@ -1187,11 +1183,46 @@ public static void main(String[] args) throws Exception { e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } + try { + System.out.println("listProviderTypes() result:"); + // begin-list_provider_types + ListProviderTypesOptions listProviderTypesOptions = new ListProviderTypesOptions.Builder() + .build(); + + Response response = securityAndComplianceCenterApiService.listProviderTypes(listProviderTypesOptions).execute(); + ProviderTypesCollection providerTypesCollection = response.getResult(); + + System.out.println(providerTypesCollection); + // end-list_provider_types + + providerTypeIdLink = providerTypesCollection.getProviderTypes().get(0).getId(); + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + System.out.println("getProviderTypeById() result:"); + // begin-get_provider_type_by_id + GetProviderTypeByIdOptions getProviderTypeByIdOptions = new GetProviderTypeByIdOptions.Builder() + .providerTypeId(providerTypeIdLink) + .build(); + + Response response = securityAndComplianceCenterApiService.getProviderTypeById(getProviderTypeByIdOptions).execute(); + ProviderTypeItem providerTypeItem = response.getResult(); + + System.out.println(providerTypeItem); + // end-get_provider_type_by_id + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + try { System.out.println("deleteCustomProfile() result:"); // begin-delete_custom_profile DeleteCustomProfileOptions deleteCustomProfileOptions = new DeleteCustomProfileOptions.Builder() - .profilesId(profileIdLink) + .profileId(profileIdLink) .build(); Response response = securityAndComplianceCenterApiService.deleteCustomProfile(deleteCustomProfileOptions).execute(); @@ -1240,7 +1271,7 @@ public static void main(String[] args) throws Exception { // begin-delete_profile_attachment DeleteProfileAttachmentOptions deleteProfileAttachmentOptions = new DeleteProfileAttachmentOptions.Builder() .attachmentId(attachmentIdLink) - .profilesId(profileIdLink) + .profileId(profileIdLink) .build(); Response response = securityAndComplianceCenterApiService.deleteProfileAttachment(deleteProfileAttachmentOptions).execute(); diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java index 7935bb49..77fb49cf 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java @@ -209,10 +209,10 @@ public ServiceCall getSettings(GetSettingsOptions getSettingsOptions) } builder.header("Accept", "application/json"); if (getSettingsOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", getSettingsOptions.xCorrelationId()); + builder.header("X-Correlation-ID", getSettingsOptions.xCorrelationId()); } if (getSettingsOptions.xRequestId() != null) { - builder.header("X-Request-Id", getSettingsOptions.xRequestId()); + builder.header("X-Request-ID", getSettingsOptions.xRequestId()); } ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); @@ -248,10 +248,10 @@ public ServiceCall updateSettings(UpdateSettingsOptions updateSettings } builder.header("Accept", "application/json"); if (updateSettingsOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", updateSettingsOptions.xCorrelationId()); + builder.header("X-Correlation-ID", updateSettingsOptions.xCorrelationId()); } if (updateSettingsOptions.xRequestId() != null) { - builder.header("X-Request-Id", updateSettingsOptions.xRequestId()); + builder.header("X-Request-ID", updateSettingsOptions.xRequestId()); } final JsonObject contentJson = new JsonObject(); if (updateSettingsOptions.eventNotifications() != null) { @@ -298,10 +298,10 @@ public ServiceCall postTestEvent(PostTestEventOptions postTestEventOp } builder.header("Accept", "application/json"); if (postTestEventOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", postTestEventOptions.xCorrelationId()); + builder.header("X-Correlation-ID", postTestEventOptions.xCorrelationId()); } if (postTestEventOptions.xRequestId() != null) { - builder.header("X-Request-Id", postTestEventOptions.xRequestId()); + builder.header("X-Request-ID", postTestEventOptions.xRequestId()); } ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); @@ -322,7 +322,7 @@ public ServiceCall postTestEvent() { } /** - * Get control libraries. + * List control libraries. * * Retrieve all of the control libraries that are available in your account, including predefined, and custom * libraries. @@ -332,7 +332,8 @@ public ServiceCall postTestEvent() { * Each control has several specifications and assessments that are mapped to it. A specification is a defined * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a * detailed evaluation that is done to check whether the specification is compliant. For more information, see - * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * [Creating custom + * libraries](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-custom-library). * * @param listControlLibrariesOptions the {@link ListControlLibrariesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ControlLibraryCollection} @@ -368,7 +369,7 @@ public ServiceCall listControlLibraries(ListControlLib } /** - * Get control libraries. + * List control libraries. * * Retrieve all of the control libraries that are available in your account, including predefined, and custom * libraries. @@ -378,7 +379,8 @@ public ServiceCall listControlLibraries(ListControlLib * Each control has several specifications and assessments that are mapped to it. A specification is a defined * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a * detailed evaluation that is done to check whether the specification is compliant. For more information, see - * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * [Creating custom + * libraries](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-custom-library). * * @return a {@link ServiceCall} with a result of type {@link ControlLibraryCollection} */ @@ -396,7 +398,8 @@ public ServiceCall listControlLibraries() { * Each control has several specifications and assessments that are mapped to it. A specification is a defined * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a * detailed evaluation that is done to check whether the specification is compliant. For more information, see - * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * [Creating custom + * libraries](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-custom-library). * * @param createCustomControlLibraryOptions the {@link CreateCustomControlLibraryOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ControlLibrary} @@ -447,7 +450,8 @@ public ServiceCall createCustomControlLibrary(CreateCustomContro * * With Security and Compliance Center, you can manage a custom control library that is specific to your * organization's needs. Each control has several specifications and assessments that are mapped to it. For more - * information, see [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * information, see [Creating custom + * libraries](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-custom-library). * * @param deleteCustomControlLibraryOptions the {@link DeleteCustomControlLibraryOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ControlLibraryDelete} @@ -484,7 +488,8 @@ public ServiceCall deleteCustomControlLibrary(DeleteCustom * Each control has several specifications and assessments that are mapped to it. A specification is a defined * requirement that is specific to a component. An assessment, or several, are mapped to each specification with a * detailed evaluation that is done to check whether the specification is compliant. For more information, see - * [Creating custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * [Creating custom + * libraries](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-custom-library). * * @param getControlLibraryOptions the {@link GetControlLibraryOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ControlLibrary} @@ -520,7 +525,7 @@ public ServiceCall getControlLibrary(GetControlLibraryOptions ge * With Security and Compliance Center, you can create and update a custom control library that is specific to your * organization's needs. You define the controls and specifications before you map previously created assessments. * Each control has several specifications and assessments that are mapped to it. For more information, see [Creating - * custom libraries](/docs/security-compliance?topic=security-compliance-custom-library). + * custom libraries](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-custom-library). * * @param replaceCustomControlLibraryOptions the {@link ReplaceCustomControlLibraryOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ControlLibrary} @@ -598,7 +603,7 @@ public ServiceCall replaceCustomControlLibrary(ReplaceCustomCont } /** - * Get all profiles. + * List profiles. * * View all of the predefined and custom profiles that are available in your account. * @@ -636,7 +641,7 @@ public ServiceCall listProfiles(ListProfilesOptions listProfi } /** - * Get all profiles. + * List profiles. * * View all of the predefined and custom profiles that are available in your account. * @@ -651,7 +656,7 @@ public ServiceCall listProfiles() { * * Create a custom profile that is specific to your usecase, by using an existing library as a starting point. For * more information, see [Building custom - * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * profiles](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). * * @param createProfileOptions the {@link CreateProfileOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Profile} @@ -688,7 +693,7 @@ public ServiceCall createProfile(CreateProfileOptions createProfileOpti * * Delete a custom profile by providing the profile ID. You can find the ID in the Security and Compliance Center UI. * For more information about managing your custom profiles, see [Building custom - * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * profiles](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). * * @param deleteCustomProfileOptions the {@link DeleteCustomProfileOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Profile} @@ -697,8 +702,8 @@ public ServiceCall deleteCustomProfile(DeleteCustomProfileOptions delet com.ibm.cloud.sdk.core.util.Validator.notNull(deleteCustomProfileOptions, "deleteCustomProfileOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("profiles_id", deleteCustomProfileOptions.profilesId()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}", pathParamsMap)); + pathParamsMap.put("profile_id", deleteCustomProfileOptions.profileId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "deleteCustomProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -720,7 +725,7 @@ public ServiceCall deleteCustomProfile(DeleteCustomProfileOptions delet * * View the details of a profile by providing the profile ID. You can find the profile ID in the Security and * Compliance Center UI. For more information, see [Building custom - * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * profiles](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). * * @param getProfileOptions the {@link GetProfileOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Profile} @@ -729,8 +734,8 @@ public ServiceCall getProfile(GetProfileOptions getProfileOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull(getProfileOptions, "getProfileOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("profiles_id", getProfileOptions.profilesId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}", pathParamsMap)); + pathParamsMap.put("profile_id", getProfileOptions.profileId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -753,7 +758,7 @@ public ServiceCall getProfile(GetProfileOptions getProfileOptions) { * Update the details of a custom profile. With Security and Compliance Center, you can manage a profile that is * specific to your usecase, by using an existing library as a starting point. For more information, see [Building * custom - * profiles](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). + * profiles](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-build-custom-profiles&interface=api). * * @param replaceProfileOptions the {@link ReplaceProfileOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Profile} @@ -762,8 +767,8 @@ public ServiceCall replaceProfile(ReplaceProfileOptions replaceProfileO com.ibm.cloud.sdk.core.util.Validator.notNull(replaceProfileOptions, "replaceProfileOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("profiles_id", replaceProfileOptions.profilesId()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}", pathParamsMap)); + pathParamsMap.put("profile_id", replaceProfileOptions.profileId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "replaceProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -808,10 +813,10 @@ public ServiceCall listRules(ListRulesOptions listRulesOptions) { } builder.header("Accept", "application/json"); if (listRulesOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", listRulesOptions.xCorrelationId()); + builder.header("X-Correlation-ID", listRulesOptions.xCorrelationId()); } if (listRulesOptions.xRequestId() != null) { - builder.header("X-Request-Id", listRulesOptions.xRequestId()); + builder.header("X-Request-ID", listRulesOptions.xRequestId()); } if (listRulesOptions.type() != null) { builder.query("type", String.valueOf(listRulesOptions.type())); @@ -860,18 +865,15 @@ public ServiceCall createRule(CreateRuleOptions createRuleOptions) { } builder.header("Accept", "application/json"); if (createRuleOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", createRuleOptions.xCorrelationId()); + builder.header("X-Correlation-ID", createRuleOptions.xCorrelationId()); } if (createRuleOptions.xRequestId() != null) { - builder.header("X-Request-Id", createRuleOptions.xRequestId()); + builder.header("X-Request-ID", createRuleOptions.xRequestId()); } final JsonObject contentJson = new JsonObject(); contentJson.addProperty("description", createRuleOptions.description()); contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRuleOptions.target())); contentJson.add("required_config", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createRuleOptions.requiredConfig())); - if (createRuleOptions.type() != null) { - contentJson.addProperty("type", createRuleOptions.type()); - } if (createRuleOptions.version() != null) { contentJson.addProperty("version", createRuleOptions.version()); } @@ -907,10 +909,10 @@ public ServiceCall deleteRule(DeleteRuleOptions deleteRuleOptions) { builder.header(header.getKey(), header.getValue()); } if (deleteRuleOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", deleteRuleOptions.xCorrelationId()); + builder.header("X-Correlation-ID", deleteRuleOptions.xCorrelationId()); } if (deleteRuleOptions.xRequestId() != null) { - builder.header("X-Request-Id", deleteRuleOptions.xRequestId()); + builder.header("X-Request-ID", deleteRuleOptions.xRequestId()); } ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); @@ -937,10 +939,10 @@ public ServiceCall getRule(GetRuleOptions getRuleOptions) { } builder.header("Accept", "application/json"); if (getRuleOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", getRuleOptions.xCorrelationId()); + builder.header("X-Correlation-ID", getRuleOptions.xCorrelationId()); } if (getRuleOptions.xRequestId() != null) { - builder.header("X-Request-Id", getRuleOptions.xRequestId()); + builder.header("X-Request-ID", getRuleOptions.xRequestId()); } ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); @@ -970,18 +972,15 @@ public ServiceCall replaceRule(ReplaceRuleOptions replaceRuleOptions) { builder.header("Accept", "application/json"); builder.header("If-Match", replaceRuleOptions.ifMatch()); if (replaceRuleOptions.xCorrelationId() != null) { - builder.header("X-Correlation-Id", replaceRuleOptions.xCorrelationId()); + builder.header("X-Correlation-ID", replaceRuleOptions.xCorrelationId()); } if (replaceRuleOptions.xRequestId() != null) { - builder.header("X-Request-Id", replaceRuleOptions.xRequestId()); + builder.header("X-Request-ID", replaceRuleOptions.xRequestId()); } final JsonObject contentJson = new JsonObject(); contentJson.addProperty("description", replaceRuleOptions.description()); contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceRuleOptions.target())); contentJson.add("required_config", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceRuleOptions.requiredConfig())); - if (replaceRuleOptions.type() != null) { - contentJson.addProperty("type", replaceRuleOptions.type()); - } if (replaceRuleOptions.version() != null) { contentJson.addProperty("version", replaceRuleOptions.version()); } @@ -998,12 +997,12 @@ public ServiceCall replaceRule(ReplaceRuleOptions replaceRuleOptions) { } /** - * Get all attachments linked to a specific profile. + * List attachments to a profile. * * View all of the attachments that are linked to a specific profile. An attachment is the association between the * set of resources that you want to evaluate and a profile that contains the specific controls that you want to use. * For more information, see [Running an evaluation for IBM - * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * Cloud](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). * * @param listAttachmentsOptions the {@link ListAttachmentsOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link AttachmentCollection} @@ -1012,8 +1011,8 @@ public ServiceCall listAttachments(ListAttachmentsOptions com.ibm.cloud.sdk.core.util.Validator.notNull(listAttachmentsOptions, "listAttachmentsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("profiles_id", listAttachmentsOptions.profilesId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments", pathParamsMap)); + pathParamsMap.put("profile_id", listAttachmentsOptions.profileId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}/attachments", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listAttachments"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -1041,7 +1040,7 @@ public ServiceCall listAttachments(ListAttachmentsOptions * * Create an attachment to link to a profile to schedule evaluations of your resources on a recurring schedule, or * on-demand. For more information, see [Running an evaluation for IBM - * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * Cloud](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). * * @param createAttachmentOptions the {@link CreateAttachmentOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link AttachmentPrototype} @@ -1050,8 +1049,8 @@ public ServiceCall createAttachment(CreateAttachmentOptions com.ibm.cloud.sdk.core.util.Validator.notNull(createAttachmentOptions, "createAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("profiles_id", createAttachmentOptions.profilesId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments", pathParamsMap)); + pathParamsMap.put("profile_id", createAttachmentOptions.profileId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}/attachments", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -1079,7 +1078,7 @@ public ServiceCall createAttachment(CreateAttachmentOptions * * Delete an attachment. Alternatively, if you think that you might need this configuration in the future, you can * pause an attachment to stop being charged. For more information, see [Running an evaluation for IBM - * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * Cloud](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). * * @param deleteProfileAttachmentOptions the {@link DeleteProfileAttachmentOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link AttachmentItem} @@ -1089,8 +1088,8 @@ public ServiceCall deleteProfileAttachment(DeleteProfileAttachme "deleteProfileAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); pathParamsMap.put("attachment_id", deleteProfileAttachmentOptions.attachmentId()); - pathParamsMap.put("profiles_id", deleteProfileAttachmentOptions.profilesId()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments/{attachment_id}", pathParamsMap)); + pathParamsMap.put("profile_id", deleteProfileAttachmentOptions.profileId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}/attachments/{attachment_id}", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "deleteProfileAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -1112,7 +1111,7 @@ public ServiceCall deleteProfileAttachment(DeleteProfileAttachme * * View the details of an attachment a profile by providing the attachment ID. You can find this value in the * Security and Compliance Center UI. For more information, see [Running an evaluation for IBM - * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * Cloud](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). * * @param getProfileAttachmentOptions the {@link GetProfileAttachmentOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link AttachmentItem} @@ -1122,8 +1121,8 @@ public ServiceCall getProfileAttachment(GetProfileAttachmentOpti "getProfileAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); pathParamsMap.put("attachment_id", getProfileAttachmentOptions.attachmentId()); - pathParamsMap.put("profiles_id", getProfileAttachmentOptions.profilesId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments/{attachment_id}", pathParamsMap)); + pathParamsMap.put("profile_id", getProfileAttachmentOptions.profileId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}/attachments/{attachment_id}", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProfileAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -1145,7 +1144,7 @@ public ServiceCall getProfileAttachment(GetProfileAttachmentOpti * * Update an attachment that is linked to a profile to evaluate your resources on a recurring schedule, or on-demand. * For more information, see [Running an evaluation for IBM - * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * Cloud](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). * * @param replaceProfileAttachmentOptions the {@link ReplaceProfileAttachmentOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link AttachmentItem} @@ -1155,8 +1154,8 @@ public ServiceCall replaceProfileAttachment(ReplaceProfileAttach "replaceProfileAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); pathParamsMap.put("attachment_id", replaceProfileAttachmentOptions.attachmentId()); - pathParamsMap.put("profiles_id", replaceProfileAttachmentOptions.profilesId()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profiles_id}/attachments/{attachment_id}", pathParamsMap)); + pathParamsMap.put("profile_id", replaceProfileAttachmentOptions.profileId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles/{profile_id}/attachments/{attachment_id}", pathParamsMap)); Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "replaceProfileAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); @@ -1258,12 +1257,12 @@ public ServiceCall createScan(CreateScanOptions createScanOptions) { } /** - * Get all attachments in an instance. + * List attachments. * * View all of the attachments that are linked to an account. An attachment is the association between the set of * resources that you want to evaluate and a profile that contains the specific controls that you want to use. For * more information, see [Running an evaluation for IBM - * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * Cloud](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). * * @param listAttachmentsAccountOptions the {@link ListAttachmentsAccountOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link AttachmentCollection} @@ -1296,12 +1295,12 @@ public ServiceCall listAttachmentsAccount(ListAttachmentsA } /** - * Get all attachments in an instance. + * List attachments. * * View all of the attachments that are linked to an account. An attachment is the association between the set of * resources that you want to evaluate and a profile that contains the specific controls that you want to use. For * more information, see [Running an evaluation for IBM - * Cloud](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). + * Cloud](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-scan-resources). * * @return a {@link ServiceCall} with a result of type {@link AttachmentCollection} */ @@ -1310,7 +1309,7 @@ public ServiceCall listAttachmentsAccount() { } /** - * Get the latest reports. + * List latest reports. * * Retrieve the latest reports, which are grouped by profile ID, scope ID, and attachment ID. For more information, * see [Viewing results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). @@ -1343,7 +1342,7 @@ public ServiceCall getLatestReports(GetLatestReportsOptions getLat } /** - * Get the latest reports. + * List latest reports. * * Retrieve the latest reports, which are grouped by profile ID, scope ID, and attachment ID. For more information, * see [Viewing results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). @@ -1622,12 +1621,18 @@ public ServiceCall listReportEvaluations(ListReportEvaluationsOp if (listReportEvaluationsOptions.assessmentId() != null) { builder.query("assessment_id", String.valueOf(listReportEvaluationsOptions.assessmentId())); } + if (listReportEvaluationsOptions.assessmentMethod() != null) { + builder.query("assessment_method", String.valueOf(listReportEvaluationsOptions.assessmentMethod())); + } if (listReportEvaluationsOptions.componentId() != null) { builder.query("component_id", String.valueOf(listReportEvaluationsOptions.componentId())); } if (listReportEvaluationsOptions.targetId() != null) { builder.query("target_id", String.valueOf(listReportEvaluationsOptions.targetId())); } + if (listReportEvaluationsOptions.targetEnv() != null) { + builder.query("target_env", String.valueOf(listReportEvaluationsOptions.targetEnv())); + } if (listReportEvaluationsOptions.targetName() != null) { builder.query("target_name", String.valueOf(listReportEvaluationsOptions.targetName())); } @@ -1701,7 +1706,7 @@ public ServiceCall listReportResources(ListReportResourcesOptions } /** - * Get report tags. + * List report tags. * * Retrieve a list of tags for the specified report. For more information, see [Viewing * results](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-results). @@ -1766,85 +1771,10 @@ public ServiceCall getReportViolationsDrift(GetReportViol } /** - * List all provider types. - * - * List all the registered provider types. For more information about connecting Workload Protection with the Security - * and Compliance Center, see [Connecting Workload - * Protection](/docs/security-compliance?topic=security-compliance-setup-workload-protection&interface=api#wp-register). - * - * @param listProviderTypesOptions the {@link ListProviderTypesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ProviderTypesCollection} - */ - public ServiceCall listProviderTypes(ListProviderTypesOptions listProviderTypesOptions) { - if (listProviderTypesOptions == null) { - listProviderTypesOptions = new ListProviderTypesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types")); - Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listProviderTypes"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (listProviderTypesOptions.xCorrelationId() != null) { - builder.header("X-Correlation-ID", listProviderTypesOptions.xCorrelationId()); - } - if (listProviderTypesOptions.xRequestId() != null) { - builder.header("X-Request-ID", listProviderTypesOptions.xRequestId()); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List all provider types. - * - * List all the registered provider types. For more information about connecting Workload Protection with the Security - * and Compliance Center, see [Connecting Workload - * Protection](/docs/security-compliance?topic=security-compliance-setup-workload-protection&interface=api#wp-register). - * - * @return a {@link ServiceCall} with a result of type {@link ProviderTypesCollection} - */ - public ServiceCall listProviderTypes() { - return listProviderTypes(null); - } - - /** - * Get a provider type. - * - * Retrieve a provider type by specifying its ID. For more information about integrations, see [Connecting Workload - * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). - * - * @param getProviderTypeByIdOptions the {@link GetProviderTypeByIdOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ProviderTypeItem} - */ - public ServiceCall getProviderTypeById(GetProviderTypeByIdOptions getProviderTypeByIdOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getProviderTypeByIdOptions, - "getProviderTypeByIdOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("provider_type_id", getProviderTypeByIdOptions.providerTypeId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProviderTypeById"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (getProviderTypeByIdOptions.xCorrelationId() != null) { - builder.header("X-Correlation-ID", getProviderTypeByIdOptions.xCorrelationId()); - } - if (getProviderTypeByIdOptions.xRequestId() != null) { - builder.header("X-Request-ID", getProviderTypeByIdOptions.xRequestId()); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List all provider type instances. + * List provider type instances. * - * Retrieve all instances of provider type. For more information about integrations, see [Connecting Workload - * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * Retrieve all instances of a provider type. For more information about integrations, see [Connecting Workload + * Protection](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). * * @param listProviderTypeInstancesOptions the {@link ListProviderTypeInstancesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstancesResponse} @@ -1875,7 +1805,7 @@ public ServiceCall listProviderTypeInstances(List * Create a provider type instance. * * Create an instance of a provider type. For more information about integrations, see [Connecting Workload - * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * Protection](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). * * @param createProviderTypeInstanceOptions the {@link CreateProviderTypeInstanceOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstanceItem} @@ -1898,12 +1828,8 @@ public ServiceCall createProviderTypeInstance(CreatePr builder.header("X-Request-ID", createProviderTypeInstanceOptions.xRequestId()); } final JsonObject contentJson = new JsonObject(); - if (createProviderTypeInstanceOptions.name() != null) { - contentJson.addProperty("name", createProviderTypeInstanceOptions.name()); - } - if (createProviderTypeInstanceOptions.attributes() != null) { - contentJson.add("attributes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createProviderTypeInstanceOptions.attributes())); - } + contentJson.addProperty("name", createProviderTypeInstanceOptions.name()); + contentJson.add("attributes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createProviderTypeInstanceOptions.attributes())); builder.bodyJson(contentJson); ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); @@ -1911,9 +1837,10 @@ public ServiceCall createProviderTypeInstance(CreatePr } /** - * Remove a specific instance of a provider type. + * Delete a provider type instance. * - * Remove a specific instance of a provider type. + * Remove a provider type instance. For more information about integrations, see [Connecting Workload + * Protection](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). * * @param deleteProviderTypeInstanceOptions the {@link DeleteProviderTypeInstanceOptions} containing the options for the call * @return a {@link ServiceCall} with a void result @@ -1940,11 +1867,11 @@ public ServiceCall deleteProviderTypeInstance(DeleteProviderTypeInstanceOp } /** - * List a provider type instance. + * Get a provider type instance. * * Retrieve a provider type instance by specifying the provider type ID, and Security and Compliance Center instance * ID. For more information about integrations, see [Connecting Workload - * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * Protection](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). * * @param getProviderTypeInstanceOptions the {@link GetProviderTypeInstanceOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstanceItem} @@ -1973,9 +1900,10 @@ public ServiceCall getProviderTypeInstance(GetProvider } /** - * Patch a specific instance of a provider type. + * Update a provider type instance. * - * Patch a specific instance of a provider type. + * Update a provider type instance. For more information about integrations, see [Connecting Workload + * Protection](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). * * @param updateProviderTypeInstanceOptions the {@link UpdateProviderTypeInstanceOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ProviderTypeInstanceItem} @@ -1998,23 +1926,17 @@ public ServiceCall updateProviderTypeInstance(UpdatePr if (updateProviderTypeInstanceOptions.xRequestId() != null) { builder.header("X-Request-ID", updateProviderTypeInstanceOptions.xRequestId()); } - final JsonObject contentJson = new JsonObject(); - if (updateProviderTypeInstanceOptions.name() != null) { - contentJson.addProperty("name", updateProviderTypeInstanceOptions.name()); - } - if (updateProviderTypeInstanceOptions.attributes() != null) { - contentJson.add("attributes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateProviderTypeInstanceOptions.attributes())); - } - builder.bodyJson(contentJson); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(updateProviderTypeInstanceOptions.updateProviderTypeInstanceRequest()), "application/json"); ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Get a list of instances for all provider types. + * List instances of provider types. * - * Get a list of instances for all provider types. + * Get a list of all provider types' instances. For more information about integrations, see [Connecting Workload + * Protection](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). * * @param getProviderTypesInstancesOptions the {@link GetProviderTypesInstancesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ProviderTypesInstancesResponse} @@ -2041,9 +1963,10 @@ public ServiceCall getProviderTypesInstances(Get } /** - * Get a list of instances for all provider types. + * List instances of provider types. * - * Get a list of instances for all provider types. + * Get a list of all provider types' instances. For more information about integrations, see [Connecting Workload + * Protection](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). * * @return a {@link ServiceCall} with a result of type {@link ProviderTypesInstancesResponse} */ @@ -2051,4 +1974,79 @@ public ServiceCall getProviderTypesInstances() { return getProviderTypesInstances(null); } + /** + * List provider types. + * + * List all the registered provider types. For more information about connecting Workload Protection with the Security + * and Compliance Center, see [Connecting Workload + * Protection](/docs/security-compliance?topic=security-compliance-setup-workload-protection&interface=api#wp-register). + * + * @param listProviderTypesOptions the {@link ListProviderTypesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypesCollection} + */ + public ServiceCall listProviderTypes(ListProviderTypesOptions listProviderTypesOptions) { + if (listProviderTypesOptions == null) { + listProviderTypesOptions = new ListProviderTypesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types")); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "listProviderTypes"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (listProviderTypesOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", listProviderTypesOptions.xCorrelationId()); + } + if (listProviderTypesOptions.xRequestId() != null) { + builder.header("X-Request-ID", listProviderTypesOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List provider types. + * + * List all the registered provider types. For more information about connecting Workload Protection with the Security + * and Compliance Center, see [Connecting Workload + * Protection](/docs/security-compliance?topic=security-compliance-setup-workload-protection&interface=api#wp-register). + * + * @return a {@link ServiceCall} with a result of type {@link ProviderTypesCollection} + */ + public ServiceCall listProviderTypes() { + return listProviderTypes(null); + } + + /** + * Get a provider type. + * + * Retrieve a provider type by specifying its ID. For more information about integrations, see [Connecting Workload + * Protection](https://test.cloud.ibm.com/docs/security-compliance?topic=security-compliance-setup-workload-protection). + * + * @param getProviderTypeByIdOptions the {@link GetProviderTypeByIdOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ProviderTypeItem} + */ + public ServiceCall getProviderTypeById(GetProviderTypeByIdOptions getProviderTypeByIdOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getProviderTypeByIdOptions, + "getProviderTypeByIdOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_type_id", getProviderTypeByIdOptions.providerTypeId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/provider_types/{provider_type_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "getProviderTypeById"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getProviderTypeByIdOptions.xCorrelationId() != null) { + builder.header("X-Correlation-ID", getProviderTypeByIdOptions.xCorrelationId()); + } + if (getProviderTypeByIdOptions.xRequestId() != null) { + builder.header("X-Request-ID", getProviderTypeByIdOptions.xRequestId()); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + } diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java index da57fcd9..a5e3eaa4 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecifications.java @@ -36,8 +36,8 @@ public interface Responsibility { protected String responsibility; @SerializedName("component_id") protected String componentId; - @SerializedName("componenet_name") - protected String componenetName; + @SerializedName("component_name") + protected String componentName; protected String environment; @SerializedName("control_specification_description") protected String controlSpecificationDescription; @@ -52,7 +52,7 @@ public static class Builder { private String controlSpecificationId; private String responsibility; private String componentId; - private String componenetName; + private String componentName; private String environment; private String controlSpecificationDescription; private Long assessmentsCount; @@ -67,7 +67,7 @@ private Builder(ControlSpecifications controlSpecifications) { this.controlSpecificationId = controlSpecifications.controlSpecificationId; this.responsibility = controlSpecifications.responsibility; this.componentId = controlSpecifications.componentId; - this.componenetName = controlSpecifications.componenetName; + this.componentName = controlSpecifications.componentName; this.environment = controlSpecifications.environment; this.controlSpecificationDescription = controlSpecifications.controlSpecificationDescription; this.assessmentsCount = controlSpecifications.assessmentsCount; @@ -139,13 +139,13 @@ public Builder componentId(String componentId) { } /** - * Set the componenetName. + * Set the componentName. * - * @param componenetName the componenetName + * @param componentName the componentName * @return the ControlSpecifications builder */ - public Builder componenetName(String componenetName) { - this.componenetName = componenetName; + public Builder componentName(String componentName) { + this.componentName = componentName; return this; } @@ -201,7 +201,7 @@ protected ControlSpecifications(Builder builder) { controlSpecificationId = builder.controlSpecificationId; responsibility = builder.responsibility; componentId = builder.componentId; - componenetName = builder.componenetName; + componentName = builder.componentName; environment = builder.environment; controlSpecificationDescription = builder.controlSpecificationDescription; assessmentsCount = builder.assessmentsCount; @@ -251,14 +251,14 @@ public String componentId() { } /** - * Gets the componenetName. + * Gets the componentName. * * The component name. * - * @return the componenetName + * @return the componentName */ - public String componenetName() { - return componenetName; + public String componentName() { + return componentName; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java index f6a2cba0..bd6caf84 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptions.java @@ -22,9 +22,8 @@ */ public class CreateAttachmentOptions extends GenericModel { - protected String profilesId; - protected List attachments; protected String profileId; + protected List attachments; protected String xCorrelationId; protected String xRequestId; @@ -32,9 +31,8 @@ public class CreateAttachmentOptions extends GenericModel { * Builder. */ public static class Builder { - private String profilesId; - private List attachments; private String profileId; + private List attachments; private String xCorrelationId; private String xRequestId; @@ -44,7 +42,6 @@ public static class Builder { * @param createAttachmentOptions the instance to initialize the Builder with */ private Builder(CreateAttachmentOptions createAttachmentOptions) { - this.profilesId = createAttachmentOptions.profilesId; this.attachments = createAttachmentOptions.attachments; this.profileId = createAttachmentOptions.profileId; this.xCorrelationId = createAttachmentOptions.xCorrelationId; @@ -60,11 +57,11 @@ public Builder() { /** * Instantiates a new builder with required properties. * - * @param profilesId the profilesId + * @param profileId the profileId * @param attachments the attachments */ - public Builder(String profilesId, List attachments) { - this.profilesId = profilesId; + public Builder(String profileId, List attachments) { + this.profileId = profileId; this.attachments = attachments; } @@ -94,13 +91,13 @@ public Builder addAttachments(AttachmentsPrototype attachments) { } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the CreateAttachmentOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -116,17 +113,6 @@ public Builder attachments(List attachments) { return this; } - /** - * Set the profileId. - * - * @param profileId the profileId - * @return the CreateAttachmentOptions builder - */ - public Builder profileId(String profileId) { - this.profileId = profileId; - return this; - } - /** * Set the xCorrelationId. * @@ -165,11 +151,11 @@ public Builder attachmentPrototype(AttachmentPrototype attachmentPrototype) { protected CreateAttachmentOptions() { } protected CreateAttachmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attachments, "attachments cannot be null"); - profilesId = builder.profilesId; + profileId = builder.profileId; attachments = builder.attachments; profileId = builder.profileId; xCorrelationId = builder.xCorrelationId; @@ -186,14 +172,14 @@ public Builder newBuilder() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** @@ -207,17 +193,6 @@ public List attachments() { return attachments; } - /** - * Gets the profileId. - * - * The ID of the profile that is specified in the attachment. - * - * @return the profileId - */ - public String profileId() { - return profileId; - } - /** * Gets the xCorrelationId. * diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java index 1430b900..1cef3d89 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProviderTypeInstanceOptions.java @@ -60,9 +60,13 @@ public Builder() { * Instantiates a new builder with required properties. * * @param providerTypeId the providerTypeId + * @param name the name + * @param attributes the attributes */ - public Builder(String providerTypeId) { + public Builder(String providerTypeId, String name, Map attributes) { this.providerTypeId = providerTypeId; + this.name = name; + this.attributes = attributes; } /** @@ -135,6 +139,10 @@ protected CreateProviderTypeInstanceOptions() { } protected CreateProviderTypeInstanceOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeId, "providerTypeId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, + "name cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attributes, + "attributes cannot be null"); providerTypeId = builder.providerTypeId; name = builder.name; attributes = builder.attributes; diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java index 2b3cb4ad..40ab889d 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptions.java @@ -22,20 +22,9 @@ */ public class CreateRuleOptions extends GenericModel { - /** - * The rule type (user_defined or system_defined). - */ - public interface Type { - /** user_defined. */ - String USER_DEFINED = "user_defined"; - /** system_defined. */ - String SYSTEM_DEFINED = "system_defined"; - } - protected String description; - protected Target target; + protected TargetPrototype target; protected RequiredConfig requiredConfig; - protected String type; protected String version; protected Import xImport; protected List labels; @@ -47,9 +36,8 @@ public interface Type { */ public static class Builder { private String description; - private Target target; + private TargetPrototype target; private RequiredConfig requiredConfig; - private String type; private String version; private Import xImport; private List labels; @@ -65,7 +53,6 @@ private Builder(CreateRuleOptions createRuleOptions) { this.description = createRuleOptions.description; this.target = createRuleOptions.target; this.requiredConfig = createRuleOptions.requiredConfig; - this.type = createRuleOptions.type; this.version = createRuleOptions.version; this.xImport = createRuleOptions.xImport; this.labels = createRuleOptions.labels; @@ -86,7 +73,7 @@ public Builder() { * @param target the target * @param requiredConfig the requiredConfig */ - public Builder(String description, Target target, RequiredConfig requiredConfig) { + public Builder(String description, TargetPrototype target, RequiredConfig requiredConfig) { this.description = description; this.target = target; this.requiredConfig = requiredConfig; @@ -134,7 +121,7 @@ public Builder description(String description) { * @param target the target * @return the CreateRuleOptions builder */ - public Builder target(Target target) { + public Builder target(TargetPrototype target) { this.target = target; return this; } @@ -150,17 +137,6 @@ public Builder requiredConfig(RequiredConfig requiredConfig) { return this; } - /** - * Set the type. - * - * @param type the type - * @return the CreateRuleOptions builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - /** * Set the version. * @@ -230,7 +206,6 @@ protected CreateRuleOptions(Builder builder) { description = builder.description; target = builder.target; requiredConfig = builder.requiredConfig; - type = builder.type; version = builder.version; xImport = builder.xImport; labels = builder.labels; @@ -265,7 +240,7 @@ public String description() { * * @return the target */ - public Target target() { + public TargetPrototype target() { return target; } @@ -280,17 +255,6 @@ public RequiredConfig requiredConfig() { return requiredConfig; } - /** - * Gets the type. - * - * The rule type (user_defined or system_defined). - * - * @return the type - */ - public String type() { - return type; - } - /** * Gets the version. * diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java index 308a90b2..aea57c50 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptions.java @@ -19,7 +19,7 @@ */ public class DeleteCustomProfileOptions extends GenericModel { - protected String profilesId; + protected String profileId; protected String xCorrelationId; protected String xRequestId; @@ -27,7 +27,7 @@ public class DeleteCustomProfileOptions extends GenericModel { * Builder. */ public static class Builder { - private String profilesId; + private String profileId; private String xCorrelationId; private String xRequestId; @@ -37,7 +37,7 @@ public static class Builder { * @param deleteCustomProfileOptions the instance to initialize the Builder with */ private Builder(DeleteCustomProfileOptions deleteCustomProfileOptions) { - this.profilesId = deleteCustomProfileOptions.profilesId; + this.profileId = deleteCustomProfileOptions.profileId; this.xCorrelationId = deleteCustomProfileOptions.xCorrelationId; this.xRequestId = deleteCustomProfileOptions.xRequestId; } @@ -51,10 +51,10 @@ public Builder() { /** * Instantiates a new builder with required properties. * - * @param profilesId the profilesId + * @param profileId the profileId */ - public Builder(String profilesId) { - this.profilesId = profilesId; + public Builder(String profileId) { + this.profileId = profileId; } /** @@ -67,13 +67,13 @@ public DeleteCustomProfileOptions build() { } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the DeleteCustomProfileOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -103,9 +103,9 @@ public Builder xRequestId(String xRequestId) { protected DeleteCustomProfileOptions() { } protected DeleteCustomProfileOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); - profilesId = builder.profilesId; + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); + profileId = builder.profileId; xCorrelationId = builder.xCorrelationId; xRequestId = builder.xRequestId; } @@ -120,14 +120,14 @@ public Builder newBuilder() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java index 8ec59574..55c596e1 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptions.java @@ -20,7 +20,7 @@ public class DeleteProfileAttachmentOptions extends GenericModel { protected String attachmentId; - protected String profilesId; + protected String profileId; protected String xCorrelationId; protected String xRequestId; @@ -29,7 +29,7 @@ public class DeleteProfileAttachmentOptions extends GenericModel { */ public static class Builder { private String attachmentId; - private String profilesId; + private String profileId; private String xCorrelationId; private String xRequestId; @@ -40,7 +40,7 @@ public static class Builder { */ private Builder(DeleteProfileAttachmentOptions deleteProfileAttachmentOptions) { this.attachmentId = deleteProfileAttachmentOptions.attachmentId; - this.profilesId = deleteProfileAttachmentOptions.profilesId; + this.profileId = deleteProfileAttachmentOptions.profileId; this.xCorrelationId = deleteProfileAttachmentOptions.xCorrelationId; this.xRequestId = deleteProfileAttachmentOptions.xRequestId; } @@ -55,11 +55,11 @@ public Builder() { * Instantiates a new builder with required properties. * * @param attachmentId the attachmentId - * @param profilesId the profilesId + * @param profileId the profileId */ - public Builder(String attachmentId, String profilesId) { + public Builder(String attachmentId, String profileId) { this.attachmentId = attachmentId; - this.profilesId = profilesId; + this.profileId = profileId; } /** @@ -83,13 +83,13 @@ public Builder attachmentId(String attachmentId) { } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the DeleteProfileAttachmentOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -121,10 +121,10 @@ protected DeleteProfileAttachmentOptions() { } protected DeleteProfileAttachmentOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, "attachmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); attachmentId = builder.attachmentId; - profilesId = builder.profilesId; + profileId = builder.profileId; xCorrelationId = builder.xCorrelationId; xRequestId = builder.xRequestId; } @@ -150,14 +150,14 @@ public String attachmentId() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java index ff38879a..4fd305d4 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptions.java @@ -20,7 +20,7 @@ public class GetProfileAttachmentOptions extends GenericModel { protected String attachmentId; - protected String profilesId; + protected String profileId; protected String xCorrelationId; protected String xRequestId; @@ -29,7 +29,7 @@ public class GetProfileAttachmentOptions extends GenericModel { */ public static class Builder { private String attachmentId; - private String profilesId; + private String profileId; private String xCorrelationId; private String xRequestId; @@ -40,7 +40,7 @@ public static class Builder { */ private Builder(GetProfileAttachmentOptions getProfileAttachmentOptions) { this.attachmentId = getProfileAttachmentOptions.attachmentId; - this.profilesId = getProfileAttachmentOptions.profilesId; + this.profileId = getProfileAttachmentOptions.profileId; this.xCorrelationId = getProfileAttachmentOptions.xCorrelationId; this.xRequestId = getProfileAttachmentOptions.xRequestId; } @@ -55,11 +55,11 @@ public Builder() { * Instantiates a new builder with required properties. * * @param attachmentId the attachmentId - * @param profilesId the profilesId + * @param profileId the profileId */ - public Builder(String attachmentId, String profilesId) { + public Builder(String attachmentId, String profileId) { this.attachmentId = attachmentId; - this.profilesId = profilesId; + this.profileId = profileId; } /** @@ -83,13 +83,13 @@ public Builder attachmentId(String attachmentId) { } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the GetProfileAttachmentOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -121,10 +121,10 @@ protected GetProfileAttachmentOptions() { } protected GetProfileAttachmentOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, "attachmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); attachmentId = builder.attachmentId; - profilesId = builder.profilesId; + profileId = builder.profileId; xCorrelationId = builder.xCorrelationId; xRequestId = builder.xRequestId; } @@ -150,14 +150,14 @@ public String attachmentId() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java index 8268a433..f2715f56 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptions.java @@ -19,7 +19,7 @@ */ public class GetProfileOptions extends GenericModel { - protected String profilesId; + protected String profileId; protected String xCorrelationId; protected String xRequestId; @@ -27,7 +27,7 @@ public class GetProfileOptions extends GenericModel { * Builder. */ public static class Builder { - private String profilesId; + private String profileId; private String xCorrelationId; private String xRequestId; @@ -37,7 +37,7 @@ public static class Builder { * @param getProfileOptions the instance to initialize the Builder with */ private Builder(GetProfileOptions getProfileOptions) { - this.profilesId = getProfileOptions.profilesId; + this.profileId = getProfileOptions.profileId; this.xCorrelationId = getProfileOptions.xCorrelationId; this.xRequestId = getProfileOptions.xRequestId; } @@ -51,10 +51,10 @@ public Builder() { /** * Instantiates a new builder with required properties. * - * @param profilesId the profilesId + * @param profileId the profileId */ - public Builder(String profilesId) { - this.profilesId = profilesId; + public Builder(String profileId) { + this.profileId = profileId; } /** @@ -67,13 +67,13 @@ public GetProfileOptions build() { } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the GetProfileOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -103,9 +103,9 @@ public Builder xRequestId(String xRequestId) { protected GetProfileOptions() { } protected GetProfileOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); - profilesId = builder.profilesId; + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); + profileId = builder.profileId; xCorrelationId = builder.xCorrelationId; xRequestId = builder.xRequestId; } @@ -120,14 +120,14 @@ public Builder newBuilder() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java index 2d40b1fd..30d518c5 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptions.java @@ -19,7 +19,7 @@ */ public class ListAttachmentsOptions extends GenericModel { - protected String profilesId; + protected String profileId; protected String xCorrelationId; protected String xRequestId; protected Long limit; @@ -29,7 +29,7 @@ public class ListAttachmentsOptions extends GenericModel { * Builder. */ public static class Builder { - private String profilesId; + private String profileId; private String xCorrelationId; private String xRequestId; private Long limit; @@ -41,7 +41,7 @@ public static class Builder { * @param listAttachmentsOptions the instance to initialize the Builder with */ private Builder(ListAttachmentsOptions listAttachmentsOptions) { - this.profilesId = listAttachmentsOptions.profilesId; + this.profileId = listAttachmentsOptions.profileId; this.xCorrelationId = listAttachmentsOptions.xCorrelationId; this.xRequestId = listAttachmentsOptions.xRequestId; this.limit = listAttachmentsOptions.limit; @@ -57,10 +57,10 @@ public Builder() { /** * Instantiates a new builder with required properties. * - * @param profilesId the profilesId + * @param profileId the profileId */ - public Builder(String profilesId) { - this.profilesId = profilesId; + public Builder(String profileId) { + this.profileId = profileId; } /** @@ -73,13 +73,13 @@ public ListAttachmentsOptions build() { } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the ListAttachmentsOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -131,9 +131,9 @@ public Builder start(String start) { protected ListAttachmentsOptions() { } protected ListAttachmentsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); - profilesId = builder.profilesId; + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); + profileId = builder.profileId; xCorrelationId = builder.xCorrelationId; xRequestId = builder.xRequestId; limit = builder.limit; @@ -150,14 +150,14 @@ public Builder newBuilder() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java index 526be369..50c24557 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptions.java @@ -37,8 +37,10 @@ public interface Status { protected String xCorrelationId; protected String xRequestId; protected String assessmentId; + protected String assessmentMethod; protected String componentId; protected String targetId; + protected String targetEnv; protected String targetName; protected String status; protected String start; @@ -52,8 +54,10 @@ public static class Builder { private String xCorrelationId; private String xRequestId; private String assessmentId; + private String assessmentMethod; private String componentId; private String targetId; + private String targetEnv; private String targetName; private String status; private String start; @@ -69,8 +73,10 @@ private Builder(ListReportEvaluationsOptions listReportEvaluationsOptions) { this.xCorrelationId = listReportEvaluationsOptions.xCorrelationId; this.xRequestId = listReportEvaluationsOptions.xRequestId; this.assessmentId = listReportEvaluationsOptions.assessmentId; + this.assessmentMethod = listReportEvaluationsOptions.assessmentMethod; this.componentId = listReportEvaluationsOptions.componentId; this.targetId = listReportEvaluationsOptions.targetId; + this.targetEnv = listReportEvaluationsOptions.targetEnv; this.targetName = listReportEvaluationsOptions.targetName; this.status = listReportEvaluationsOptions.status; this.start = listReportEvaluationsOptions.start; @@ -145,6 +151,17 @@ public Builder assessmentId(String assessmentId) { return this; } + /** + * Set the assessmentMethod. + * + * @param assessmentMethod the assessmentMethod + * @return the ListReportEvaluationsOptions builder + */ + public Builder assessmentMethod(String assessmentMethod) { + this.assessmentMethod = assessmentMethod; + return this; + } + /** * Set the componentId. * @@ -167,6 +184,17 @@ public Builder targetId(String targetId) { return this; } + /** + * Set the targetEnv. + * + * @param targetEnv the targetEnv + * @return the ListReportEvaluationsOptions builder + */ + public Builder targetEnv(String targetEnv) { + this.targetEnv = targetEnv; + return this; + } + /** * Set the targetName. * @@ -221,8 +249,10 @@ protected ListReportEvaluationsOptions(Builder builder) { xCorrelationId = builder.xCorrelationId; xRequestId = builder.xRequestId; assessmentId = builder.assessmentId; + assessmentMethod = builder.assessmentMethod; componentId = builder.componentId; targetId = builder.targetId; + targetEnv = builder.targetEnv; targetName = builder.targetName; status = builder.status; start = builder.start; @@ -286,6 +316,17 @@ public String assessmentId() { return assessmentId; } + /** + * Gets the assessmentMethod. + * + * The assessment method. + * + * @return the assessmentMethod + */ + public String assessmentMethod() { + return assessmentMethod; + } + /** * Gets the componentId. * @@ -308,6 +349,17 @@ public String targetId() { return targetId; } + /** + * Gets the targetEnv. + * + * The environment of the evaluation target. + * + * @return the targetEnv + */ + public String targetEnv() { + return targetEnv; + } + /** * Gets the targetName. * diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java index 53d41102..60203c0b 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java @@ -18,7 +18,7 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The response body to get all profiles that are linked to your account. + * The response body to list all profiles that are linked to your account. */ public class ProfileCollection extends GenericModel { diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceAttributes.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceAttributes.java new file mode 100644 index 00000000..16b9d4bf --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceAttributes.java @@ -0,0 +1,27 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.google.gson.reflect.TypeToken; +import com.ibm.cloud.sdk.core.service.model.DynamicModel; + +/** + * The attributes for connecting to the provider type instance. + */ +public class ProviderTypeInstanceAttributes extends DynamicModel { + + + public ProviderTypeInstanceAttributes() { + super(new TypeToken() { }); + } +} diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java index 1b47ce9e..795f87a9 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItem.java @@ -13,7 +13,6 @@ package com.ibm.cloud.security_and_compliance_center_api.v3.model; import java.util.Date; -import java.util.Map; import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -26,7 +25,7 @@ public class ProviderTypeInstanceItem extends GenericModel { protected String id; protected String type; protected String name; - protected Map attributes; + protected ProviderTypeInstanceAttributes attributes; @SerializedName("created_at") protected Date createdAt; @SerializedName("updated_at") @@ -74,7 +73,7 @@ public String getName() { * * @return the attributes */ - public Map getAttributes() { + public ProviderTypeInstanceAttributes getAttributes() { return attributes; } diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java index 5f4f9659..651a91ce 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptions.java @@ -46,9 +46,8 @@ public interface Schedule { } protected String attachmentId; - protected String profilesId; - protected String id; protected String profileId; + protected String id; protected String accountId; protected String instanceId; protected List scope; @@ -72,9 +71,8 @@ public interface Schedule { */ public static class Builder { private String attachmentId; - private String profilesId; - private String id; private String profileId; + private String id; private String accountId; private String instanceId; private List scope; @@ -100,9 +98,8 @@ public static class Builder { */ private Builder(ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions) { this.attachmentId = replaceProfileAttachmentOptions.attachmentId; - this.profilesId = replaceProfileAttachmentOptions.profilesId; - this.id = replaceProfileAttachmentOptions.id; this.profileId = replaceProfileAttachmentOptions.profileId; + this.id = replaceProfileAttachmentOptions.id; this.accountId = replaceProfileAttachmentOptions.accountId; this.instanceId = replaceProfileAttachmentOptions.instanceId; this.scope = replaceProfileAttachmentOptions.scope; @@ -132,11 +129,11 @@ public Builder() { * Instantiates a new builder with required properties. * * @param attachmentId the attachmentId - * @param profilesId the profilesId + * @param profileId the profileId */ - public Builder(String attachmentId, String profilesId) { + public Builder(String attachmentId, String profileId) { this.attachmentId = attachmentId; - this.profilesId = profilesId; + this.profileId = profileId; } /** @@ -192,13 +189,13 @@ public Builder attachmentId(String attachmentId) { } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the ReplaceProfileAttachmentOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -213,17 +210,6 @@ public Builder id(String id) { return this; } - /** - * Set the profileId. - * - * @param profileId the profileId - * @return the ReplaceProfileAttachmentOptions builder - */ - public Builder profileId(String profileId) { - this.profileId = profileId; - return this; - } - /** * Set the accountId. * @@ -446,10 +432,9 @@ protected ReplaceProfileAttachmentOptions() { } protected ReplaceProfileAttachmentOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.attachmentId, "attachmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); attachmentId = builder.attachmentId; - profilesId = builder.profilesId; id = builder.id; profileId = builder.profileId; accountId = builder.accountId; @@ -492,14 +477,14 @@ public String attachmentId() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** @@ -513,17 +498,6 @@ public String id() { return id; } - /** - * Gets the profileId. - * - * The ID of the profile that is specified in the attachment. - * - * @return the profileId - */ - public String profileId() { - return profileId; - } - /** * Gets the accountId. * diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java index 678a66f9..e17b22ee 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptions.java @@ -32,7 +32,7 @@ public interface ProfileType { String CUSTOM = "custom"; } - protected String profilesId; + protected String profileId; protected String profileName; protected String profileDescription; protected String profileType; @@ -45,7 +45,7 @@ public interface ProfileType { * Builder. */ public static class Builder { - private String profilesId; + private String profileId; private String profileName; private String profileDescription; private String profileType; @@ -60,7 +60,7 @@ public static class Builder { * @param replaceProfileOptions the instance to initialize the Builder with */ private Builder(ReplaceProfileOptions replaceProfileOptions) { - this.profilesId = replaceProfileOptions.profilesId; + this.profileId = replaceProfileOptions.profileId; this.profileName = replaceProfileOptions.profileName; this.profileDescription = replaceProfileOptions.profileDescription; this.profileType = replaceProfileOptions.profileType; @@ -79,15 +79,15 @@ public Builder() { /** * Instantiates a new builder with required properties. * - * @param profilesId the profilesId + * @param profileId the profileId * @param profileName the profileName * @param profileDescription the profileDescription * @param profileType the profileType * @param controls the controls * @param defaultParameters the defaultParameters */ - public Builder(String profilesId, String profileName, String profileDescription, String profileType, List controls, List defaultParameters) { - this.profilesId = profilesId; + public Builder(String profileId, String profileName, String profileDescription, String profileType, List controls, List defaultParameters) { + this.profileId = profileId; this.profileName = profileName; this.profileDescription = profileDescription; this.profileType = profileType; @@ -137,13 +137,13 @@ public Builder addDefaultParameters(DefaultParametersPrototype defaultParameters } /** - * Set the profilesId. + * Set the profileId. * - * @param profilesId the profilesId + * @param profileId the profileId * @return the ReplaceProfileOptions builder */ - public Builder profilesId(String profilesId) { - this.profilesId = profilesId; + public Builder profileId(String profileId) { + this.profileId = profileId; return this; } @@ -230,8 +230,8 @@ public Builder xRequestId(String xRequestId) { protected ReplaceProfileOptions() { } protected ReplaceProfileOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profilesId, - "profilesId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.profileId, + "profileId cannot be empty"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileName, "profileName cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profileDescription, @@ -242,7 +242,7 @@ protected ReplaceProfileOptions(Builder builder) { "controls cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.defaultParameters, "defaultParameters cannot be null"); - profilesId = builder.profilesId; + profileId = builder.profileId; profileName = builder.profileName; profileDescription = builder.profileDescription; profileType = builder.profileType; @@ -262,14 +262,14 @@ public Builder newBuilder() { } /** - * Gets the profilesId. + * Gets the profileId. * * The profile ID. * - * @return the profilesId + * @return the profileId */ - public String profilesId() { - return profilesId; + public String profileId() { + return profileId; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java index b67745db..d5355387 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java @@ -22,22 +22,11 @@ */ public class ReplaceRuleOptions extends GenericModel { - /** - * The rule type (user_defined or system_defined). - */ - public interface Type { - /** user_defined. */ - String USER_DEFINED = "user_defined"; - /** system_defined. */ - String SYSTEM_DEFINED = "system_defined"; - } - protected String ruleId; protected String ifMatch; protected String description; - protected Target target; + protected TargetPrototype target; protected RequiredConfig requiredConfig; - protected String type; protected String version; protected Import xImport; protected List labels; @@ -51,9 +40,8 @@ public static class Builder { private String ruleId; private String ifMatch; private String description; - private Target target; + private TargetPrototype target; private RequiredConfig requiredConfig; - private String type; private String version; private Import xImport; private List labels; @@ -71,7 +59,6 @@ private Builder(ReplaceRuleOptions replaceRuleOptions) { this.description = replaceRuleOptions.description; this.target = replaceRuleOptions.target; this.requiredConfig = replaceRuleOptions.requiredConfig; - this.type = replaceRuleOptions.type; this.version = replaceRuleOptions.version; this.xImport = replaceRuleOptions.xImport; this.labels = replaceRuleOptions.labels; @@ -94,7 +81,7 @@ public Builder() { * @param target the target * @param requiredConfig the requiredConfig */ - public Builder(String ruleId, String ifMatch, String description, Target target, RequiredConfig requiredConfig) { + public Builder(String ruleId, String ifMatch, String description, TargetPrototype target, RequiredConfig requiredConfig) { this.ruleId = ruleId; this.ifMatch = ifMatch; this.description = description; @@ -166,7 +153,7 @@ public Builder description(String description) { * @param target the target * @return the ReplaceRuleOptions builder */ - public Builder target(Target target) { + public Builder target(TargetPrototype target) { this.target = target; return this; } @@ -182,17 +169,6 @@ public Builder requiredConfig(RequiredConfig requiredConfig) { return this; } - /** - * Set the type. - * - * @param type the type - * @return the ReplaceRuleOptions builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - /** * Set the version. * @@ -268,7 +244,6 @@ protected ReplaceRuleOptions(Builder builder) { description = builder.description; target = builder.target; requiredConfig = builder.requiredConfig; - type = builder.type; version = builder.version; xImport = builder.xImport; labels = builder.labels; @@ -329,7 +304,7 @@ public String description() { * * @return the target */ - public Target target() { + public TargetPrototype target() { return target; } @@ -344,17 +319,6 @@ public RequiredConfig requiredConfig() { return requiredConfig; } - /** - * Gets the type. - * - * The rule type (user_defined or system_defined). - * - * @return the type - */ - public String type() { - return type; - } - /** * Gets the version. * diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java index 8c45af75..fd4440a6 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfig.java @@ -20,8 +20,8 @@ * The required configurations. * * Classes which extend this class: - * - RequiredConfigRequiredConfigAnd - * - RequiredConfigRequiredConfigOr + * - RequiredConfigAnd + * - RequiredConfigOr * - RequiredConfigRequiredConfigBase */ public class RequiredConfig extends GenericModel { diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAnd.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigAnd.java similarity index 67% rename from modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAnd.java rename to modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigAnd.java index 4f37e79d..ad7c0286 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAnd.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigAnd.java @@ -16,9 +16,9 @@ import java.util.List; /** - * RequiredConfigRequiredConfigAnd. + * RequiredConfigAnd. */ -public class RequiredConfigRequiredConfigAnd extends RequiredConfig { +public class RequiredConfigAnd extends RequiredConfig { /** @@ -29,13 +29,13 @@ public static class Builder { private List and; /** - * Instantiates a new Builder from an existing RequiredConfigRequiredConfigAnd instance. + * Instantiates a new Builder from an existing RequiredConfigAnd instance. * - * @param requiredConfigRequiredConfigAnd the instance to initialize the Builder with + * @param requiredConfigAnd the instance to initialize the Builder with */ - public Builder(RequiredConfig requiredConfigRequiredConfigAnd) { - this.description = requiredConfigRequiredConfigAnd.description; - this.and = requiredConfigRequiredConfigAnd.and; + public Builder(RequiredConfig requiredConfigAnd) { + this.description = requiredConfigAnd.description; + this.and = requiredConfigAnd.and; } /** @@ -45,19 +45,19 @@ public Builder() { } /** - * Builds a RequiredConfigRequiredConfigAnd. + * Builds a RequiredConfigAnd. * - * @return the new RequiredConfigRequiredConfigAnd instance + * @return the new RequiredConfigAnd instance */ - public RequiredConfigRequiredConfigAnd build() { - return new RequiredConfigRequiredConfigAnd(this); + public RequiredConfigAnd build() { + return new RequiredConfigAnd(this); } /** * Adds an and to and. * * @param and the new and - * @return the RequiredConfigRequiredConfigAnd builder + * @return the RequiredConfigAnd builder */ public Builder addAnd(RequiredConfigItems and) { com.ibm.cloud.sdk.core.util.Validator.notNull(and, @@ -73,7 +73,7 @@ public Builder addAnd(RequiredConfigItems and) { * Set the description. * * @param description the description - * @return the RequiredConfigRequiredConfigAnd builder + * @return the RequiredConfigAnd builder */ public Builder description(String description) { this.description = description; @@ -85,7 +85,7 @@ public Builder description(String description) { * Existing and will be replaced. * * @param and the and - * @return the RequiredConfigRequiredConfigAnd builder + * @return the RequiredConfigAnd builder */ public Builder and(List and) { this.and = and; @@ -93,9 +93,9 @@ public Builder and(List and) { } } - protected RequiredConfigRequiredConfigAnd() { } + protected RequiredConfigAnd() { } - protected RequiredConfigRequiredConfigAnd(Builder builder) { + protected RequiredConfigAnd(Builder builder) { description = builder.description; and = builder.and; } @@ -103,7 +103,7 @@ protected RequiredConfigRequiredConfigAnd(Builder builder) { /** * New builder. * - * @return a RequiredConfigRequiredConfigAnd builder + * @return a RequiredConfigAnd builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBase.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBase.java new file mode 100644 index 00000000..1828f57b --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBase.java @@ -0,0 +1,237 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The required configuration base object. + */ +public class RequiredConfigBase extends GenericModel { + + /** + * The operator. + */ + public interface Operator { + /** string_equals. */ + String STRING_EQUALS = "string_equals"; + /** string_not_equals. */ + String STRING_NOT_EQUALS = "string_not_equals"; + /** string_match. */ + String STRING_MATCH = "string_match"; + /** string_not_match. */ + String STRING_NOT_MATCH = "string_not_match"; + /** string_contains. */ + String STRING_CONTAINS = "string_contains"; + /** string_not_contains. */ + String STRING_NOT_CONTAINS = "string_not_contains"; + /** num_equals. */ + String NUM_EQUALS = "num_equals"; + /** num_not_equals. */ + String NUM_NOT_EQUALS = "num_not_equals"; + /** num_less_than. */ + String NUM_LESS_THAN = "num_less_than"; + /** num_less_than_equals. */ + String NUM_LESS_THAN_EQUALS = "num_less_than_equals"; + /** num_greater_than. */ + String NUM_GREATER_THAN = "num_greater_than"; + /** num_greater_than_equals. */ + String NUM_GREATER_THAN_EQUALS = "num_greater_than_equals"; + /** is_empty. */ + String IS_EMPTY = "is_empty"; + /** is_not_empty. */ + String IS_NOT_EMPTY = "is_not_empty"; + /** is_true. */ + String IS_TRUE = "is_true"; + /** is_false. */ + String IS_FALSE = "is_false"; + /** strings_in_list. */ + String STRINGS_IN_LIST = "strings_in_list"; + /** strings_allowed. */ + String STRINGS_ALLOWED = "strings_allowed"; + /** strings_required. */ + String STRINGS_REQUIRED = "strings_required"; + /** ips_in_range. */ + String IPS_IN_RANGE = "ips_in_range"; + /** ips_equals. */ + String IPS_EQUALS = "ips_equals"; + /** ips_not_equals. */ + String IPS_NOT_EQUALS = "ips_not_equals"; + /** days_less_than. */ + String DAYS_LESS_THAN = "days_less_than"; + } + + protected String description; + protected String property; + protected String operator; + protected Object value; + + /** + * Builder. + */ + public static class Builder { + private String description; + private String property; + private String operator; + private Object value; + + /** + * Instantiates a new Builder from an existing RequiredConfigBase instance. + * + * @param requiredConfigBase the instance to initialize the Builder with + */ + private Builder(RequiredConfigBase requiredConfigBase) { + this.description = requiredConfigBase.description; + this.property = requiredConfigBase.property; + this.operator = requiredConfigBase.operator; + this.value = requiredConfigBase.value; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param property the property + * @param operator the operator + */ + public Builder(String property, String operator) { + this.property = property; + this.operator = operator; + } + + /** + * Builds a RequiredConfigBase. + * + * @return the new RequiredConfigBase instance + */ + public RequiredConfigBase build() { + return new RequiredConfigBase(this); + } + + /** + * Set the description. + * + * @param description the description + * @return the RequiredConfigBase builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the property. + * + * @param property the property + * @return the RequiredConfigBase builder + */ + public Builder property(String property) { + this.property = property; + return this; + } + + /** + * Set the operator. + * + * @param operator the operator + * @return the RequiredConfigBase builder + */ + public Builder operator(String operator) { + this.operator = operator; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the RequiredConfigBase builder + */ + public Builder value(Object value) { + this.value = value; + return this; + } + } + + protected RequiredConfigBase() { } + + protected RequiredConfigBase(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.property, + "property cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operator, + "operator cannot be null"); + description = builder.description; + property = builder.property; + operator = builder.operator; + value = builder.value; + } + + /** + * New builder. + * + * @return a RequiredConfigBase builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the description. + * + * The required config description. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the property. + * + * The property. + * + * @return the property + */ + public String property() { + return property; + } + + /** + * Gets the operator. + * + * The operator. + * + * @return the operator + */ + public String operator() { + return operator; + } + + /** + * Gets the value. + * + * Schema for any JSON type. + * + * @return the value + */ + public Object value() { + return value; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java index 4f3247ef..744bd013 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItems.java @@ -20,8 +20,8 @@ * RequiredConfigItems. * * Classes which extend this class: - * - RequiredConfigItemsRequiredConfigOr - * - RequiredConfigItemsRequiredConfigAnd + * - RequiredConfigItemsRequiredConfigOrDepth1 + * - RequiredConfigItemsRequiredConfigAndDepth1 * - RequiredConfigItemsRequiredConfigBase */ public class RequiredConfigItems extends GenericModel { @@ -79,8 +79,8 @@ public interface Operator { } protected String description; - protected List or; - protected List and; + protected List or; + protected List and; protected String property; protected String operator; protected Object value; @@ -105,7 +105,7 @@ public String description() { * * @return the or */ - public List or() { + public List or() { return or; } @@ -116,7 +116,7 @@ public List or() { * * @return the and */ - public List and() { + public List and() { return and; } diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAnd.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndDepth1.java similarity index 58% rename from modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAnd.java rename to modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndDepth1.java index 86889ed2..d1090c14 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAnd.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndDepth1.java @@ -16,9 +16,9 @@ import java.util.List; /** - * RequiredConfigItemsRequiredConfigAnd. + * RequiredConfigItemsRequiredConfigAndDepth1. */ -public class RequiredConfigItemsRequiredConfigAnd extends RequiredConfigItems { +public class RequiredConfigItemsRequiredConfigAndDepth1 extends RequiredConfigItems { /** @@ -26,16 +26,16 @@ public class RequiredConfigItemsRequiredConfigAnd extends RequiredConfigItems { */ public static class Builder { private String description; - private List and; + private List and; /** - * Instantiates a new Builder from an existing RequiredConfigItemsRequiredConfigAnd instance. + * Instantiates a new Builder from an existing RequiredConfigItemsRequiredConfigAndDepth1 instance. * - * @param requiredConfigItemsRequiredConfigAnd the instance to initialize the Builder with + * @param requiredConfigItemsRequiredConfigAndDepth1 the instance to initialize the Builder with */ - public Builder(RequiredConfigItems requiredConfigItemsRequiredConfigAnd) { - this.description = requiredConfigItemsRequiredConfigAnd.description; - this.and = requiredConfigItemsRequiredConfigAnd.and; + public Builder(RequiredConfigItems requiredConfigItemsRequiredConfigAndDepth1) { + this.description = requiredConfigItemsRequiredConfigAndDepth1.description; + this.and = requiredConfigItemsRequiredConfigAndDepth1.and; } /** @@ -45,25 +45,25 @@ public Builder() { } /** - * Builds a RequiredConfigItemsRequiredConfigAnd. + * Builds a RequiredConfigItemsRequiredConfigAndDepth1. * - * @return the new RequiredConfigItemsRequiredConfigAnd instance + * @return the new RequiredConfigItemsRequiredConfigAndDepth1 instance */ - public RequiredConfigItemsRequiredConfigAnd build() { - return new RequiredConfigItemsRequiredConfigAnd(this); + public RequiredConfigItemsRequiredConfigAndDepth1 build() { + return new RequiredConfigItemsRequiredConfigAndDepth1(this); } /** * Adds an and to and. * * @param and the new and - * @return the RequiredConfigItemsRequiredConfigAnd builder + * @return the RequiredConfigItemsRequiredConfigAndDepth1 builder */ - public Builder addAnd(RequiredConfigItems and) { + public Builder addAnd(RequiredConfigBase and) { com.ibm.cloud.sdk.core.util.Validator.notNull(and, "and cannot be null"); if (this.and == null) { - this.and = new ArrayList(); + this.and = new ArrayList(); } this.and.add(and); return this; @@ -73,7 +73,7 @@ public Builder addAnd(RequiredConfigItems and) { * Set the description. * * @param description the description - * @return the RequiredConfigItemsRequiredConfigAnd builder + * @return the RequiredConfigItemsRequiredConfigAndDepth1 builder */ public Builder description(String description) { this.description = description; @@ -85,17 +85,17 @@ public Builder description(String description) { * Existing and will be replaced. * * @param and the and - * @return the RequiredConfigItemsRequiredConfigAnd builder + * @return the RequiredConfigItemsRequiredConfigAndDepth1 builder */ - public Builder and(List and) { + public Builder and(List and) { this.and = and; return this; } } - protected RequiredConfigItemsRequiredConfigAnd() { } + protected RequiredConfigItemsRequiredConfigAndDepth1() { } - protected RequiredConfigItemsRequiredConfigAnd(Builder builder) { + protected RequiredConfigItemsRequiredConfigAndDepth1(Builder builder) { description = builder.description; and = builder.and; } @@ -103,7 +103,7 @@ protected RequiredConfigItemsRequiredConfigAnd(Builder builder) { /** * New builder. * - * @return a RequiredConfigItemsRequiredConfigAnd builder + * @return a RequiredConfigItemsRequiredConfigAndDepth1 builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOr.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrDepth1.java similarity index 60% rename from modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOr.java rename to modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrDepth1.java index cce73931..40de3876 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOr.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrDepth1.java @@ -18,7 +18,7 @@ /** * The `OR` required configurations. */ -public class RequiredConfigItemsRequiredConfigOr extends RequiredConfigItems { +public class RequiredConfigItemsRequiredConfigOrDepth1 extends RequiredConfigItems { /** @@ -26,16 +26,16 @@ public class RequiredConfigItemsRequiredConfigOr extends RequiredConfigItems { */ public static class Builder { private String description; - private List or; + private List or; /** - * Instantiates a new Builder from an existing RequiredConfigItemsRequiredConfigOr instance. + * Instantiates a new Builder from an existing RequiredConfigItemsRequiredConfigOrDepth1 instance. * - * @param requiredConfigItemsRequiredConfigOr the instance to initialize the Builder with + * @param requiredConfigItemsRequiredConfigOrDepth1 the instance to initialize the Builder with */ - public Builder(RequiredConfigItems requiredConfigItemsRequiredConfigOr) { - this.description = requiredConfigItemsRequiredConfigOr.description; - this.or = requiredConfigItemsRequiredConfigOr.or; + public Builder(RequiredConfigItems requiredConfigItemsRequiredConfigOrDepth1) { + this.description = requiredConfigItemsRequiredConfigOrDepth1.description; + this.or = requiredConfigItemsRequiredConfigOrDepth1.or; } /** @@ -45,25 +45,25 @@ public Builder() { } /** - * Builds a RequiredConfigItemsRequiredConfigOr. + * Builds a RequiredConfigItemsRequiredConfigOrDepth1. * - * @return the new RequiredConfigItemsRequiredConfigOr instance + * @return the new RequiredConfigItemsRequiredConfigOrDepth1 instance */ - public RequiredConfigItemsRequiredConfigOr build() { - return new RequiredConfigItemsRequiredConfigOr(this); + public RequiredConfigItemsRequiredConfigOrDepth1 build() { + return new RequiredConfigItemsRequiredConfigOrDepth1(this); } /** * Adds an or to or. * * @param or the new or - * @return the RequiredConfigItemsRequiredConfigOr builder + * @return the RequiredConfigItemsRequiredConfigOrDepth1 builder */ - public Builder addOr(RequiredConfigItems or) { + public Builder addOr(RequiredConfigBase or) { com.ibm.cloud.sdk.core.util.Validator.notNull(or, "or cannot be null"); if (this.or == null) { - this.or = new ArrayList(); + this.or = new ArrayList(); } this.or.add(or); return this; @@ -73,7 +73,7 @@ public Builder addOr(RequiredConfigItems or) { * Set the description. * * @param description the description - * @return the RequiredConfigItemsRequiredConfigOr builder + * @return the RequiredConfigItemsRequiredConfigOrDepth1 builder */ public Builder description(String description) { this.description = description; @@ -85,17 +85,17 @@ public Builder description(String description) { * Existing or will be replaced. * * @param or the or - * @return the RequiredConfigItemsRequiredConfigOr builder + * @return the RequiredConfigItemsRequiredConfigOrDepth1 builder */ - public Builder or(List or) { + public Builder or(List or) { this.or = or; return this; } } - protected RequiredConfigItemsRequiredConfigOr() { } + protected RequiredConfigItemsRequiredConfigOrDepth1() { } - protected RequiredConfigItemsRequiredConfigOr(Builder builder) { + protected RequiredConfigItemsRequiredConfigOrDepth1(Builder builder) { description = builder.description; or = builder.or; } @@ -103,7 +103,7 @@ protected RequiredConfigItemsRequiredConfigOr(Builder builder) { /** * New builder. * - * @return a RequiredConfigItemsRequiredConfigOr builder + * @return a RequiredConfigItemsRequiredConfigOrDepth1 builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOr.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigOr.java similarity index 68% rename from modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOr.java rename to modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigOr.java index dbacdc0e..a78cf501 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOr.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigOr.java @@ -18,7 +18,7 @@ /** * The `OR` required configurations. */ -public class RequiredConfigRequiredConfigOr extends RequiredConfig { +public class RequiredConfigOr extends RequiredConfig { /** @@ -29,13 +29,13 @@ public static class Builder { private List or; /** - * Instantiates a new Builder from an existing RequiredConfigRequiredConfigOr instance. + * Instantiates a new Builder from an existing RequiredConfigOr instance. * - * @param requiredConfigRequiredConfigOr the instance to initialize the Builder with + * @param requiredConfigOr the instance to initialize the Builder with */ - public Builder(RequiredConfig requiredConfigRequiredConfigOr) { - this.description = requiredConfigRequiredConfigOr.description; - this.or = requiredConfigRequiredConfigOr.or; + public Builder(RequiredConfig requiredConfigOr) { + this.description = requiredConfigOr.description; + this.or = requiredConfigOr.or; } /** @@ -45,19 +45,19 @@ public Builder() { } /** - * Builds a RequiredConfigRequiredConfigOr. + * Builds a RequiredConfigOr. * - * @return the new RequiredConfigRequiredConfigOr instance + * @return the new RequiredConfigOr instance */ - public RequiredConfigRequiredConfigOr build() { - return new RequiredConfigRequiredConfigOr(this); + public RequiredConfigOr build() { + return new RequiredConfigOr(this); } /** * Adds an or to or. * * @param or the new or - * @return the RequiredConfigRequiredConfigOr builder + * @return the RequiredConfigOr builder */ public Builder addOr(RequiredConfigItems or) { com.ibm.cloud.sdk.core.util.Validator.notNull(or, @@ -73,7 +73,7 @@ public Builder addOr(RequiredConfigItems or) { * Set the description. * * @param description the description - * @return the RequiredConfigRequiredConfigOr builder + * @return the RequiredConfigOr builder */ public Builder description(String description) { this.description = description; @@ -85,7 +85,7 @@ public Builder description(String description) { * Existing or will be replaced. * * @param or the or - * @return the RequiredConfigRequiredConfigOr builder + * @return the RequiredConfigOr builder */ public Builder or(List or) { this.or = or; @@ -93,9 +93,9 @@ public Builder or(List or) { } } - protected RequiredConfigRequiredConfigOr() { } + protected RequiredConfigOr() { } - protected RequiredConfigRequiredConfigOr(Builder builder) { + protected RequiredConfigOr(Builder builder) { description = builder.description; or = builder.or; } @@ -103,7 +103,7 @@ protected RequiredConfigRequiredConfigOr(Builder builder) { /** * New builder. * - * @return a RequiredConfigRequiredConfigOr builder + * @return a RequiredConfigOr builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java index 06193702..2709b610 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Target.java @@ -12,7 +12,6 @@ */ package com.ibm.cloud.security_and_compliance_center_api.v3.model; -import java.util.ArrayList; import java.util.List; import com.google.gson.annotations.SerializedName; @@ -32,137 +31,8 @@ public class Target extends GenericModel { @SerializedName("additional_target_attributes") protected List additionalTargetAttributes; - /** - * Builder. - */ - public static class Builder { - private String serviceName; - private String serviceDisplayName; - private String resourceKind; - private List additionalTargetAttributes; - - /** - * Instantiates a new Builder from an existing Target instance. - * - * @param target the instance to initialize the Builder with - */ - private Builder(Target target) { - this.serviceName = target.serviceName; - this.serviceDisplayName = target.serviceDisplayName; - this.resourceKind = target.resourceKind; - this.additionalTargetAttributes = target.additionalTargetAttributes; - } - - /** - * Instantiates a new builder. - */ - public Builder() { - } - - /** - * Instantiates a new builder with required properties. - * - * @param serviceName the serviceName - * @param resourceKind the resourceKind - */ - public Builder(String serviceName, String resourceKind) { - this.serviceName = serviceName; - this.resourceKind = resourceKind; - } - - /** - * Builds a Target. - * - * @return the new Target instance - */ - public Target build() { - return new Target(this); - } - - /** - * Adds an additionalTargetAttributes to additionalTargetAttributes. - * - * @param additionalTargetAttributes the new additionalTargetAttributes - * @return the Target builder - */ - public Builder addAdditionalTargetAttributes(AdditionalTargetAttribute additionalTargetAttributes) { - com.ibm.cloud.sdk.core.util.Validator.notNull(additionalTargetAttributes, - "additionalTargetAttributes cannot be null"); - if (this.additionalTargetAttributes == null) { - this.additionalTargetAttributes = new ArrayList(); - } - this.additionalTargetAttributes.add(additionalTargetAttributes); - return this; - } - - /** - * Set the serviceName. - * - * @param serviceName the serviceName - * @return the Target builder - */ - public Builder serviceName(String serviceName) { - this.serviceName = serviceName; - return this; - } - - /** - * Set the serviceDisplayName. - * - * @param serviceDisplayName the serviceDisplayName - * @return the Target builder - */ - public Builder serviceDisplayName(String serviceDisplayName) { - this.serviceDisplayName = serviceDisplayName; - return this; - } - - /** - * Set the resourceKind. - * - * @param resourceKind the resourceKind - * @return the Target builder - */ - public Builder resourceKind(String resourceKind) { - this.resourceKind = resourceKind; - return this; - } - - /** - * Set the additionalTargetAttributes. - * Existing additionalTargetAttributes will be replaced. - * - * @param additionalTargetAttributes the additionalTargetAttributes - * @return the Target builder - */ - public Builder additionalTargetAttributes(List additionalTargetAttributes) { - this.additionalTargetAttributes = additionalTargetAttributes; - return this; - } - } - protected Target() { } - protected Target(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.serviceName, - "serviceName cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resourceKind, - "resourceKind cannot be null"); - serviceName = builder.serviceName; - serviceDisplayName = builder.serviceDisplayName; - resourceKind = builder.resourceKind; - additionalTargetAttributes = builder.additionalTargetAttributes; - } - - /** - * New builder. - * - * @return a Target builder - */ - public Builder newBuilder() { - return new Builder(this); - } - /** * Gets the serviceName. * @@ -170,7 +40,7 @@ public Builder newBuilder() { * * @return the serviceName */ - public String serviceName() { + public String getServiceName() { return serviceName; } @@ -181,7 +51,7 @@ public String serviceName() { * * @return the serviceDisplayName */ - public String serviceDisplayName() { + public String getServiceDisplayName() { return serviceDisplayName; } @@ -192,18 +62,18 @@ public String serviceDisplayName() { * * @return the resourceKind */ - public String resourceKind() { + public String getResourceKind() { return resourceKind; } /** * Gets the additionalTargetAttributes. * - * The list of targets supported properties. + * The additional target attributes used to filter to a subset of resources. * * @return the additionalTargetAttributes */ - public List additionalTargetAttributes() { + public List getAdditionalTargetAttributes() { return additionalTargetAttributes; } } diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototype.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototype.java new file mode 100644 index 00000000..03d4400f --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototype.java @@ -0,0 +1,183 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The rule target. + */ +public class TargetPrototype extends GenericModel { + + @SerializedName("service_name") + protected String serviceName; + @SerializedName("resource_kind") + protected String resourceKind; + @SerializedName("additional_target_attributes") + protected List additionalTargetAttributes; + + /** + * Builder. + */ + public static class Builder { + private String serviceName; + private String resourceKind; + private List additionalTargetAttributes; + + /** + * Instantiates a new Builder from an existing TargetPrototype instance. + * + * @param targetPrototype the instance to initialize the Builder with + */ + private Builder(TargetPrototype targetPrototype) { + this.serviceName = targetPrototype.serviceName; + this.resourceKind = targetPrototype.resourceKind; + this.additionalTargetAttributes = targetPrototype.additionalTargetAttributes; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param serviceName the serviceName + * @param resourceKind the resourceKind + */ + public Builder(String serviceName, String resourceKind) { + this.serviceName = serviceName; + this.resourceKind = resourceKind; + } + + /** + * Builds a TargetPrototype. + * + * @return the new TargetPrototype instance + */ + public TargetPrototype build() { + return new TargetPrototype(this); + } + + /** + * Adds an additionalTargetAttributes to additionalTargetAttributes. + * + * @param additionalTargetAttributes the new additionalTargetAttributes + * @return the TargetPrototype builder + */ + public Builder addAdditionalTargetAttributes(AdditionalTargetAttribute additionalTargetAttributes) { + com.ibm.cloud.sdk.core.util.Validator.notNull(additionalTargetAttributes, + "additionalTargetAttributes cannot be null"); + if (this.additionalTargetAttributes == null) { + this.additionalTargetAttributes = new ArrayList(); + } + this.additionalTargetAttributes.add(additionalTargetAttributes); + return this; + } + + /** + * Set the serviceName. + * + * @param serviceName the serviceName + * @return the TargetPrototype builder + */ + public Builder serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Set the resourceKind. + * + * @param resourceKind the resourceKind + * @return the TargetPrototype builder + */ + public Builder resourceKind(String resourceKind) { + this.resourceKind = resourceKind; + return this; + } + + /** + * Set the additionalTargetAttributes. + * Existing additionalTargetAttributes will be replaced. + * + * @param additionalTargetAttributes the additionalTargetAttributes + * @return the TargetPrototype builder + */ + public Builder additionalTargetAttributes(List additionalTargetAttributes) { + this.additionalTargetAttributes = additionalTargetAttributes; + return this; + } + } + + protected TargetPrototype() { } + + protected TargetPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.serviceName, + "serviceName cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resourceKind, + "resourceKind cannot be null"); + serviceName = builder.serviceName; + resourceKind = builder.resourceKind; + additionalTargetAttributes = builder.additionalTargetAttributes; + } + + /** + * New builder. + * + * @return a TargetPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the serviceName. + * + * The target service name. + * + * @return the serviceName + */ + public String serviceName() { + return serviceName; + } + + /** + * Gets the resourceKind. + * + * The target resource kind. + * + * @return the resourceKind + */ + public String resourceKind() { + return resourceKind; + } + + /** + * Gets the additionalTargetAttributes. + * + * The additional target attributes used to filter to a subset of resources. + * + * @return the additionalTargetAttributes + */ + public List additionalTargetAttributes() { + return additionalTargetAttributes; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java index 270d946c..b6399c45 100644 --- a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptions.java @@ -12,8 +12,6 @@ */ package com.ibm.cloud.security_and_compliance_center_api.v3.model; -import java.util.Map; - import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -23,8 +21,7 @@ public class UpdateProviderTypeInstanceOptions extends GenericModel { protected String providerTypeId; protected String providerTypeInstanceId; - protected String name; - protected Map attributes; + protected UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequest; protected String xCorrelationId; protected String xRequestId; @@ -34,8 +31,7 @@ public class UpdateProviderTypeInstanceOptions extends GenericModel { public static class Builder { private String providerTypeId; private String providerTypeInstanceId; - private String name; - private Map attributes; + private UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequest; private String xCorrelationId; private String xRequestId; @@ -47,8 +43,7 @@ public static class Builder { private Builder(UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptions) { this.providerTypeId = updateProviderTypeInstanceOptions.providerTypeId; this.providerTypeInstanceId = updateProviderTypeInstanceOptions.providerTypeInstanceId; - this.name = updateProviderTypeInstanceOptions.name; - this.attributes = updateProviderTypeInstanceOptions.attributes; + this.updateProviderTypeInstanceRequest = updateProviderTypeInstanceOptions.updateProviderTypeInstanceRequest; this.xCorrelationId = updateProviderTypeInstanceOptions.xCorrelationId; this.xRequestId = updateProviderTypeInstanceOptions.xRequestId; } @@ -64,10 +59,12 @@ public Builder() { * * @param providerTypeId the providerTypeId * @param providerTypeInstanceId the providerTypeInstanceId + * @param updateProviderTypeInstanceRequest the updateProviderTypeInstanceRequest */ - public Builder(String providerTypeId, String providerTypeInstanceId) { + public Builder(String providerTypeId, String providerTypeInstanceId, UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequest) { this.providerTypeId = providerTypeId; this.providerTypeInstanceId = providerTypeInstanceId; + this.updateProviderTypeInstanceRequest = updateProviderTypeInstanceRequest; } /** @@ -102,24 +99,13 @@ public Builder providerTypeInstanceId(String providerTypeInstanceId) { } /** - * Set the name. - * - * @param name the name - * @return the UpdateProviderTypeInstanceOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the attributes. + * Set the updateProviderTypeInstanceRequest. * - * @param attributes the attributes + * @param updateProviderTypeInstanceRequest the updateProviderTypeInstanceRequest * @return the UpdateProviderTypeInstanceOptions builder */ - public Builder attributes(Map attributes) { - this.attributes = attributes; + public Builder updateProviderTypeInstanceRequest(UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequest) { + this.updateProviderTypeInstanceRequest = updateProviderTypeInstanceRequest; return this; } @@ -153,10 +139,11 @@ protected UpdateProviderTypeInstanceOptions(Builder builder) { "providerTypeId cannot be empty"); com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.providerTypeInstanceId, "providerTypeInstanceId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.updateProviderTypeInstanceRequest, + "updateProviderTypeInstanceRequest cannot be null"); providerTypeId = builder.providerTypeId; providerTypeInstanceId = builder.providerTypeInstanceId; - name = builder.name; - attributes = builder.attributes; + updateProviderTypeInstanceRequest = builder.updateProviderTypeInstanceRequest; xCorrelationId = builder.xCorrelationId; xRequestId = builder.xRequestId; } @@ -193,25 +180,14 @@ public String providerTypeInstanceId() { } /** - * Gets the name. - * - * The provider type instance name. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the attributes. + * Gets the updateProviderTypeInstanceRequest. * - * The attributes for connecting to the provider type instance. + * Provider type instance object to be patched. * - * @return the attributes + * @return the updateProviderTypeInstanceRequest */ - public Map attributes() { - return attributes; + public UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequest() { + return updateProviderTypeInstanceRequest; } /** diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequest.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequest.java new file mode 100644 index 00000000..2873f3cc --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequest.java @@ -0,0 +1,55 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Map; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * UpdateProviderTypeInstanceRequest. + * + * Classes which extend this class: + * - UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName + * - UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes + */ +public class UpdateProviderTypeInstanceRequest extends GenericModel { + + protected String name; + protected Map attributes; + + protected UpdateProviderTypeInstanceRequest() { } + + /** + * Gets the name. + * + * The provider type instance name. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the attributes. + * + * The attributes for connecting to the provider type instance. + * + * @return the attributes + */ + public Map attributes() { + return attributes; + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.java new file mode 100644 index 00000000..33f036b3 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.java @@ -0,0 +1,91 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import java.util.Map; + +/** + * The provider type instance payload for patching attributes. + */ +public class UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes extends UpdateProviderTypeInstanceRequest { + + + /** + * Builder. + */ + public static class Builder { + private Map attributes; + + /** + * Instantiates a new Builder from an existing UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes instance. + * + * @param updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes the instance to initialize the Builder with + */ + public Builder(UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes) { + this.attributes = updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.attributes; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param attributes the attributes + */ + public Builder(Map attributes) { + this.attributes = attributes; + } + + /** + * Builds a UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes. + * + * @return the new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes instance + */ + public UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes build() { + return new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes(this); + } + + /** + * Set the attributes. + * + * @param attributes the attributes + * @return the UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes builder + */ + public Builder attributes(Map attributes) { + this.attributes = attributes; + return this; + } + } + + protected UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes() { } + + protected UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.attributes, + "attributes cannot be null"); + attributes = builder.attributes; + } + + /** + * New builder. + * + * @return a UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.java b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.java new file mode 100644 index 00000000..4e47e383 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +/** + * The provider type instance payload for patching name. + */ +public class UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName extends UpdateProviderTypeInstanceRequest { + + + /** + * Builder. + */ + public static class Builder { + private String name; + + /** + * Instantiates a new Builder from an existing UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName instance. + * + * @param updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName the instance to initialize the Builder with + */ + public Builder(UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName) { + this.name = updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.name; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param name the name + */ + public Builder(String name) { + this.name = name; + } + + /** + * Builds a UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName. + * + * @return the new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName instance + */ + public UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName build() { + return new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + } + + protected UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName() { } + + protected UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, + "name cannot be null"); + name = builder.name; + } + + /** + * New builder. + * + * @return a UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java index 52f0c1de..993fad97 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiIT.java @@ -111,6 +111,7 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfilesPager; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceAttributes; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; @@ -132,13 +133,14 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportsPager; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfig; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItems; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAndDepth1; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigBase; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigOr; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigBase; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigOr; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourcePage; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummary; @@ -152,8 +154,12 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetPrototype; import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequest; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName; import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import com.ibm.cloud.security_and_compliance_center_api.test.SdkIntegrationTestBase; @@ -194,6 +200,7 @@ public class SecurityAndComplianceCenterApiIT extends SdkIntegrationTestBase { String reportIdForReportLink = null; String ruleIdLink = null; String typeForReportLink = null; + String xCorrelationIdLink = null; /** * This method provides our config filename to the base class. @@ -229,7 +236,7 @@ public void constructService() { public void testGetSettings() throws Exception { try { GetSettingsOptions getSettingsOptions = new GetSettingsOptions.Builder() - .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -246,6 +253,7 @@ public void testGetSettings() throws Exception { objectStorageCrnForUpdateSettingsLink = settingsResult.objectStorage().instanceCrn(); objectStorageBucketForUpdateSettingsLink = settingsResult.objectStorage().bucket(); objectStorageLocationForUpdateSettingsLink = settingsResult.objectStorage().bucketLocation(); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -261,9 +269,8 @@ public void testCreateRule() throws Exception { .value("us-east") .build(); - Target targetModel = new Target.Builder() + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() .serviceName("cloud-object-storage") - .serviceDisplayName("testString") .resourceKind("bucket") .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); @@ -275,7 +282,7 @@ public void testCreateRule() throws Exception { .value("${hard_quota}") .build(); - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() .description("The Cloud Object Storage rule.") .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); @@ -293,13 +300,12 @@ public void testCreateRule() throws Exception { CreateRuleOptions createRuleOptions = new CreateRuleOptions.Builder() .description("Example rule") - .target(targetModel) + .target(targetPrototypeModel) .requiredConfig(requiredConfigModel) - .type("user_defined") .version("1.0.0") .xImport(importModel) .labels(java.util.Arrays.asList()) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -310,8 +316,8 @@ public void testCreateRule() throws Exception { assertEquals(response.getStatusCode(), 201); Rule ruleResult = response.getResult(); - assertNotNull(ruleResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); ruleIdLink = ruleResult.getId(); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -324,7 +330,7 @@ public void testGetRule() throws Exception { try { GetRuleOptions getRuleOptions = new GetRuleOptions.Builder() .ruleId(ruleIdLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -344,11 +350,11 @@ public void testGetRule() throws Exception { } } - @Test(dependsOnMethods = { "testCreateRule" }) + @Test(dependsOnMethods = { "testGetRule" }) public void testGetLatestReports() throws Exception { try { GetLatestReportsOptions getLatestReportsOptions = new GetLatestReportsOptions.Builder() - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .sort("profile_name") .build(); @@ -362,6 +368,7 @@ public void testGetLatestReports() throws Exception { ReportLatest reportLatestResult = response.getResult(); assertNotNull(reportLatestResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); accountIdForReportLink = reportLatestResult.getReports().get(0).getAccount().getId(); reportIdForReportLink = reportLatestResult.getReports().get(0).getId(); attachmentIdForReportLink = reportLatestResult.getReports().get(0).getAttachment().getId(); @@ -396,7 +403,7 @@ public void testUpdateSettings() throws Exception { UpdateSettingsOptions updateSettingsOptions = new UpdateSettingsOptions.Builder() .eventNotifications(eventNotificationsModel) .objectStorage(objectStorageModel) - .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -408,35 +415,35 @@ public void testUpdateSettings() throws Exception { Settings settingsResult = response.getResult(); - //assertNotNull(settingsResult); + assertNull(settingsResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - // @Test(dependsOnMethods = { "testUpdateSettings" }) - // public void testPostTestEvent() throws Exception { - // try { - // PostTestEventOptions postTestEventOptions = new PostTestEventOptions.Builder() - // .xCorrelationId("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5") - // .xRequestId("testString") - // .build(); - - // // Invoke operation - // Response response = service.postTestEvent(postTestEventOptions).execute(); - // // Validate response - // assertNotNull(response); - // assertEquals(response.getStatusCode(), 202); - - // TestEvent testEventResult = response.getResult(); - - // assertNotNull(testEventResult); - // } catch (ServiceResponseException e) { - // fail(String.format("Service returned status code %d: %s%nError details: %s", - // e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - // } - // } + /*@Test(dependsOnMethods = { "testUpdateSettings" }) + public void testPostTestEvent() throws Exception { + try { + PostTestEventOptions postTestEventOptions = new PostTestEventOptions.Builder() + .xCorrelationId(xCorrelationIdLink) + .xRequestId("testString") + .build(); + + // Invoke operation + Response response = service.postTestEvent(postTestEventOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 202); + + TestEvent testEventResult = response.getResult(); + + assertNotNull(testEventResult); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + }*/ @Test(dependsOnMethods = { "testUpdateSettings" }) public void testCreateCustomControlLibrary() throws Exception { @@ -453,7 +460,7 @@ public void testCreateCustomControlLibrary() throws Exception { .assessmentMethod("ibm-cloud-rule") .assessmentType("automated") .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") - .parameterCount(Long.valueOf("38")) + .parameterCount(Long.valueOf("26")) .parameters(java.util.Arrays.asList(parameterInfoModel)) .build(); @@ -461,10 +468,10 @@ public void testCreateCustomControlLibrary() throws Exception { .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") .responsibility("user") .componentId("iam-identity") - .componenetName("testString") + .componentName("IAM Identity Service") .environment("ibm-cloud") .controlSpecificationDescription("IBM cloud") - .assessmentsCount(Long.valueOf("38")) + .assessmentsCount(Long.valueOf("26")) .assessments(java.util.Arrays.asList(implementationModel)) .build(); @@ -493,7 +500,7 @@ public void testCreateCustomControlLibrary() throws Exception { .controls(java.util.Arrays.asList(controlsInControlLibModel)) .controlLibraryVersion("1.0.0") .latest(true) - .controlsCount(Long.valueOf("38")) + .controlsCount(Long.valueOf("26")) .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -524,7 +531,6 @@ public void testListControlLibraries() throws Exception { .controlLibraryType("custom") .build(); - // Invoke operation Response response = service.listControlLibraries(listControlLibrariesOptions).execute(); // Validate response @@ -613,7 +619,7 @@ public void testReplaceCustomControlLibrary() throws Exception { .assessmentMethod("ibm-cloud-rule") .assessmentType("automated") .assessmentDescription("Check that there is an Activity Tracker event route defined to collect global events generated by IBM Cloud services") - .parameterCount(Long.valueOf("38")) + .parameterCount(Long.valueOf("26")) .parameters(java.util.Arrays.asList(parameterInfoModel)) .build(); @@ -621,10 +627,10 @@ public void testReplaceCustomControlLibrary() throws Exception { .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") .responsibility("user") .componentId("iam-identity") - .componenetName("testString") + .componentName("IAM Identity Service") .environment("ibm-cloud") .controlSpecificationDescription("IBM cloud") - .assessmentsCount(Long.valueOf("38")) + .assessmentsCount(Long.valueOf("26")) .assessments(java.util.Arrays.asList(implementationModel)) .build(); @@ -660,8 +666,8 @@ public void testReplaceCustomControlLibrary() throws Exception { .updatedBy("testString") .latest(true) .hierarchyEnabled(true) - .controlsCount(Long.valueOf("38")) - .controlParentsCount(Long.valueOf("38")) + .controlsCount(Long.valueOf("26")) + .controlParentsCount(Long.valueOf("26")) .controls(java.util.Arrays.asList(controlsInControlLibModel)) .xCorrelationId("testString") .xRequestId("testString") @@ -788,7 +794,7 @@ public void testListProfilesWithPager() throws Exception { public void testGetProfile() throws Exception { try { GetProfileOptions getProfileOptions = new GetProfileOptions.Builder() - .profilesId(profileIdLink) + .profileId(profileIdLink) .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -826,7 +832,7 @@ public void testReplaceProfile() throws Exception { .build(); ReplaceProfileOptions replaceProfileOptions = new ReplaceProfileOptions.Builder() - .profilesId(profileIdLink) + .profileId(profileIdLink) .profileName("test_profile1") .profileDescription("test_description1") .profileType("custom") @@ -855,7 +861,7 @@ public void testReplaceProfile() throws Exception { public void testListRules() throws Exception { try { ListRulesOptions listRulesOptions = new ListRulesOptions.Builder() - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .type("system_defined") .search("testString") @@ -886,9 +892,8 @@ public void testReplaceRule() throws Exception { .value("us-south") .build(); - Target targetModel = new Target.Builder() + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() .serviceName("cloud-object-storage") - .serviceDisplayName("Cloud Object Storage") .resourceKind("bucket") .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); @@ -900,7 +905,7 @@ public void testReplaceRule() throws Exception { .value("${hard_quota}") .build(); - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() .description("The Cloud Object Storage rule.") .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); @@ -920,13 +925,12 @@ public void testReplaceRule() throws Exception { .ruleId(ruleIdLink) .ifMatch(eTagLink) .description("Example rule") - .target(targetModel) + .target(targetPrototypeModel) .requiredConfig(requiredConfigModel) - .type("user_defined") .version("1.0.1") .xImport(importModel) .labels(java.util.Arrays.asList()) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -949,9 +953,9 @@ public void testReplaceRule() throws Exception { public void testCreateAttachment() throws Exception { try { PropertyItem propertyScopeId = new PropertyItem.Builder() - .name("scope_id") - .value(config.get("ACCOUNTID")) - .build(); + .name("scope_id") + .value(config.get("ACCOUNTID")) + .build(); PropertyItem propertyScopeType = new PropertyItem.Builder() .name("scope_type") @@ -995,7 +999,7 @@ public void testCreateAttachment() throws Exception { .build(); CreateAttachmentOptions createAttachmentOptions = new CreateAttachmentOptions.Builder() - .profilesId(profileIdLink) + .profileId(profileIdLink) .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) .xCorrelationId("testString") .xRequestId("testString") @@ -1021,7 +1025,7 @@ public void testCreateAttachment() throws Exception { public void testListAttachments() throws Exception { try { ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() - .profilesId(profileIdLink) + .profileId(profileIdLink) .xCorrelationId("testString") .xRequestId("testString") .limit(Long.valueOf("1")) @@ -1046,7 +1050,7 @@ public void testListAttachments() throws Exception { public void testListAttachmentsWithPager() throws Exception { try { ListAttachmentsOptions options = new ListAttachmentsOptions.Builder() - .profilesId(profileIdLink) + .profileId(profileIdLink) .xCorrelationId("testString") .xRequestId("testString") .limit(Long.valueOf("10")) @@ -1081,7 +1085,7 @@ public void testGetProfileAttachment() throws Exception { try { GetProfileAttachmentOptions getProfileAttachmentOptions = new GetProfileAttachmentOptions.Builder() .attachmentId(attachmentIdLink) - .profilesId(profileIdLink) + .profileId(profileIdLink) .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1105,14 +1109,14 @@ public void testGetProfileAttachment() throws Exception { public void testReplaceProfileAttachment() throws Exception { try { PropertyItem propertyScopeId = new PropertyItem.Builder() - .name("scope_id") + .name("scope_id") .value(config.get("ACCOUNTID")) .build(); PropertyItem propertyScopeType = new PropertyItem.Builder() .name("scope_type") .value("account") - .build(); + .build(); MultiCloudScope multiCloudScopeModel = new MultiCloudScope.Builder() .environment("ibm-cloud") @@ -1146,7 +1150,6 @@ public void testReplaceProfileAttachment() throws Exception { ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions = new ReplaceProfileAttachmentOptions.Builder() .attachmentId(attachmentIdLink) - .profilesId(profileIdLink) .id("testString") .profileId(profileIdLink) .accountId(config.get("ACCOUNTID")) @@ -1211,64 +1214,10 @@ public void testCreateScan() throws Exception { } @Test(dependsOnMethods = { "testCreateScan" }) - public void testListAttachmentsAccount() throws Exception { - try { - ListAttachmentsAccountOptions listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder() - .xCorrelationId("testString") - .xRequestId("testString") - .limit(Long.valueOf("1")) - .build(); - - // Invoke operation - Response response = service.listAttachmentsAccount(listAttachmentsAccountOptions).execute(); - - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - AttachmentCollection attachmentCollectionResult = response.getResult(); - - assertNotNull(attachmentCollectionResult); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListAttachmentsAccount" }) - public void testListAttachmentsAccountWithPager() throws Exception { - try { - ListAttachmentsAccountOptions options = new ListAttachmentsAccountOptions.Builder() - .xCorrelationId("testString") - .xRequestId("testString") - .limit(Long.valueOf("1")) - .build(); - - // Test getNext(). - List allResults = new ArrayList<>(); - AttachmentsAccountPager pager = new AttachmentsAccountPager(service, options); - if(pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - - assertNotNull(allResults); - assertFalse(allResults.isEmpty()); - - assertEquals(allResults.size(),1); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListAttachmentsAccount" }) public void testListReports() throws Exception { try { ListReportsOptions listReportsOptions = new ListReportsOptions.Builder() - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .attachmentId(attachmentIdForReportLink) .groupId(groupIdForReportLink) @@ -1287,6 +1236,7 @@ public void testListReports() throws Exception { ReportPage reportPageResult = response.getResult(); assertNotNull(reportPageResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1297,7 +1247,7 @@ public void testListReports() throws Exception { public void testListReportsWithPager() throws Exception { try { ListReportsOptions options = new ListReportsOptions.Builder() - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .attachmentId(attachmentIdForReportLink) .groupId(groupIdForReportLink) @@ -1331,12 +1281,13 @@ public void testListReportsWithPager() throws Exception { } } + @Test(dependsOnMethods = { "testListReports" }) public void testGetReport() throws Exception { try { GetReportOptions getReportOptions = new GetReportOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -1349,6 +1300,7 @@ public void testGetReport() throws Exception { Report reportResult = response.getResult(); assertNotNull(reportResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1360,7 +1312,7 @@ public void testGetReportSummary() throws Exception { try { GetReportSummaryOptions getReportSummaryOptions = new GetReportSummaryOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -1373,6 +1325,7 @@ public void testGetReportSummary() throws Exception { ReportSummary reportSummaryResult = response.getResult(); assertNotNull(reportSummaryResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1384,7 +1337,7 @@ public void testGetReportEvaluation() throws Exception { try { GetReportEvaluationOptions getReportEvaluationOptions = new GetReportEvaluationOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .excludeSummary(true) .build(); @@ -1398,18 +1351,19 @@ public void testGetReportEvaluation() throws Exception { InputStream inputStreamResult = response.getResult(); assertNotNull(inputStreamResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetReportEvaluation" }) + @Test(dependsOnMethods = { "testGetReportSummary" }) public void testGetReportControls() throws Exception { try { GetReportControlsOptions getReportControlsOptions = new GetReportControlsOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .controlId("testString") .controlName("testString") @@ -1428,6 +1382,7 @@ public void testGetReportControls() throws Exception { ReportControls reportControlsResult = response.getResult(); assertNotNull(reportControlsResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1439,11 +1394,13 @@ public void testListReportEvaluations() throws Exception { try { ListReportEvaluationsOptions listReportEvaluationsOptions = new ListReportEvaluationsOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .assessmentId("testString") + .assessmentMethod("testString") .componentId("testString") .targetId("testString") + .targetEnv("testString") .targetName("testString") .status("failure") .limit(Long.valueOf("1")) @@ -1458,6 +1415,7 @@ public void testListReportEvaluations() throws Exception { EvaluationPage evaluationPageResult = response.getResult(); assertNotNull(evaluationPageResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1469,8 +1427,14 @@ public void testListReportEvaluationsWithPager() throws Exception { try { ListReportEvaluationsOptions options = new ListReportEvaluationsOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") + .assessmentId("testString") + .assessmentMethod("testString") + .componentId("testString") + .targetId("testString") + .targetEnv("testString") + .targetName("testString") .status("failure") .limit(Long.valueOf("10")) .build(); @@ -1496,12 +1460,13 @@ public void testListReportEvaluationsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListReportEvaluationsWithPager" }) + + @Test(dependsOnMethods = { "testListReportEvaluations" }) public void testListReportResources() throws Exception { try { ListReportResourcesOptions listReportResourcesOptions = new ListReportResourcesOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .id("testString") .resourceName("testString") @@ -1521,6 +1486,7 @@ public void testListReportResources() throws Exception { ResourcePage resourcePageResult = response.getResult(); assertNotNull(resourcePageResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1532,9 +1498,12 @@ public void testListReportResourcesWithPager() throws Exception { try { ListReportResourcesOptions options = new ListReportResourcesOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") + .id("testString") + .resourceName("testString") .accountId(accountIdForReportLink) + .componentId("testString") .status("compliant") .sort("account_id") .limit(Long.valueOf("10")) @@ -1566,7 +1535,7 @@ public void testGetReportTags() throws Exception { try { GetReportTagsOptions getReportTagsOptions = new GetReportTagsOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -1579,6 +1548,7 @@ public void testGetReportTags() throws Exception { ReportTags reportTagsResult = response.getResult(); assertNotNull(reportTagsResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1590,7 +1560,7 @@ public void testGetReportViolationsDrift() throws Exception { try { GetReportViolationsDriftOptions getReportViolationsDriftOptions = new GetReportViolationsDriftOptions.Builder() .reportId(reportIdForReportLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .scanTimeDuration(Long.valueOf("0")) .build(); @@ -1604,6 +1574,7 @@ public void testGetReportViolationsDrift() throws Exception { ReportViolationsDrift reportViolationsDriftResult = response.getResult(); assertNotNull(reportViolationsDriftResult); + xCorrelationIdLink = response.getHeaders().values("X-Correlation-ID").get(0); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1627,8 +1598,6 @@ public void testListProviderTypes() throws Exception { ProviderTypesCollection providerTypesCollectionResult = response.getResult(); assertNotNull(providerTypesCollectionResult); - providerTypeIdLink = providerTypesCollectionResult.getProviderTypes().get(0).getId(); - for(ProviderTypeItem providerTypeItem: providerTypesCollectionResult.getProviderTypes()){ if(providerTypeItem.getName().equals("workload-protection")){ providerTypeIdLink = providerTypeItem.getId(); @@ -1745,11 +1714,14 @@ public void testGetProviderTypeInstance() throws Exception { @Test(dependsOnMethods = { "testGetProviderTypeInstance" }) public void testUpdateProviderTypeInstance() throws Exception { try { + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName updateProviderTypeInstanceRequestModel = new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.Builder() + .name("workload-protection-instance-1") + .build(); + UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptions = new UpdateProviderTypeInstanceOptions.Builder() .providerTypeId(providerTypeIdLink) .providerTypeInstanceId(providerTypeInstanceIdLink) - .name("workload-protection-instance-1") - .attributes(java.util.Collections.singletonMap("wp_crn", "crn:v1:staging:public:sysdig-secure:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:0df4004c-fb74-483b-97be-dd9bd35af4d8::")) + .updateProviderTypeInstanceRequest(updateProviderTypeInstanceRequestModel) .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1797,7 +1769,7 @@ public void testDeleteProfileAttachment() throws Exception { try { DeleteProfileAttachmentOptions deleteProfileAttachmentOptions = new DeleteProfileAttachmentOptions.Builder() .attachmentId(attachmentIdLink) - .profilesId(profileIdLink) + .profileId(profileIdLink) .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1816,13 +1788,12 @@ public void testDeleteProfileAttachment() throws Exception { e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - - + @Test(dependsOnMethods = { "testDeleteProfileAttachment" }) public void testDeleteCustomProfile() throws Exception { try { DeleteCustomProfileOptions deleteCustomProfileOptions = new DeleteCustomProfileOptions.Builder() - .profilesId(profileIdLink) + .profileId(profileIdLink) .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1871,7 +1842,7 @@ public void testDeleteRule() throws Exception { try { DeleteRuleOptions deleteRuleOptions = new DeleteRuleOptions.Builder() .ruleId(ruleIdLink) - .xCorrelationId("testString") + .xCorrelationId(xCorrelationIdLink) .xRequestId("testString") .build(); @@ -1886,8 +1857,7 @@ public void testDeleteRule() throws Exception { } } - - @Test(dependsOnMethods = { "testDeleteProfileAttachment" }) + @Test(dependsOnMethods = { "testDeleteRule" }) public void testDeleteProviderTypeInstance() throws Exception { try { DeleteProviderTypeInstanceOptions deleteProviderTypeInstanceOptions = new DeleteProviderTypeInstanceOptions.Builder() diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java index 1e83cc8f..f9040fb6 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiTest.java @@ -111,6 +111,7 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProfilesPager; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Property; import com.ibm.cloud.security_and_compliance_center_api.v3.model.PropertyItem; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceAttributes; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeItem; @@ -132,13 +133,14 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportViolationsDrift; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReportsPager; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfig; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItems; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAndDepth1; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigBase; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigOr; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigBase; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigOr; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Resource; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourcePage; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ResourceSummary; @@ -152,8 +154,12 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.Tags; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetInfo; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetPrototype; import com.ibm.cloud.security_and_compliance_center_api.v3.model.TestEvent; import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequest; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName; import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateSettingsOptions; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.IOException; @@ -209,7 +215,7 @@ public void testConstructServiceURLWithInvalidVariable() throws Throwable { @Test public void testGetSettingsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"event_notifications\": {\"instance_crn\": \"crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"source_id\": \"crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::\", \"source_description\": \"This source is used for integration with IBM Cloud Security and Compliance Center.\", \"source_name\": \"compliance\"}, \"object_storage\": {\"instance_crn\": \"instanceCrn\", \"bucket\": \"bucket\", \"bucket_location\": \"bucketLocation\", \"bucket_endpoint\": \"bucketEndpoint\", \"updated_on\": \"2019-01-01T12:00:00.000Z\"}}"; + String mockResponseBody = "{\"event_notifications\": {\"instance_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"source_id\": \"crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::\", \"source_description\": \"This source is used for integration with IBM Cloud Security and Compliance Center.\", \"source_name\": \"compliance\"}, \"object_storage\": {\"instance_crn\": \"instanceCrn\", \"bucket\": \"bucket\", \"bucket_location\": \"bucketLocation\", \"bucket_endpoint\": \"bucketEndpoint\", \"updated_on\": \"2019-01-01T12:00:00.000Z\"}}"; String getSettingsPath = "/settings"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -254,7 +260,7 @@ public void testGetSettingsWRetries() throws Throwable { @Test public void testUpdateSettingsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"event_notifications\": {\"instance_crn\": \"crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"source_id\": \"crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::\", \"source_description\": \"This source is used for integration with IBM Cloud Security and Compliance Center.\", \"source_name\": \"compliance\"}, \"object_storage\": {\"instance_crn\": \"instanceCrn\", \"bucket\": \"bucket\", \"bucket_location\": \"bucketLocation\", \"bucket_endpoint\": \"bucketEndpoint\", \"updated_on\": \"2019-01-01T12:00:00.000Z\"}}"; + String mockResponseBody = "{\"event_notifications\": {\"instance_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"source_id\": \"crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::\", \"source_description\": \"This source is used for integration with IBM Cloud Security and Compliance Center.\", \"source_name\": \"compliance\"}, \"object_storage\": {\"instance_crn\": \"instanceCrn\", \"bucket\": \"bucket\", \"bucket_location\": \"bucketLocation\", \"bucket_endpoint\": \"bucketEndpoint\", \"updated_on\": \"2019-01-01T12:00:00.000Z\"}}"; String updateSettingsPath = "/settings"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -263,16 +269,16 @@ public void testUpdateSettingsWOptions() throws Throwable { // Construct an instance of the EventNotifications model EventNotifications eventNotificationsModel = new EventNotifications.Builder() - .instanceCrn("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .instanceCrn("crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceId("crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") .sourceName("compliance") .build(); // Construct an instance of the ObjectStorage model ObjectStorage objectStorageModel = new ObjectStorage.Builder() - .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .instanceCrn("crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") .bucket("px-scan-results") .bucketLocation("us-south") .bucketEndpoint("testString") @@ -483,7 +489,7 @@ public void testListControlLibrariesWithPagerGetAll() throws Throwable { @Test public void testCreateCustomControlLibraryWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; + String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"component_name\": \"componentName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; String createCustomControlLibraryPath = "/control_libraries"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -513,7 +519,7 @@ public void testCreateCustomControlLibraryWOptions() throws Throwable { .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") .responsibility("user") .componentId("iam-identity") - .componenetName("testString") + .componentName("IAM Identity Service") .environment("ibm-cloud") .controlSpecificationDescription("IBM cloud") .assessmentsCount(Long.valueOf("26")) @@ -646,7 +652,7 @@ public void testDeleteCustomControlLibraryNoOptions() throws Throwable { @Test public void testGetControlLibraryWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; + String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"component_name\": \"componentName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; String getControlLibraryPath = "/control_libraries/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -699,7 +705,7 @@ public void testGetControlLibraryNoOptions() throws Throwable { @Test public void testReplaceCustomControlLibraryWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; + String mockResponseBody = "{\"id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"account_id\": \"130003ea8bfa43c5aacea07a86da3000\", \"control_library_name\": \"controlLibraryName\", \"control_library_description\": \"controlLibraryDescription\", \"control_library_type\": \"predefined\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"control_library_version\": \"controlLibraryVersion\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"latest\": true, \"hierarchy_enabled\": true, \"controls_count\": 13, \"control_parents_count\": 19, \"controls\": [{\"control_name\": \"controlName\", \"control_id\": \"1fa45e17-9322-4e6c-bbd6-1c51db08e790\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_tags\": [\"controlTags\"], \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"component_name\": \"componentName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}], \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_requirement\": true, \"status\": \"enabled\"}]}"; String replaceCustomControlLibraryPath = "/control_libraries/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -729,7 +735,7 @@ public void testReplaceCustomControlLibraryWOptions() throws Throwable { .controlSpecificationId("5c7d6f88-a92f-4734-9b49-bd22b0900184") .responsibility("user") .componentId("iam-identity") - .componenetName("testString") + .componentName("IAM Identity Service") .environment("ibm-cloud") .controlSpecificationDescription("IBM cloud") .assessmentsCount(Long.valueOf("26")) @@ -937,7 +943,7 @@ public void testListProfilesWithPagerGetAll() throws Throwable { @Test public void testCreateProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"component_name\": \"componentName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; String createProfilePath = "/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1010,7 +1016,7 @@ public void testCreateProfileNoOptions() throws Throwable { @Test public void testDeleteCustomProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"component_name\": \"componentName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; String deleteCustomProfilePath = "/profiles/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1019,7 +1025,7 @@ public void testDeleteCustomProfileWOptions() throws Throwable { // Construct an instance of the DeleteCustomProfileOptions model DeleteCustomProfileOptions deleteCustomProfileOptionsModel = new DeleteCustomProfileOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1063,7 +1069,7 @@ public void testDeleteCustomProfileNoOptions() throws Throwable { @Test public void testGetProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"component_name\": \"componentName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; String getProfilePath = "/profiles/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1072,7 +1078,7 @@ public void testGetProfileWOptions() throws Throwable { // Construct an instance of the GetProfileOptions model GetProfileOptions getProfileOptionsModel = new GetProfileOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1116,7 +1122,7 @@ public void testGetProfileNoOptions() throws Throwable { @Test public void testReplaceProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"componenet_name\": \"componenetName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; + String mockResponseBody = "{\"id\": \"id\", \"profile_name\": \"profileName\", \"profile_description\": \"profileDescription\", \"profile_type\": \"predefined\", \"profile_version\": \"profileVersion\", \"version_group_label\": \"e0923045-f00d-44de-b49b-6f1f0e8033cc\", \"instance_id\": \"instanceId\", \"latest\": true, \"hierarchy_enabled\": true, \"created_by\": \"createdBy\", \"created_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"controls_count\": 13, \"control_parents_count\": 19, \"attachments_count\": 16, \"controls\": [{\"control_library_id\": \"e98a56ff-dc24-41d4-9875-1e188e2da6cd\", \"control_id\": \"5C453578-E9A1-421E-AD0F-C6AFCDD67CCF\", \"control_library_version\": \"controlLibraryVersion\", \"control_name\": \"controlName\", \"control_description\": \"controlDescription\", \"control_category\": \"controlCategory\", \"control_parent\": \"controlParent\", \"control_requirement\": true, \"control_docs\": {\"control_docs_id\": \"controlDocsId\", \"control_docs_type\": \"controlDocsType\"}, \"control_specifications_count\": 26, \"control_specifications\": [{\"control_specification_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"responsibility\": \"user\", \"component_id\": \"f3517159-889e-4781-819a-89d89b747c85\", \"component_name\": \"componentName\", \"environment\": \"environment\", \"control_specification_description\": \"controlSpecificationDescription\", \"assessments_count\": 16, \"assessments\": [{\"assessment_id\": \"assessmentId\", \"assessment_method\": \"assessmentMethod\", \"assessment_type\": \"assessmentType\", \"assessment_description\": \"assessmentDescription\", \"parameter_count\": 14, \"parameters\": [{\"parameter_name\": \"location\", \"parameter_display_name\": \"Location\", \"parameter_type\": \"string\", \"parameter_value\": \"anyValue\"}]}]}]}], \"default_parameters\": [{\"assessment_type\": \"assessmentType\", \"assessment_id\": \"assessmentId\", \"parameter_name\": \"parameterName\", \"parameter_default_value\": \"parameterDefaultValue\", \"parameter_display_name\": \"parameterDisplayName\", \"parameter_type\": \"string\"}]}"; String replaceProfilePath = "/profiles/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1141,7 +1147,7 @@ public void testReplaceProfileWOptions() throws Throwable { // Construct an instance of the ReplaceProfileOptions model ReplaceProfileOptions replaceProfileOptionsModel = new ReplaceProfileOptions.Builder() - .profilesId("testString") + .profileId("testString") .profileName("test_profile1") .profileDescription("test_description1") .profileType("custom") @@ -1190,7 +1196,7 @@ public void testReplaceProfileNoOptions() throws Throwable { @Test public void testListRulesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"limit\": 50, \"total_count\": 230, \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\", \"start\": \"start\"}, \"rules\": [{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}]}"; + String mockResponseBody = "{\"limit\": 50, \"total_count\": 230, \"first\": {\"href\": \"href\"}, \"next\": {\"href\": \"href\", \"start\": \"start\"}, \"rules\": [{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\", \"or\": [{\"description\": \"description\", \"property\": \"property\", \"operator\": \"string_equals\", \"value\": \"anyValue\"}]}]}, \"labels\": [\"labels\"]}]}"; String listRulesPath = "/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1241,7 +1247,7 @@ public void testListRulesWRetries() throws Throwable { @Test public void testCreateRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}"; + String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\", \"or\": [{\"description\": \"description\", \"property\": \"property\", \"operator\": \"string_equals\", \"value\": \"anyValue\"}]}]}, \"labels\": [\"labels\"]}"; String createRulePath = "/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1255,10 +1261,9 @@ public void testCreateRuleWOptions() throws Throwable { .value("us-east") .build(); - // Construct an instance of the Target model - Target targetModel = new Target.Builder() + // Construct an instance of the TargetPrototype model + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() .serviceName("cloud-object-storage") - .serviceDisplayName("testString") .resourceKind("bucket") .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); @@ -1271,8 +1276,8 @@ public void testCreateRuleWOptions() throws Throwable { .value("${hard_quota}") .build(); - // Construct an instance of the RequiredConfigRequiredConfigAnd model - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + // Construct an instance of the RequiredConfigAnd model + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() .description("The Cloud Object Storage rule.") .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); @@ -1293,9 +1298,8 @@ public void testCreateRuleWOptions() throws Throwable { // Construct an instance of the CreateRuleOptions model CreateRuleOptions createRuleOptionsModel = new CreateRuleOptions.Builder() .description("Example rule") - .target(targetModel) + .target(targetPrototypeModel) .requiredConfig(requiredConfigModel) - .type("user_defined") .version("1.0.0") .xImport(importModel) .labels(java.util.Arrays.asList()) @@ -1394,7 +1398,7 @@ public void testDeleteRuleNoOptions() throws Throwable { @Test public void testGetRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}"; + String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\", \"or\": [{\"description\": \"description\", \"property\": \"property\", \"operator\": \"string_equals\", \"value\": \"anyValue\"}]}]}, \"labels\": [\"labels\"]}"; String getRulePath = "/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1447,7 +1451,7 @@ public void testGetRuleNoOptions() throws Throwable { @Test public void testReplaceRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\"}]}, \"labels\": [\"labels\"]}"; + String mockResponseBody = "{\"created_on\": \"2019-01-01T12:00:00.000Z\", \"created_by\": \"createdBy\", \"updated_on\": \"2019-01-01T12:00:00.000Z\", \"updated_by\": \"updatedBy\", \"id\": \"id\", \"account_id\": \"accountId\", \"description\": \"description\", \"type\": \"user_defined\", \"version\": \"version\", \"import\": {\"parameters\": [{\"name\": \"name\", \"display_name\": \"displayName\", \"description\": \"description\", \"type\": \"string\"}]}, \"target\": {\"service_name\": \"serviceName\", \"service_display_name\": \"serviceDisplayName\", \"resource_kind\": \"resourceKind\", \"additional_target_attributes\": [{\"name\": \"name\", \"operator\": \"string_equals\", \"value\": \"value\"}]}, \"required_config\": {\"description\": \"description\", \"and\": [{\"description\": \"description\", \"or\": [{\"description\": \"description\", \"property\": \"property\", \"operator\": \"string_equals\", \"value\": \"anyValue\"}]}]}, \"labels\": [\"labels\"]}"; String replaceRulePath = "/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -1461,10 +1465,9 @@ public void testReplaceRuleWOptions() throws Throwable { .value("us-south") .build(); - // Construct an instance of the Target model - Target targetModel = new Target.Builder() + // Construct an instance of the TargetPrototype model + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() .serviceName("cloud-object-storage") - .serviceDisplayName("Cloud Object Storage") .resourceKind("bucket") .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); @@ -1477,8 +1480,8 @@ public void testReplaceRuleWOptions() throws Throwable { .value("${hard_quota}") .build(); - // Construct an instance of the RequiredConfigRequiredConfigAnd model - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + // Construct an instance of the RequiredConfigAnd model + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() .description("The Cloud Object Storage rule.") .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); @@ -1501,9 +1504,8 @@ public void testReplaceRuleWOptions() throws Throwable { .ruleId("testString") .ifMatch("testString") .description("Example rule") - .target(targetModel) + .target(targetPrototypeModel) .requiredConfig(requiredConfigModel) - .type("user_defined") .version("1.0.1") .xImport(importModel) .labels(java.util.Arrays.asList()) @@ -1561,7 +1563,7 @@ public void testListAttachmentsWOptions() throws Throwable { // Construct an instance of the ListAttachmentsOptions model ListAttachmentsOptions listAttachmentsOptionsModel = new ListAttachmentsOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .limit(Long.valueOf("10")) @@ -1625,7 +1627,7 @@ public void testListAttachmentsWithPagerGetNext() throws Throwable { .setBody("{\"message\": \"No more results available!\"}")); ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .limit(Long.valueOf("10")) @@ -1661,7 +1663,7 @@ public void testListAttachmentsWithPagerGetAll() throws Throwable { .setBody("{\"message\": \"No more results available!\"}")); ListAttachmentsOptions listAttachmentsOptions = new ListAttachmentsOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .limit(Long.valueOf("10")) @@ -1732,7 +1734,7 @@ public void testCreateAttachmentWOptions() throws Throwable { // Construct an instance of the CreateAttachmentOptions model CreateAttachmentOptions createAttachmentOptionsModel = new CreateAttachmentOptions.Builder() - .profilesId("testString") + .profileId("testString") .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) .profileId("testString") .xCorrelationId("testString") @@ -1788,7 +1790,7 @@ public void testDeleteProfileAttachmentWOptions() throws Throwable { // Construct an instance of the DeleteProfileAttachmentOptions model DeleteProfileAttachmentOptions deleteProfileAttachmentOptionsModel = new DeleteProfileAttachmentOptions.Builder() .attachmentId("testString") - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1842,7 +1844,7 @@ public void testGetProfileAttachmentWOptions() throws Throwable { // Construct an instance of the GetProfileAttachmentOptions model GetProfileAttachmentOptions getProfileAttachmentOptionsModel = new GetProfileAttachmentOptions.Builder() .attachmentId("testString") - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -1937,7 +1939,7 @@ public void testReplaceProfileAttachmentWOptions() throws Throwable { // Construct an instance of the ReplaceProfileAttachmentOptions model ReplaceProfileAttachmentOptions replaceProfileAttachmentOptionsModel = new ReplaceProfileAttachmentOptions.Builder() .attachmentId("testString") - .profilesId("testString") + .profileId("testString") .id("testString") .profileId("testString") .accountId("testString") @@ -2642,8 +2644,10 @@ public void testListReportEvaluationsWOptions() throws Throwable { .xCorrelationId("testString") .xRequestId("testString") .assessmentId("testString") + .assessmentMethod("testString") .componentId("testString") .targetId("testString") + .targetEnv("testString") .targetName("testString") .status("failure") .start("testString") @@ -2667,8 +2671,10 @@ public void testListReportEvaluationsWOptions() throws Throwable { Map query = TestUtilities.parseQueryString(request); assertNotNull(query); assertEquals(query.get("assessment_id"), "testString"); + assertEquals(query.get("assessment_method"), "testString"); assertEquals(query.get("component_id"), "testString"); assertEquals(query.get("target_id"), "testString"); + assertEquals(query.get("target_env"), "testString"); assertEquals(query.get("target_name"), "testString"); assertEquals(query.get("status"), "failure"); assertEquals(query.get("start"), "testString"); @@ -2716,8 +2722,10 @@ public void testListReportEvaluationsWithPagerGetNext() throws Throwable { .xCorrelationId("testString") .xRequestId("testString") .assessmentId("testString") + .assessmentMethod("testString") .componentId("testString") .targetId("testString") + .targetEnv("testString") .targetName("testString") .status("failure") .limit(Long.valueOf("10")) @@ -2757,8 +2765,10 @@ public void testListReportEvaluationsWithPagerGetAll() throws Throwable { .xCorrelationId("testString") .xRequestId("testString") .assessmentId("testString") + .assessmentMethod("testString") .componentId("testString") .targetId("testString") + .targetEnv("testString") .targetName("testString") .status("failure") .limit(Long.valueOf("10")) @@ -3027,109 +3037,11 @@ public void testGetReportViolationsDriftNoOptions() throws Throwable { securityAndComplianceCenterApiService.getReportViolationsDrift(null).execute(); } - // Test the listProviderTypes operation with a valid options model parameter - @Test - public void testListProviderTypesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"provider_types\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection\", \"description\": \"Security and Compliance Center Workload Protection helps you accelerate your Kubernetes and cloud adoption by addressing security and regulatory compliance. Easily identify vulnerabilities, check compliance, block threats and respond faster at every stage of the container and Kubernetes lifecycle.\", \"s2s_enabled\": true, \"instance_limit\": 1, \"mode\": \"PULL\", \"data_type\": \"com.sysdig.secure.results\", \"icon\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBkYXRhLW5hbWU9IkJ1aWxkIGljb24gaGVyZSIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSItMjgxMS4xOTgiIHgyPSItMjgxNC4xOTgiIHkxPSI1NTcuNTE3IiB5Mj0iNTU3LjUxNyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyODMxLjE5OCAtNTQyLjAxNykiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLW9wYWNpdHk9IjAiLz48c3RvcCBvZmZzZXQ9Ii44Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgeGxpbms6aHJlZj0iI2EiIGlkPSJiIiB4MT0iLTgwNi4xOTgiIHgyPSItNzk5LjE5OCIgeTE9Ii0yNDE0LjQ4MSIgeTI9Ii0yNDE0LjQ4MSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4MjUuMTk4IDI0MjguOTgxKSIvPjxsaW5lYXJHcmFkaWVudCB4bGluazpocmVmPSIjYSIgaWQ9ImMiIHgxPSItODEwLjE5OCIgeDI9Ii03OTguMTk4IiB5MT0iLTI0MTkuOTgxIiB5Mj0iLTI0MTkuOTgxIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDgzMi4xOTggMjQzMi45ODEpIi8+PGxpbmVhckdyYWRpZW50IGlkPSJlIiB4MT0iLTI1MTQiIHgyPSItMjQ4MiIgeTE9Ii0yNDgyIiB5Mj0iLTI1MTQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMjUxNCAtMjQ4MikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLWNvbG9yPSIjMDhiZGJhIi8+PHN0b3Agb2Zmc2V0PSIuOSIgc3RvcC1jb2xvcj0iIzBmNjJmZSIvPjwvbGluZWFyR3JhZGllbnQ+PG1hc2sgaWQ9ImQiIHdpZHRoPSIyOS4wMTciIGhlaWdodD0iMjcuOTk2IiB4PSIxLjk4MyIgeT0iMiIgZGF0YS1uYW1lPSJtYXNrIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMjkuOTc2IDE2YzAtMy43MzktMS40NTYtNy4yNTUtNC4xMDEtOS44OTlTMTkuNzE1IDIgMTUuOTc2IDIgOC43MjEgMy40NTYgNi4wNzcgNi4xMDFjLTUuNDU5IDUuNDU5LTUuNDU5IDE0LjM0IDAgMTkuNzk4QTE0LjA0NCAxNC4wNDQgMCAwIDAgMTYgMjkuOTk1di0yLjAwMWExMi4wNCAxMi4wNCAwIDAgMS04LjUwOS0zLjUxYy00LjY3OS00LjY3OS00LjY3OS0xMi4yOTIgMC0xNi45NzEgMi4yNjctMi4yNjcgNS4yOC0zLjUxNSA4LjQ4NS0zLjUxNXM2LjIxOSAxLjI0OCA4LjQ4NSAzLjUxNSAzLjUxNSA1LjI4IDMuNTE1IDguNDg1YzAgMS4zMDgtLjIxOCAyLjU4LS42MTggMy43ODZsMS44OTcuNjMyYy40NjctMS40MDguNzIyLTIuODkyLjcyMi00LjQxOFoiLz48cGF0aCBkPSJNMjQuNyAxMy42NzVhOC45NCA4Ljk0IDAgMCAwLTQuMTkzLTUuNDY1IDguOTQyIDguOTQyIDAgMCAwLTYuODMtLjg5OSA4Ljk3MSA4Ljk3MSAwIDAgMC01LjQ2MSA0LjE5NSA4Ljk4IDguOTggMCAwIDAtLjkwMyA2LjgyOGMxLjA3NyA0LjAxNiA0LjcyMiA2LjY2IDguNjk1IDYuNjYxdi0xLjk5OGMtMy4wOS0uMDAxLTUuOTI2LTIuMDU4LTYuNzYzLTUuMTgxYTcuMDEgNy4wMSAwIDAgMSA0Ljk1LTguNTc0IDYuOTU4IDYuOTU4IDAgMCAxIDUuMzEyLjY5OSA2Ljk1NCA2Ljk1NCAwIDAgMSAzLjI2MSA0LjI1Yy4zNTkgMS4zNDIuMjc1IDIuNzMyLS4xNTQgNC4wMTNsMS45MDkuNjM2YTguOTU5IDguOTU5IDAgMCAwIC4xNzYtNS4xNjdaIi8+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xNCAxNmMwLTEuMTAzLjg5Ny0yIDItMnMyIC44OTcgMiAyYTIgMiAwIDAgMS0uMTExLjYzbDEuODg5LjYzYy4xMzMtLjM5OC4yMjItLjgxNy4yMjItMS4yNTlhNCA0IDAgMSAwLTQgNHYtMmMtMS4xMDMgMC0yLS44OTctMi0yWiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNyAxNGgzdjNoLTN6IiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTguNSAxNS41KSIvPjxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0xOSAxMmg3djVoLTd6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyMi41IDE0LjUpIi8+PHBhdGggZmlsbD0idXJsKCNjKSIgZD0iTTIyIDEwaDEydjZIMjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyOCAxMykiLz48cGF0aCBkPSJNMjUgMTloNnY0aC02ek0yMCAxOGg1djVoLTV6TTE3IDE3aDN2NmgtM3oiLz48L21hc2s+PC9kZWZzPjxwYXRoIGZpbGw9IiMwMDFkNmMiIGQ9Im0yNSAzMS4wMDEtMi4xMzktMS4wMTNBNS4wMjIgNS4wMjIgMCAwIDEgMjAgMjUuNDY4VjE5aDEwdjYuNDY4YTUuMDIzIDUuMDIzIDAgMCAxLTIuODYxIDQuNTJMMjUgMzEuMDAxWm0tMy0xMHY0LjQ2OGMwIDEuMTUzLjY3NCAyLjIxOCAxLjcxNyAyLjcxMWwxLjI4My42MDcgMS4yODMtLjYwN0EzLjAxMiAzLjAxMiAwIDAgMCAyOCAyNS40Njl2LTQuNDY4aC02WiIgZGF0YS1uYW1lPSJ1dWlkLTU1ODMwNDRiLWZmMjQtNGUyNy05MDU0LTI0MDQzYWRkZmMwNiIvPjxnIG1hc2s9InVybCgjZCkiPjxwYXRoIGZpbGw9InVybCgjZSkiIGQ9Ik0wIDBoMzJ2MzJIMHoiIHRyYW5zZm9ybT0icm90YXRlKC05MCAxNiAxNikiLz48L2c+PC9zdmc+\", \"label\": {\"text\": \"1 per instance\", \"tip\": \"Only 1 per instance\"}, \"attributes\": {\"mapKey\": {\"type\": \"text\", \"display_name\": \"Workload Protection Instance CRN\"}}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; - String listProviderTypesPath = "/provider_types"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListProviderTypesOptions model - ListProviderTypesOptions listProviderTypesOptionsModel = new ListProviderTypesOptions.Builder() - .xCorrelationId("testString") - .xRequestId("testString") - .build(); - - // Invoke listProviderTypes() with a valid options model and verify the result - Response response = securityAndComplianceCenterApiService.listProviderTypes(listProviderTypesOptionsModel).execute(); - assertNotNull(response); - ProviderTypesCollection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listProviderTypesPath); - // Verify that there is no query string - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - } - - // Test the listProviderTypes operation with and without retries enabled - @Test - public void testListProviderTypesWRetries() throws Throwable { - securityAndComplianceCenterApiService.enableRetries(4, 30); - testListProviderTypesWOptions(); - - securityAndComplianceCenterApiService.disableRetries(); - testListProviderTypesWOptions(); - } - - // Test the getProviderTypeById operation with a valid options model parameter - @Test - public void testGetProviderTypeByIdWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection\", \"description\": \"Security and Compliance Center Workload Protection helps you accelerate your Kubernetes and cloud adoption by addressing security and regulatory compliance. Easily identify vulnerabilities, check compliance, block threats and respond faster at every stage of the container and Kubernetes lifecycle.\", \"s2s_enabled\": true, \"instance_limit\": 1, \"mode\": \"PULL\", \"data_type\": \"com.sysdig.secure.results\", \"icon\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBkYXRhLW5hbWU9IkJ1aWxkIGljb24gaGVyZSIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSItMjgxMS4xOTgiIHgyPSItMjgxNC4xOTgiIHkxPSI1NTcuNTE3IiB5Mj0iNTU3LjUxNyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyODMxLjE5OCAtNTQyLjAxNykiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLW9wYWNpdHk9IjAiLz48c3RvcCBvZmZzZXQ9Ii44Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgeGxpbms6aHJlZj0iI2EiIGlkPSJiIiB4MT0iLTgwNi4xOTgiIHgyPSItNzk5LjE5OCIgeTE9Ii0yNDE0LjQ4MSIgeTI9Ii0yNDE0LjQ4MSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4MjUuMTk4IDI0MjguOTgxKSIvPjxsaW5lYXJHcmFkaWVudCB4bGluazpocmVmPSIjYSIgaWQ9ImMiIHgxPSItODEwLjE5OCIgeDI9Ii03OTguMTk4IiB5MT0iLTI0MTkuOTgxIiB5Mj0iLTI0MTkuOTgxIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDgzMi4xOTggMjQzMi45ODEpIi8+PGxpbmVhckdyYWRpZW50IGlkPSJlIiB4MT0iLTI1MTQiIHgyPSItMjQ4MiIgeTE9Ii0yNDgyIiB5Mj0iLTI1MTQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMjUxNCAtMjQ4MikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLWNvbG9yPSIjMDhiZGJhIi8+PHN0b3Agb2Zmc2V0PSIuOSIgc3RvcC1jb2xvcj0iIzBmNjJmZSIvPjwvbGluZWFyR3JhZGllbnQ+PG1hc2sgaWQ9ImQiIHdpZHRoPSIyOS4wMTciIGhlaWdodD0iMjcuOTk2IiB4PSIxLjk4MyIgeT0iMiIgZGF0YS1uYW1lPSJtYXNrIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMjkuOTc2IDE2YzAtMy43MzktMS40NTYtNy4yNTUtNC4xMDEtOS44OTlTMTkuNzE1IDIgMTUuOTc2IDIgOC43MjEgMy40NTYgNi4wNzcgNi4xMDFjLTUuNDU5IDUuNDU5LTUuNDU5IDE0LjM0IDAgMTkuNzk4QTE0LjA0NCAxNC4wNDQgMCAwIDAgMTYgMjkuOTk1di0yLjAwMWExMi4wNCAxMi4wNCAwIDAgMS04LjUwOS0zLjUxYy00LjY3OS00LjY3OS00LjY3OS0xMi4yOTIgMC0xNi45NzEgMi4yNjctMi4yNjcgNS4yOC0zLjUxNSA4LjQ4NS0zLjUxNXM2LjIxOSAxLjI0OCA4LjQ4NSAzLjUxNSAzLjUxNSA1LjI4IDMuNTE1IDguNDg1YzAgMS4zMDgtLjIxOCAyLjU4LS42MTggMy43ODZsMS44OTcuNjMyYy40NjctMS40MDguNzIyLTIuODkyLjcyMi00LjQxOFoiLz48cGF0aCBkPSJNMjQuNyAxMy42NzVhOC45NCA4Ljk0IDAgMCAwLTQuMTkzLTUuNDY1IDguOTQyIDguOTQyIDAgMCAwLTYuODMtLjg5OSA4Ljk3MSA4Ljk3MSAwIDAgMC01LjQ2MSA0LjE5NSA4Ljk4IDguOTggMCAwIDAtLjkwMyA2LjgyOGMxLjA3NyA0LjAxNiA0LjcyMiA2LjY2IDguNjk1IDYuNjYxdi0xLjk5OGMtMy4wOS0uMDAxLTUuOTI2LTIuMDU4LTYuNzYzLTUuMTgxYTcuMDEgNy4wMSAwIDAgMSA0Ljk1LTguNTc0IDYuOTU4IDYuOTU4IDAgMCAxIDUuMzEyLjY5OSA2Ljk1NCA2Ljk1NCAwIDAgMSAzLjI2MSA0LjI1Yy4zNTkgMS4zNDIuMjc1IDIuNzMyLS4xNTQgNC4wMTNsMS45MDkuNjM2YTguOTU5IDguOTU5IDAgMCAwIC4xNzYtNS4xNjdaIi8+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xNCAxNmMwLTEuMTAzLjg5Ny0yIDItMnMyIC44OTcgMiAyYTIgMiAwIDAgMS0uMTExLjYzbDEuODg5LjYzYy4xMzMtLjM5OC4yMjItLjgxNy4yMjItMS4yNTlhNCA0IDAgMSAwLTQgNHYtMmMtMS4xMDMgMC0yLS44OTctMi0yWiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNyAxNGgzdjNoLTN6IiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTguNSAxNS41KSIvPjxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0xOSAxMmg3djVoLTd6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyMi41IDE0LjUpIi8+PHBhdGggZmlsbD0idXJsKCNjKSIgZD0iTTIyIDEwaDEydjZIMjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyOCAxMykiLz48cGF0aCBkPSJNMjUgMTloNnY0aC02ek0yMCAxOGg1djVoLTV6TTE3IDE3aDN2NmgtM3oiLz48L21hc2s+PC9kZWZzPjxwYXRoIGZpbGw9IiMwMDFkNmMiIGQ9Im0yNSAzMS4wMDEtMi4xMzktMS4wMTNBNS4wMjIgNS4wMjIgMCAwIDEgMjAgMjUuNDY4VjE5aDEwdjYuNDY4YTUuMDIzIDUuMDIzIDAgMCAxLTIuODYxIDQuNTJMMjUgMzEuMDAxWm0tMy0xMHY0LjQ2OGMwIDEuMTUzLjY3NCAyLjIxOCAxLjcxNyAyLjcxMWwxLjI4My42MDcgMS4yODMtLjYwN0EzLjAxMiAzLjAxMiAwIDAgMCAyOCAyNS40Njl2LTQuNDY4aC02WiIgZGF0YS1uYW1lPSJ1dWlkLTU1ODMwNDRiLWZmMjQtNGUyNy05MDU0LTI0MDQzYWRkZmMwNiIvPjxnIG1hc2s9InVybCgjZCkiPjxwYXRoIGZpbGw9InVybCgjZSkiIGQ9Ik0wIDBoMzJ2MzJIMHoiIHRyYW5zZm9ybT0icm90YXRlKC05MCAxNiAxNikiLz48L2c+PC9zdmc+\", \"label\": {\"text\": \"1 per instance\", \"tip\": \"Only 1 per instance\"}, \"attributes\": {\"mapKey\": {\"type\": \"text\", \"display_name\": \"Workload Protection Instance CRN\"}}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; - String getProviderTypeByIdPath = "/provider_types/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetProviderTypeByIdOptions model - GetProviderTypeByIdOptions getProviderTypeByIdOptionsModel = new GetProviderTypeByIdOptions.Builder() - .providerTypeId("testString") - .xCorrelationId("testString") - .xRequestId("testString") - .build(); - - // Invoke getProviderTypeById() with a valid options model and verify the result - Response response = securityAndComplianceCenterApiService.getProviderTypeById(getProviderTypeByIdOptionsModel).execute(); - assertNotNull(response); - ProviderTypeItem responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getProviderTypeByIdPath); - // Verify that there is no query string - Map query = TestUtilities.parseQueryString(request); - assertNull(query); - } - - // Test the getProviderTypeById operation with and without retries enabled - @Test - public void testGetProviderTypeByIdWRetries() throws Throwable { - securityAndComplianceCenterApiService.enableRetries(4, 30); - testGetProviderTypeByIdWOptions(); - - securityAndComplianceCenterApiService.disableRetries(); - testGetProviderTypeByIdWOptions(); - } - - // Test the getProviderTypeById operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetProviderTypeByIdNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - securityAndComplianceCenterApiService.getProviderTypeById(null).execute(); - } - // Test the listProviderTypeInstances operation with a valid options model parameter @Test public void testListProviderTypeInstancesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"provider_type_instances\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; + String mockResponseBody = "{\"provider_type_instances\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; String listProviderTypeInstancesPath = "/provider_types/testString/provider_type_instances"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -3182,7 +3094,7 @@ public void testListProviderTypeInstancesNoOptions() throws Throwable { @Test public void testCreateProviderTypeInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; String createProviderTypeInstancePath = "/provider_types/testString/provider_type_instances"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -3290,7 +3202,7 @@ public void testDeleteProviderTypeInstanceNoOptions() throws Throwable { @Test public void testGetProviderTypeInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; String getProviderTypeInstancePath = "/provider_types/testString/provider_type_instances/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -3344,19 +3256,23 @@ public void testGetProviderTypeInstanceNoOptions() throws Throwable { @Test public void testUpdateProviderTypeInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; String updateProviderTypeInstancePath = "/provider_types/testString/provider_type_instances/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); + // Construct an instance of the UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName model + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName updateProviderTypeInstanceRequestModel = new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.Builder() + .name("workload-protection-instance-1") + .build(); + // Construct an instance of the UpdateProviderTypeInstanceOptions model UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptionsModel = new UpdateProviderTypeInstanceOptions.Builder() .providerTypeId("testString") .providerTypeInstanceId("testString") - .name("workload-protection-instance-1") - .attributes(java.util.Collections.singletonMap("anyKey", "anyValue")) + .updateProviderTypeInstanceRequest(updateProviderTypeInstanceRequestModel) .xCorrelationId("testString") .xRequestId("testString") .build(); @@ -3400,7 +3316,7 @@ public void testUpdateProviderTypeInstanceNoOptions() throws Throwable { @Test public void testGetProviderTypesInstancesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"provider_types_instances\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {\"anyKey\": \"anyValue\"}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; + String mockResponseBody = "{\"provider_types_instances\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection-instance-1\", \"attributes\": {}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; String getProviderTypesInstancesPath = "/provider_types_instances"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -3441,6 +3357,104 @@ public void testGetProviderTypesInstancesWRetries() throws Throwable { testGetProviderTypesInstancesWOptions(); } + // Test the listProviderTypes operation with a valid options model parameter + @Test + public void testListProviderTypesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"provider_types\": [{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection\", \"description\": \"Security and Compliance Center Workload Protection helps you accelerate your Kubernetes and cloud adoption by addressing security and regulatory compliance. Easily identify vulnerabilities, check compliance, block threats and respond faster at every stage of the container and Kubernetes lifecycle.\", \"s2s_enabled\": true, \"instance_limit\": 1, \"mode\": \"PULL\", \"data_type\": \"com.sysdig.secure.results\", \"icon\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBkYXRhLW5hbWU9IkJ1aWxkIGljb24gaGVyZSIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSItMjgxMS4xOTgiIHgyPSItMjgxNC4xOTgiIHkxPSI1NTcuNTE3IiB5Mj0iNTU3LjUxNyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyODMxLjE5OCAtNTQyLjAxNykiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLW9wYWNpdHk9IjAiLz48c3RvcCBvZmZzZXQ9Ii44Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgeGxpbms6aHJlZj0iI2EiIGlkPSJiIiB4MT0iLTgwNi4xOTgiIHgyPSItNzk5LjE5OCIgeTE9Ii0yNDE0LjQ4MSIgeTI9Ii0yNDE0LjQ4MSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4MjUuMTk4IDI0MjguOTgxKSIvPjxsaW5lYXJHcmFkaWVudCB4bGluazpocmVmPSIjYSIgaWQ9ImMiIHgxPSItODEwLjE5OCIgeDI9Ii03OTguMTk4IiB5MT0iLTI0MTkuOTgxIiB5Mj0iLTI0MTkuOTgxIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDgzMi4xOTggMjQzMi45ODEpIi8+PGxpbmVhckdyYWRpZW50IGlkPSJlIiB4MT0iLTI1MTQiIHgyPSItMjQ4MiIgeTE9Ii0yNDgyIiB5Mj0iLTI1MTQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMjUxNCAtMjQ4MikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLWNvbG9yPSIjMDhiZGJhIi8+PHN0b3Agb2Zmc2V0PSIuOSIgc3RvcC1jb2xvcj0iIzBmNjJmZSIvPjwvbGluZWFyR3JhZGllbnQ+PG1hc2sgaWQ9ImQiIHdpZHRoPSIyOS4wMTciIGhlaWdodD0iMjcuOTk2IiB4PSIxLjk4MyIgeT0iMiIgZGF0YS1uYW1lPSJtYXNrIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMjkuOTc2IDE2YzAtMy43MzktMS40NTYtNy4yNTUtNC4xMDEtOS44OTlTMTkuNzE1IDIgMTUuOTc2IDIgOC43MjEgMy40NTYgNi4wNzcgNi4xMDFjLTUuNDU5IDUuNDU5LTUuNDU5IDE0LjM0IDAgMTkuNzk4QTE0LjA0NCAxNC4wNDQgMCAwIDAgMTYgMjkuOTk1di0yLjAwMWExMi4wNCAxMi4wNCAwIDAgMS04LjUwOS0zLjUxYy00LjY3OS00LjY3OS00LjY3OS0xMi4yOTIgMC0xNi45NzEgMi4yNjctMi4yNjcgNS4yOC0zLjUxNSA4LjQ4NS0zLjUxNXM2LjIxOSAxLjI0OCA4LjQ4NSAzLjUxNSAzLjUxNSA1LjI4IDMuNTE1IDguNDg1YzAgMS4zMDgtLjIxOCAyLjU4LS42MTggMy43ODZsMS44OTcuNjMyYy40NjctMS40MDguNzIyLTIuODkyLjcyMi00LjQxOFoiLz48cGF0aCBkPSJNMjQuNyAxMy42NzVhOC45NCA4Ljk0IDAgMCAwLTQuMTkzLTUuNDY1IDguOTQyIDguOTQyIDAgMCAwLTYuODMtLjg5OSA4Ljk3MSA4Ljk3MSAwIDAgMC01LjQ2MSA0LjE5NSA4Ljk4IDguOTggMCAwIDAtLjkwMyA2LjgyOGMxLjA3NyA0LjAxNiA0LjcyMiA2LjY2IDguNjk1IDYuNjYxdi0xLjk5OGMtMy4wOS0uMDAxLTUuOTI2LTIuMDU4LTYuNzYzLTUuMTgxYTcuMDEgNy4wMSAwIDAgMSA0Ljk1LTguNTc0IDYuOTU4IDYuOTU4IDAgMCAxIDUuMzEyLjY5OSA2Ljk1NCA2Ljk1NCAwIDAgMSAzLjI2MSA0LjI1Yy4zNTkgMS4zNDIuMjc1IDIuNzMyLS4xNTQgNC4wMTNsMS45MDkuNjM2YTguOTU5IDguOTU5IDAgMCAwIC4xNzYtNS4xNjdaIi8+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xNCAxNmMwLTEuMTAzLjg5Ny0yIDItMnMyIC44OTcgMiAyYTIgMiAwIDAgMS0uMTExLjYzbDEuODg5LjYzYy4xMzMtLjM5OC4yMjItLjgxNy4yMjItMS4yNTlhNCA0IDAgMSAwLTQgNHYtMmMtMS4xMDMgMC0yLS44OTctMi0yWiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNyAxNGgzdjNoLTN6IiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTguNSAxNS41KSIvPjxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0xOSAxMmg3djVoLTd6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyMi41IDE0LjUpIi8+PHBhdGggZmlsbD0idXJsKCNjKSIgZD0iTTIyIDEwaDEydjZIMjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyOCAxMykiLz48cGF0aCBkPSJNMjUgMTloNnY0aC02ek0yMCAxOGg1djVoLTV6TTE3IDE3aDN2NmgtM3oiLz48L21hc2s+PC9kZWZzPjxwYXRoIGZpbGw9IiMwMDFkNmMiIGQ9Im0yNSAzMS4wMDEtMi4xMzktMS4wMTNBNS4wMjIgNS4wMjIgMCAwIDEgMjAgMjUuNDY4VjE5aDEwdjYuNDY4YTUuMDIzIDUuMDIzIDAgMCAxLTIuODYxIDQuNTJMMjUgMzEuMDAxWm0tMy0xMHY0LjQ2OGMwIDEuMTUzLjY3NCAyLjIxOCAxLjcxNyAyLjcxMWwxLjI4My42MDcgMS4yODMtLjYwN0EzLjAxMiAzLjAxMiAwIDAgMCAyOCAyNS40Njl2LTQuNDY4aC02WiIgZGF0YS1uYW1lPSJ1dWlkLTU1ODMwNDRiLWZmMjQtNGUyNy05MDU0LTI0MDQzYWRkZmMwNiIvPjxnIG1hc2s9InVybCgjZCkiPjxwYXRoIGZpbGw9InVybCgjZSkiIGQ9Ik0wIDBoMzJ2MzJIMHoiIHRyYW5zZm9ybT0icm90YXRlKC05MCAxNiAxNikiLz48L2c+PC9zdmc+\", \"label\": {\"text\": \"1 per instance\", \"tip\": \"Only 1 per instance\"}, \"attributes\": {\"mapKey\": {\"type\": \"text\", \"display_name\": \"Workload Protection Instance CRN\"}}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}]}"; + String listProviderTypesPath = "/provider_types"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListProviderTypesOptions model + ListProviderTypesOptions listProviderTypesOptionsModel = new ListProviderTypesOptions.Builder() + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke listProviderTypes() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.listProviderTypes(listProviderTypesOptionsModel).execute(); + assertNotNull(response); + ProviderTypesCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listProviderTypesPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the listProviderTypes operation with and without retries enabled + @Test + public void testListProviderTypesWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testListProviderTypesWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testListProviderTypesWOptions(); + } + + // Test the getProviderTypeById operation with a valid options model parameter + @Test + public void testGetProviderTypeByIdWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"id\": \"7588190cce3c05ac8f7942ea597dafce\", \"type\": \"workload-protection\", \"name\": \"workload-protection\", \"description\": \"Security and Compliance Center Workload Protection helps you accelerate your Kubernetes and cloud adoption by addressing security and regulatory compliance. Easily identify vulnerabilities, check compliance, block threats and respond faster at every stage of the container and Kubernetes lifecycle.\", \"s2s_enabled\": true, \"instance_limit\": 1, \"mode\": \"PULL\", \"data_type\": \"com.sysdig.secure.results\", \"icon\": \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBkYXRhLW5hbWU9IkJ1aWxkIGljb24gaGVyZSIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSItMjgxMS4xOTgiIHgyPSItMjgxNC4xOTgiIHkxPSI1NTcuNTE3IiB5Mj0iNTU3LjUxNyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyODMxLjE5OCAtNTQyLjAxNykiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLW9wYWNpdHk9IjAiLz48c3RvcCBvZmZzZXQ9Ii44Ii8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgeGxpbms6aHJlZj0iI2EiIGlkPSJiIiB4MT0iLTgwNi4xOTgiIHgyPSItNzk5LjE5OCIgeTE9Ii0yNDE0LjQ4MSIgeTI9Ii0yNDE0LjQ4MSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4MjUuMTk4IDI0MjguOTgxKSIvPjxsaW5lYXJHcmFkaWVudCB4bGluazpocmVmPSIjYSIgaWQ9ImMiIHgxPSItODEwLjE5OCIgeDI9Ii03OTguMTk4IiB5MT0iLTI0MTkuOTgxIiB5Mj0iLTI0MTkuOTgxIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDgzMi4xOTggMjQzMi45ODEpIi8+PGxpbmVhckdyYWRpZW50IGlkPSJlIiB4MT0iLTI1MTQiIHgyPSItMjQ4MiIgeTE9Ii0yNDgyIiB5Mj0iLTI1MTQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMjUxNCAtMjQ4MikiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9Ii4xIiBzdG9wLWNvbG9yPSIjMDhiZGJhIi8+PHN0b3Agb2Zmc2V0PSIuOSIgc3RvcC1jb2xvcj0iIzBmNjJmZSIvPjwvbGluZWFyR3JhZGllbnQ+PG1hc2sgaWQ9ImQiIHdpZHRoPSIyOS4wMTciIGhlaWdodD0iMjcuOTk2IiB4PSIxLjk4MyIgeT0iMiIgZGF0YS1uYW1lPSJtYXNrIiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMjkuOTc2IDE2YzAtMy43MzktMS40NTYtNy4yNTUtNC4xMDEtOS44OTlTMTkuNzE1IDIgMTUuOTc2IDIgOC43MjEgMy40NTYgNi4wNzcgNi4xMDFjLTUuNDU5IDUuNDU5LTUuNDU5IDE0LjM0IDAgMTkuNzk4QTE0LjA0NCAxNC4wNDQgMCAwIDAgMTYgMjkuOTk1di0yLjAwMWExMi4wNCAxMi4wNCAwIDAgMS04LjUwOS0zLjUxYy00LjY3OS00LjY3OS00LjY3OS0xMi4yOTIgMC0xNi45NzEgMi4yNjctMi4yNjcgNS4yOC0zLjUxNSA4LjQ4NS0zLjUxNXM2LjIxOSAxLjI0OCA4LjQ4NSAzLjUxNSAzLjUxNSA1LjI4IDMuNTE1IDguNDg1YzAgMS4zMDgtLjIxOCAyLjU4LS42MTggMy43ODZsMS44OTcuNjMyYy40NjctMS40MDguNzIyLTIuODkyLjcyMi00LjQxOFoiLz48cGF0aCBkPSJNMjQuNyAxMy42NzVhOC45NCA4Ljk0IDAgMCAwLTQuMTkzLTUuNDY1IDguOTQyIDguOTQyIDAgMCAwLTYuODMtLjg5OSA4Ljk3MSA4Ljk3MSAwIDAgMC01LjQ2MSA0LjE5NSA4Ljk4IDguOTggMCAwIDAtLjkwMyA2LjgyOGMxLjA3NyA0LjAxNiA0LjcyMiA2LjY2IDguNjk1IDYuNjYxdi0xLjk5OGMtMy4wOS0uMDAxLTUuOTI2LTIuMDU4LTYuNzYzLTUuMTgxYTcuMDEgNy4wMSAwIDAgMSA0Ljk1LTguNTc0IDYuOTU4IDYuOTU4IDAgMCAxIDUuMzEyLjY5OSA2Ljk1NCA2Ljk1NCAwIDAgMSAzLjI2MSA0LjI1Yy4zNTkgMS4zNDIuMjc1IDIuNzMyLS4xNTQgNC4wMTNsMS45MDkuNjM2YTguOTU5IDguOTU5IDAgMCAwIC4xNzYtNS4xNjdaIi8+PC9nPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xNCAxNmMwLTEuMTAzLjg5Ny0yIDItMnMyIC44OTcgMiAyYTIgMiAwIDAgMS0uMTExLjYzbDEuODg5LjYzYy4xMzMtLjM5OC4yMjItLjgxNy4yMjItMS4yNTlhNCA0IDAgMSAwLTQgNHYtMmMtMS4xMDMgMC0yLS44OTctMi0yWiIvPjxwYXRoIGZpbGw9InVybCgjYSkiIGQ9Ik0xNyAxNGgzdjNoLTN6IiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTguNSAxNS41KSIvPjxwYXRoIGZpbGw9InVybCgjYikiIGQ9Ik0xOSAxMmg3djVoLTd6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyMi41IDE0LjUpIi8+PHBhdGggZmlsbD0idXJsKCNjKSIgZD0iTTIyIDEwaDEydjZIMjJ6IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAyOCAxMykiLz48cGF0aCBkPSJNMjUgMTloNnY0aC02ek0yMCAxOGg1djVoLTV6TTE3IDE3aDN2NmgtM3oiLz48L21hc2s+PC9kZWZzPjxwYXRoIGZpbGw9IiMwMDFkNmMiIGQ9Im0yNSAzMS4wMDEtMi4xMzktMS4wMTNBNS4wMjIgNS4wMjIgMCAwIDEgMjAgMjUuNDY4VjE5aDEwdjYuNDY4YTUuMDIzIDUuMDIzIDAgMCAxLTIuODYxIDQuNTJMMjUgMzEuMDAxWm0tMy0xMHY0LjQ2OGMwIDEuMTUzLjY3NCAyLjIxOCAxLjcxNyAyLjcxMWwxLjI4My42MDcgMS4yODMtLjYwN0EzLjAxMiAzLjAxMiAwIDAgMCAyOCAyNS40Njl2LTQuNDY4aC02WiIgZGF0YS1uYW1lPSJ1dWlkLTU1ODMwNDRiLWZmMjQtNGUyNy05MDU0LTI0MDQzYWRkZmMwNiIvPjxnIG1hc2s9InVybCgjZCkiPjxwYXRoIGZpbGw9InVybCgjZSkiIGQ9Ik0wIDBoMzJ2MzJIMHoiIHRyYW5zZm9ybT0icm90YXRlKC05MCAxNiAxNikiLz48L2c+PC9zdmc+\", \"label\": {\"text\": \"1 per instance\", \"tip\": \"Only 1 per instance\"}, \"attributes\": {\"mapKey\": {\"type\": \"text\", \"display_name\": \"Workload Protection Instance CRN\"}}, \"created_at\": \"2023-07-24T13:14:18.884Z\", \"updated_at\": \"2023-07-24T13:14:18.884Z\"}"; + String getProviderTypeByIdPath = "/provider_types/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetProviderTypeByIdOptions model + GetProviderTypeByIdOptions getProviderTypeByIdOptionsModel = new GetProviderTypeByIdOptions.Builder() + .providerTypeId("testString") + .xCorrelationId("testString") + .xRequestId("testString") + .build(); + + // Invoke getProviderTypeById() with a valid options model and verify the result + Response response = securityAndComplianceCenterApiService.getProviderTypeById(getProviderTypeByIdOptionsModel).execute(); + assertNotNull(response); + ProviderTypeItem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getProviderTypeByIdPath); + // Verify that there is no query string + Map query = TestUtilities.parseQueryString(request); + assertNull(query); + } + + // Test the getProviderTypeById operation with and without retries enabled + @Test + public void testGetProviderTypeByIdWRetries() throws Throwable { + securityAndComplianceCenterApiService.enableRetries(4, 30); + testGetProviderTypeByIdWOptions(); + + securityAndComplianceCenterApiService.disableRetries(); + testGetProviderTypeByIdWOptions(); + } + + // Test the getProviderTypeById operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetProviderTypeByIdNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + securityAndComplianceCenterApiService.getProviderTypeById(null).execute(); + } + // Perform setup needed before each test method @BeforeMethod public void beforeEachTest() { diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java index cdebe2bd..bc0314f1 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlLibraryTest.java @@ -67,7 +67,7 @@ public void testControlLibrary() throws Throwable { .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") .responsibility("user") .componentId("f3517159-889e-4781-819a-89d89b747c85") - .componenetName("componenet_name") + .componentName("component_name") .environment("environment") .controlSpecificationDescription("control_specification_description") .assessmentsCount(Long.valueOf("1")) @@ -76,7 +76,7 @@ public void testControlLibrary() throws Throwable { assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); assertEquals(controlSpecificationsModel.responsibility(), "user"); assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); - assertEquals(controlSpecificationsModel.componenetName(), "componenet_name"); + assertEquals(controlSpecificationsModel.componentName(), "component_name"); assertEquals(controlSpecificationsModel.environment(), "environment"); assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "control_specification_description"); assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("1")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java index d09c6b71..f73057ce 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlSpecificationsTest.java @@ -63,7 +63,7 @@ public void testControlSpecifications() throws Throwable { .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") .responsibility("user") .componentId("f3517159-889e-4781-819a-89d89b747c85") - .componenetName("testString") + .componentName("testString") .environment("testString") .controlSpecificationDescription("testString") .assessmentsCount(Long.valueOf("26")) @@ -72,7 +72,7 @@ public void testControlSpecifications() throws Throwable { assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); assertEquals(controlSpecificationsModel.responsibility(), "user"); assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); - assertEquals(controlSpecificationsModel.componenetName(), "testString"); + assertEquals(controlSpecificationsModel.componentName(), "testString"); assertEquals(controlSpecificationsModel.environment(), "testString"); assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "testString"); assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("26")); @@ -85,7 +85,7 @@ public void testControlSpecifications() throws Throwable { assertEquals(controlSpecificationsModelNew.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); assertEquals(controlSpecificationsModelNew.responsibility(), "user"); assertEquals(controlSpecificationsModelNew.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); - assertEquals(controlSpecificationsModelNew.componenetName(), "testString"); + assertEquals(controlSpecificationsModelNew.componentName(), "testString"); assertEquals(controlSpecificationsModelNew.environment(), "testString"); assertEquals(controlSpecificationsModelNew.controlSpecificationDescription(), "testString"); assertEquals(controlSpecificationsModelNew.assessmentsCount(), Long.valueOf("26")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java index fcd0eb3f..93de43ea 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ControlsInControlLibTest.java @@ -65,7 +65,7 @@ public void testControlsInControlLib() throws Throwable { .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") .responsibility("user") .componentId("f3517159-889e-4781-819a-89d89b747c85") - .componenetName("componenet_name") + .componentName("component_name") .environment("environment") .controlSpecificationDescription("control_specification_description") .assessmentsCount(Long.valueOf("1")) @@ -74,7 +74,7 @@ public void testControlsInControlLib() throws Throwable { assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); assertEquals(controlSpecificationsModel.responsibility(), "user"); assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); - assertEquals(controlSpecificationsModel.componenetName(), "componenet_name"); + assertEquals(controlSpecificationsModel.componentName(), "component_name"); assertEquals(controlSpecificationsModel.environment(), "environment"); assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "control_specification_description"); assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("1")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java index 82b4c65c..f7f0cabc 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateAttachmentOptionsTest.java @@ -100,13 +100,11 @@ public void testCreateAttachmentOptions() throws Throwable { assertEquals(attachmentsPrototypeModel.attachmentParameters(), java.util.Arrays.asList(attachmentParameterPrototypeModel)); CreateAttachmentOptions createAttachmentOptionsModel = new CreateAttachmentOptions.Builder() - .profilesId("testString") .attachments(java.util.Arrays.asList(attachmentsPrototypeModel)) .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); - assertEquals(createAttachmentOptionsModel.profilesId(), "testString"); assertEquals(createAttachmentOptionsModel.attachments(), java.util.Arrays.asList(attachmentsPrototypeModel)); assertEquals(createAttachmentOptionsModel.profileId(), "testString"); assertEquals(createAttachmentOptionsModel.xCorrelationId(), "testString"); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java index 45eee4ef..ace51519 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateCustomControlLibraryOptionsTest.java @@ -66,7 +66,7 @@ public void testCreateCustomControlLibraryOptions() throws Throwable { .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") .responsibility("user") .componentId("f3517159-889e-4781-819a-89d89b747c85") - .componenetName("testString") + .componentName("testString") .environment("testString") .controlSpecificationDescription("testString") .assessmentsCount(Long.valueOf("26")) @@ -75,7 +75,7 @@ public void testCreateCustomControlLibraryOptions() throws Throwable { assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); assertEquals(controlSpecificationsModel.responsibility(), "user"); assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); - assertEquals(controlSpecificationsModel.componenetName(), "testString"); + assertEquals(controlSpecificationsModel.componentName(), "testString"); assertEquals(controlSpecificationsModel.environment(), "testString"); assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "testString"); assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("26")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java index c7c277a0..0c9b6890 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateRuleOptionsTest.java @@ -18,9 +18,10 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.CreateRuleOptions; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetPrototype; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; @@ -46,23 +47,34 @@ public void testCreateRuleOptions() throws Throwable { assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); assertEquals(additionalTargetAttributeModel.value(), "testString"); - Target targetModel = new Target.Builder() + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() .serviceName("testString") - .serviceDisplayName("testString") .resourceKind("testString") .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); - assertEquals(targetModel.serviceName(), "testString"); - assertEquals(targetModel.serviceDisplayName(), "testString"); - assertEquals(targetModel.resourceKind(), "testString"); - assertEquals(targetModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); + assertEquals(targetPrototypeModel.serviceName(), "testString"); + assertEquals(targetPrototypeModel.resourceKind(), "testString"); + assertEquals(targetPrototypeModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); - RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() + RequiredConfigBase requiredConfigBaseModel = new RequiredConfigBase.Builder() .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigBaseModel.value(), "testString"); + + RequiredConfigItemsRequiredConfigOrDepth1 requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOrDepth1.Builder() + .description("testString") + .or(java.util.Arrays.asList(requiredConfigBaseModel)) .build(); assertEquals(requiredConfigItemsModel.description(), "testString"); + assertEquals(requiredConfigItemsModel.or(), java.util.Arrays.asList(requiredConfigBaseModel)); - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() .description("testString") .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); @@ -87,9 +99,8 @@ public void testCreateRuleOptions() throws Throwable { CreateRuleOptions createRuleOptionsModel = new CreateRuleOptions.Builder() .description("testString") - .target(targetModel) + .target(targetPrototypeModel) .requiredConfig(requiredConfigModel) - .type("user_defined") .version("testString") .xImport(importModel) .labels(java.util.Arrays.asList("testString")) @@ -97,9 +108,8 @@ public void testCreateRuleOptions() throws Throwable { .xRequestId("testString") .build(); assertEquals(createRuleOptionsModel.description(), "testString"); - assertEquals(createRuleOptionsModel.target(), targetModel); + assertEquals(createRuleOptionsModel.target(), targetPrototypeModel); assertEquals(createRuleOptionsModel.requiredConfig(), requiredConfigModel); - assertEquals(createRuleOptionsModel.type(), "user_defined"); assertEquals(createRuleOptionsModel.version(), "testString"); assertEquals(createRuleOptionsModel.xImport(), importModel); assertEquals(createRuleOptionsModel.labels(), java.util.Arrays.asList("testString")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java index 50ca0a8b..075756e4 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteCustomProfileOptionsTest.java @@ -32,11 +32,11 @@ public class DeleteCustomProfileOptionsTest { @Test public void testDeleteCustomProfileOptions() throws Throwable { DeleteCustomProfileOptions deleteCustomProfileOptionsModel = new DeleteCustomProfileOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); - assertEquals(deleteCustomProfileOptionsModel.profilesId(), "testString"); + assertEquals(deleteCustomProfileOptionsModel.profileId(), "testString"); assertEquals(deleteCustomProfileOptionsModel.xCorrelationId(), "testString"); assertEquals(deleteCustomProfileOptionsModel.xRequestId(), "testString"); } diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java index ac75b2b5..13169d1f 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/DeleteProfileAttachmentOptionsTest.java @@ -33,12 +33,12 @@ public class DeleteProfileAttachmentOptionsTest { public void testDeleteProfileAttachmentOptions() throws Throwable { DeleteProfileAttachmentOptions deleteProfileAttachmentOptionsModel = new DeleteProfileAttachmentOptions.Builder() .attachmentId("testString") - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); assertEquals(deleteProfileAttachmentOptionsModel.attachmentId(), "testString"); - assertEquals(deleteProfileAttachmentOptionsModel.profilesId(), "testString"); + assertEquals(deleteProfileAttachmentOptionsModel.profileId(), "testString"); assertEquals(deleteProfileAttachmentOptionsModel.xCorrelationId(), "testString"); assertEquals(deleteProfileAttachmentOptionsModel.xRequestId(), "testString"); } diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java index 120621a9..da030a22 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/EventNotificationsTest.java @@ -33,15 +33,15 @@ public class EventNotificationsTest { @Test public void testEventNotifications() throws Throwable { EventNotifications eventNotificationsModel = new EventNotifications.Builder() - .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .instanceCrn("crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceId("crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") .sourceName("compliance") .build(); - assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); assertEquals(eventNotificationsModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(eventNotificationsModel.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModel.sourceId(), "crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); assertEquals(eventNotificationsModel.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); assertEquals(eventNotificationsModel.sourceName(), "compliance"); @@ -49,9 +49,9 @@ public void testEventNotifications() throws Throwable { EventNotifications eventNotificationsModelNew = TestUtilities.deserialize(json, EventNotifications.class); assertTrue(eventNotificationsModelNew instanceof EventNotifications); - assertEquals(eventNotificationsModelNew.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModelNew.instanceCrn(), "crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); assertEquals(eventNotificationsModelNew.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(eventNotificationsModelNew.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModelNew.sourceId(), "crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); assertEquals(eventNotificationsModelNew.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); assertEquals(eventNotificationsModelNew.sourceName(), "compliance"); } diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java index bdef3998..82b3745f 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileAttachmentOptionsTest.java @@ -33,12 +33,12 @@ public class GetProfileAttachmentOptionsTest { public void testGetProfileAttachmentOptions() throws Throwable { GetProfileAttachmentOptions getProfileAttachmentOptionsModel = new GetProfileAttachmentOptions.Builder() .attachmentId("testString") - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); assertEquals(getProfileAttachmentOptionsModel.attachmentId(), "testString"); - assertEquals(getProfileAttachmentOptionsModel.profilesId(), "testString"); + assertEquals(getProfileAttachmentOptionsModel.profileId(), "testString"); assertEquals(getProfileAttachmentOptionsModel.xCorrelationId(), "testString"); assertEquals(getProfileAttachmentOptionsModel.xRequestId(), "testString"); } diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java index 73923e46..058b78a7 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/GetProfileOptionsTest.java @@ -32,11 +32,11 @@ public class GetProfileOptionsTest { @Test public void testGetProfileOptions() throws Throwable { GetProfileOptions getProfileOptionsModel = new GetProfileOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .build(); - assertEquals(getProfileOptionsModel.profilesId(), "testString"); + assertEquals(getProfileOptionsModel.profileId(), "testString"); assertEquals(getProfileOptionsModel.xCorrelationId(), "testString"); assertEquals(getProfileOptionsModel.xRequestId(), "testString"); } diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java index 88fbfc01..77bb486e 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsOptionsTest.java @@ -32,13 +32,13 @@ public class ListAttachmentsOptionsTest { @Test public void testListAttachmentsOptions() throws Throwable { ListAttachmentsOptions listAttachmentsOptionsModel = new ListAttachmentsOptions.Builder() - .profilesId("testString") + .profileId("testString") .xCorrelationId("testString") .xRequestId("testString") .limit(Long.valueOf("50")) .start("testString") .build(); - assertEquals(listAttachmentsOptionsModel.profilesId(), "testString"); + assertEquals(listAttachmentsOptionsModel.profileId(), "testString"); assertEquals(listAttachmentsOptionsModel.xCorrelationId(), "testString"); assertEquals(listAttachmentsOptionsModel.xRequestId(), "testString"); assertEquals(listAttachmentsOptionsModel.limit(), Long.valueOf("50")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java index 419079ca..f39a4cd4 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListReportEvaluationsOptionsTest.java @@ -36,8 +36,10 @@ public void testListReportEvaluationsOptions() throws Throwable { .xCorrelationId("testString") .xRequestId("testString") .assessmentId("testString") + .assessmentMethod("testString") .componentId("testString") .targetId("testString") + .targetEnv("testString") .targetName("testString") .status("failure") .start("testString") @@ -47,8 +49,10 @@ public void testListReportEvaluationsOptions() throws Throwable { assertEquals(listReportEvaluationsOptionsModel.xCorrelationId(), "testString"); assertEquals(listReportEvaluationsOptionsModel.xRequestId(), "testString"); assertEquals(listReportEvaluationsOptionsModel.assessmentId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.assessmentMethod(), "testString"); assertEquals(listReportEvaluationsOptionsModel.componentId(), "testString"); assertEquals(listReportEvaluationsOptionsModel.targetId(), "testString"); + assertEquals(listReportEvaluationsOptionsModel.targetEnv(), "testString"); assertEquals(listReportEvaluationsOptionsModel.targetName(), "testString"); assertEquals(listReportEvaluationsOptionsModel.status(), "failure"); assertEquals(listReportEvaluationsOptionsModel.start(), "testString"); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceAttributesTest.java similarity index 56% rename from modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrTest.java rename to modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceAttributesTest.java index 3034157a..ed4a99d0 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceAttributesTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.security_and_compliance_center_api.v3.model; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceAttributes; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; @@ -23,23 +23,15 @@ import static org.testng.Assert.*; /** - * Unit test class for the RequiredConfigItemsRequiredConfigOr model. + * Unit test class for the ProviderTypeInstanceAttributes model. */ -public class RequiredConfigItemsRequiredConfigOrTest { +public class ProviderTypeInstanceAttributesTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testRequiredConfigItemsRequiredConfigOr() throws Throwable { - RequiredConfigItemsRequiredConfigOr requiredConfigItemsRequiredConfigOrModel = new RequiredConfigItemsRequiredConfigOr.Builder() - .description("testString") - .build(); - assertEquals(requiredConfigItemsRequiredConfigOrModel.description(), "testString"); - - String json = TestUtilities.serialize(requiredConfigItemsRequiredConfigOrModel); - - RequiredConfigItemsRequiredConfigOr requiredConfigItemsRequiredConfigOrModelNew = TestUtilities.deserialize(json, RequiredConfigItemsRequiredConfigOr.class); - assertTrue(requiredConfigItemsRequiredConfigOrModelNew instanceof RequiredConfigItemsRequiredConfigOr); - assertEquals(requiredConfigItemsRequiredConfigOrModelNew.description(), "testString"); + public void testProviderTypeInstanceAttributes() throws Throwable { + ProviderTypeInstanceAttributes providerTypeInstanceAttributesModel = new ProviderTypeInstanceAttributes(); + assertNotNull(providerTypeInstanceAttributesModel); } } \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java index 43f490e8..cacbb9c8 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstanceItemTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.security_and_compliance_center_api.v3.model; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceAttributes; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java index 7d94ee45..45043cc7 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypeInstancesResponseTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceAttributes; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstancesResponse; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java index 841ae8f2..2e1a927c 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProviderTypesInstancesResponseTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceAttributes; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypeInstanceItem; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ProviderTypesInstancesResponse; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java index fb24cac2..12f51158 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceCustomControlLibraryOptionsTest.java @@ -67,7 +67,7 @@ public void testReplaceCustomControlLibraryOptions() throws Throwable { .controlSpecificationId("f3517159-889e-4781-819a-89d89b747c85") .responsibility("user") .componentId("f3517159-889e-4781-819a-89d89b747c85") - .componenetName("testString") + .componentName("testString") .environment("testString") .controlSpecificationDescription("testString") .assessmentsCount(Long.valueOf("26")) @@ -76,7 +76,7 @@ public void testReplaceCustomControlLibraryOptions() throws Throwable { assertEquals(controlSpecificationsModel.controlSpecificationId(), "f3517159-889e-4781-819a-89d89b747c85"); assertEquals(controlSpecificationsModel.responsibility(), "user"); assertEquals(controlSpecificationsModel.componentId(), "f3517159-889e-4781-819a-89d89b747c85"); - assertEquals(controlSpecificationsModel.componenetName(), "testString"); + assertEquals(controlSpecificationsModel.componentName(), "testString"); assertEquals(controlSpecificationsModel.environment(), "testString"); assertEquals(controlSpecificationsModel.controlSpecificationDescription(), "testString"); assertEquals(controlSpecificationsModel.assessmentsCount(), Long.valueOf("26")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java index 862b5138..031b2742 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileAttachmentOptionsTest.java @@ -92,7 +92,6 @@ public void testReplaceProfileAttachmentOptions() throws Throwable { ReplaceProfileAttachmentOptions replaceProfileAttachmentOptionsModel = new ReplaceProfileAttachmentOptions.Builder() .attachmentId("testString") - .profilesId("testString") .id("130003ea8bfa43c5aacea07a86da3000") .profileId("7ec45986-54fc-4b66-a303-d9577b078c65") .accountId("130003ea8bfa43c5aacea07a86da3000") @@ -114,7 +113,6 @@ public void testReplaceProfileAttachmentOptions() throws Throwable { .xRequestId("testString") .build(); assertEquals(replaceProfileAttachmentOptionsModel.attachmentId(), "testString"); - assertEquals(replaceProfileAttachmentOptionsModel.profilesId(), "testString"); assertEquals(replaceProfileAttachmentOptionsModel.id(), "130003ea8bfa43c5aacea07a86da3000"); assertEquals(replaceProfileAttachmentOptionsModel.profileId(), "7ec45986-54fc-4b66-a303-d9577b078c65"); assertEquals(replaceProfileAttachmentOptionsModel.accountId(), "130003ea8bfa43c5aacea07a86da3000"); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java index 6a78d864..b3b71f15 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceProfileOptionsTest.java @@ -56,7 +56,7 @@ public void testReplaceProfileOptions() throws Throwable { assertEquals(defaultParametersPrototypeModel.parameterType(), "string"); ReplaceProfileOptions replaceProfileOptionsModel = new ReplaceProfileOptions.Builder() - .profilesId("testString") + .profileId("testString") .profileName("testString") .profileDescription("testString") .profileType("predefined") @@ -65,7 +65,6 @@ public void testReplaceProfileOptions() throws Throwable { .xCorrelationId("testString") .xRequestId("testString") .build(); - assertEquals(replaceProfileOptionsModel.profilesId(), "testString"); assertEquals(replaceProfileOptionsModel.profileName(), "testString"); assertEquals(replaceProfileOptionsModel.profileDescription(), "testString"); assertEquals(replaceProfileOptionsModel.profileType(), "predefined"); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java index d90b030d..8842b0b6 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptionsTest.java @@ -18,9 +18,10 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; import com.ibm.cloud.security_and_compliance_center_api.v3.model.ReplaceRuleOptions; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetPrototype; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; @@ -46,23 +47,34 @@ public void testReplaceRuleOptions() throws Throwable { assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); assertEquals(additionalTargetAttributeModel.value(), "testString"); - Target targetModel = new Target.Builder() + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() .serviceName("testString") - .serviceDisplayName("testString") .resourceKind("testString") .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) .build(); - assertEquals(targetModel.serviceName(), "testString"); - assertEquals(targetModel.serviceDisplayName(), "testString"); - assertEquals(targetModel.resourceKind(), "testString"); - assertEquals(targetModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); + assertEquals(targetPrototypeModel.serviceName(), "testString"); + assertEquals(targetPrototypeModel.resourceKind(), "testString"); + assertEquals(targetPrototypeModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); - RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() + RequiredConfigBase requiredConfigBaseModel = new RequiredConfigBase.Builder() .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigBaseModel.value(), "testString"); + + RequiredConfigItemsRequiredConfigOrDepth1 requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOrDepth1.Builder() + .description("testString") + .or(java.util.Arrays.asList(requiredConfigBaseModel)) .build(); assertEquals(requiredConfigItemsModel.description(), "testString"); + assertEquals(requiredConfigItemsModel.or(), java.util.Arrays.asList(requiredConfigBaseModel)); - RequiredConfigRequiredConfigAnd requiredConfigModel = new RequiredConfigRequiredConfigAnd.Builder() + RequiredConfigAnd requiredConfigModel = new RequiredConfigAnd.Builder() .description("testString") .and(java.util.Arrays.asList(requiredConfigItemsModel)) .build(); @@ -89,9 +101,8 @@ public void testReplaceRuleOptions() throws Throwable { .ruleId("testString") .ifMatch("testString") .description("testString") - .target(targetModel) + .target(targetPrototypeModel) .requiredConfig(requiredConfigModel) - .type("user_defined") .version("testString") .xImport(importModel) .labels(java.util.Arrays.asList("testString")) @@ -101,9 +112,8 @@ public void testReplaceRuleOptions() throws Throwable { assertEquals(replaceRuleOptionsModel.ruleId(), "testString"); assertEquals(replaceRuleOptionsModel.ifMatch(), "testString"); assertEquals(replaceRuleOptionsModel.description(), "testString"); - assertEquals(replaceRuleOptionsModel.target(), targetModel); + assertEquals(replaceRuleOptionsModel.target(), targetPrototypeModel); assertEquals(replaceRuleOptionsModel.requiredConfig(), requiredConfigModel); - assertEquals(replaceRuleOptionsModel.type(), "user_defined"); assertEquals(replaceRuleOptionsModel.version(), "testString"); assertEquals(replaceRuleOptionsModel.xImport(), importModel); assertEquals(replaceRuleOptionsModel.labels(), java.util.Arrays.asList("testString")); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigAndTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigAndTest.java new file mode 100644 index 00000000..fa690bef --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigAndTest.java @@ -0,0 +1,67 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigAnd model. + */ +public class RequiredConfigAndTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigAnd() throws Throwable { + RequiredConfigBase requiredConfigBaseModel = new RequiredConfigBase.Builder() + .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigBaseModel.value(), "testString"); + + RequiredConfigItemsRequiredConfigOrDepth1 requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOrDepth1.Builder() + .description("testString") + .or(java.util.Arrays.asList(requiredConfigBaseModel)) + .build(); + assertEquals(requiredConfigItemsModel.description(), "testString"); + assertEquals(requiredConfigItemsModel.or(), java.util.Arrays.asList(requiredConfigBaseModel)); + + RequiredConfigAnd requiredConfigAndModel = new RequiredConfigAnd.Builder() + .description("testString") + .and(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + assertEquals(requiredConfigAndModel.description(), "testString"); + assertEquals(requiredConfigAndModel.and(), java.util.Arrays.asList(requiredConfigItemsModel)); + + String json = TestUtilities.serialize(requiredConfigAndModel); + + RequiredConfigAnd requiredConfigAndModelNew = TestUtilities.deserialize(json, RequiredConfigAnd.class); + assertTrue(requiredConfigAndModelNew instanceof RequiredConfigAnd); + assertEquals(requiredConfigAndModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBaseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBaseTest.java new file mode 100644 index 00000000..edae6239 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigBaseTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigBase model. + */ +public class RequiredConfigBaseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigBase() throws Throwable { + RequiredConfigBase requiredConfigBaseModel = new RequiredConfigBase.Builder() + .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigBaseModel.value(), "testString"); + + String json = TestUtilities.serialize(requiredConfigBaseModel); + + RequiredConfigBase requiredConfigBaseModelNew = TestUtilities.deserialize(json, RequiredConfigBase.class); + assertTrue(requiredConfigBaseModelNew instanceof RequiredConfigBase); + assertEquals(requiredConfigBaseModelNew.description(), "testString"); + assertEquals(requiredConfigBaseModelNew.property(), "testString"); + assertEquals(requiredConfigBaseModelNew.operator(), "string_equals"); + assertEquals(requiredConfigBaseModelNew.value(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRequiredConfigBaseError() throws Throwable { + new RequiredConfigBase.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndDepth1Test.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndDepth1Test.java new file mode 100644 index 00000000..9e19f55a --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndDepth1Test.java @@ -0,0 +1,59 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAndDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigItemsRequiredConfigAndDepth1 model. + */ +public class RequiredConfigItemsRequiredConfigAndDepth1Test { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigItemsRequiredConfigAndDepth1() throws Throwable { + RequiredConfigBase requiredConfigBaseModel = new RequiredConfigBase.Builder() + .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigBaseModel.value(), "testString"); + + RequiredConfigItemsRequiredConfigAndDepth1 requiredConfigItemsRequiredConfigAndDepth1Model = new RequiredConfigItemsRequiredConfigAndDepth1.Builder() + .description("testString") + .and(java.util.Arrays.asList(requiredConfigBaseModel)) + .build(); + assertEquals(requiredConfigItemsRequiredConfigAndDepth1Model.description(), "testString"); + assertEquals(requiredConfigItemsRequiredConfigAndDepth1Model.and(), java.util.Arrays.asList(requiredConfigBaseModel)); + + String json = TestUtilities.serialize(requiredConfigItemsRequiredConfigAndDepth1Model); + + RequiredConfigItemsRequiredConfigAndDepth1 requiredConfigItemsRequiredConfigAndDepth1ModelNew = TestUtilities.deserialize(json, RequiredConfigItemsRequiredConfigAndDepth1.class); + assertTrue(requiredConfigItemsRequiredConfigAndDepth1ModelNew instanceof RequiredConfigItemsRequiredConfigAndDepth1); + assertEquals(requiredConfigItemsRequiredConfigAndDepth1ModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrDepth1Test.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrDepth1Test.java new file mode 100644 index 00000000..03b4c2c2 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigOrDepth1Test.java @@ -0,0 +1,59 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigItemsRequiredConfigOrDepth1 model. + */ +public class RequiredConfigItemsRequiredConfigOrDepth1Test { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigItemsRequiredConfigOrDepth1() throws Throwable { + RequiredConfigBase requiredConfigBaseModel = new RequiredConfigBase.Builder() + .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigBaseModel.value(), "testString"); + + RequiredConfigItemsRequiredConfigOrDepth1 requiredConfigItemsRequiredConfigOrDepth1Model = new RequiredConfigItemsRequiredConfigOrDepth1.Builder() + .description("testString") + .or(java.util.Arrays.asList(requiredConfigBaseModel)) + .build(); + assertEquals(requiredConfigItemsRequiredConfigOrDepth1Model.description(), "testString"); + assertEquals(requiredConfigItemsRequiredConfigOrDepth1Model.or(), java.util.Arrays.asList(requiredConfigBaseModel)); + + String json = TestUtilities.serialize(requiredConfigItemsRequiredConfigOrDepth1Model); + + RequiredConfigItemsRequiredConfigOrDepth1 requiredConfigItemsRequiredConfigOrDepth1ModelNew = TestUtilities.deserialize(json, RequiredConfigItemsRequiredConfigOrDepth1.class); + assertTrue(requiredConfigItemsRequiredConfigOrDepth1ModelNew instanceof RequiredConfigItemsRequiredConfigOrDepth1); + assertEquals(requiredConfigItemsRequiredConfigOrDepth1ModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java index fcf12658..2680cbb8 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.security_and_compliance_center_api.v3.model; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItems; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigOrTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigOrTest.java new file mode 100644 index 00000000..561072c4 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigOrTest.java @@ -0,0 +1,67 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RequiredConfigOr model. + */ +public class RequiredConfigOrTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRequiredConfigOr() throws Throwable { + RequiredConfigBase requiredConfigBaseModel = new RequiredConfigBase.Builder() + .description("testString") + .property("testString") + .operator("string_equals") + .value("testString") + .build(); + assertEquals(requiredConfigBaseModel.description(), "testString"); + assertEquals(requiredConfigBaseModel.property(), "testString"); + assertEquals(requiredConfigBaseModel.operator(), "string_equals"); + assertEquals(requiredConfigBaseModel.value(), "testString"); + + RequiredConfigItemsRequiredConfigOrDepth1 requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOrDepth1.Builder() + .description("testString") + .or(java.util.Arrays.asList(requiredConfigBaseModel)) + .build(); + assertEquals(requiredConfigItemsModel.description(), "testString"); + assertEquals(requiredConfigItemsModel.or(), java.util.Arrays.asList(requiredConfigBaseModel)); + + RequiredConfigOr requiredConfigOrModel = new RequiredConfigOr.Builder() + .description("testString") + .or(java.util.Arrays.asList(requiredConfigItemsModel)) + .build(); + assertEquals(requiredConfigOrModel.description(), "testString"); + assertEquals(requiredConfigOrModel.or(), java.util.Arrays.asList(requiredConfigItemsModel)); + + String json = TestUtilities.serialize(requiredConfigOrModel); + + RequiredConfigOr requiredConfigOrModelNew = TestUtilities.deserialize(json, RequiredConfigOr.class); + assertTrue(requiredConfigOrModelNew instanceof RequiredConfigOr); + assertEquals(requiredConfigOrModelNew.description(), "testString"); + } +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java deleted file mode 100644 index cd92e335..00000000 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigAndTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2023. - * - * Licensed 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. - */ - -package com.ibm.cloud.security_and_compliance_center_api.v3.model; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; -import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RequiredConfigRequiredConfigAnd model. - */ -public class RequiredConfigRequiredConfigAndTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRequiredConfigRequiredConfigAnd() throws Throwable { - RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() - .description("testString") - .build(); - assertEquals(requiredConfigItemsModel.description(), "testString"); - - RequiredConfigRequiredConfigAnd requiredConfigRequiredConfigAndModel = new RequiredConfigRequiredConfigAnd.Builder() - .description("testString") - .and(java.util.Arrays.asList(requiredConfigItemsModel)) - .build(); - assertEquals(requiredConfigRequiredConfigAndModel.description(), "testString"); - assertEquals(requiredConfigRequiredConfigAndModel.and(), java.util.Arrays.asList(requiredConfigItemsModel)); - - String json = TestUtilities.serialize(requiredConfigRequiredConfigAndModel); - - RequiredConfigRequiredConfigAnd requiredConfigRequiredConfigAndModelNew = TestUtilities.deserialize(json, RequiredConfigRequiredConfigAnd.class); - assertTrue(requiredConfigRequiredConfigAndModelNew instanceof RequiredConfigRequiredConfigAnd); - assertEquals(requiredConfigRequiredConfigAndModelNew.description(), "testString"); - } -} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java deleted file mode 100644 index 24f44889..00000000 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigRequiredConfigOrTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2023. - * - * Licensed 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. - */ - -package com.ibm.cloud.security_and_compliance_center_api.v3.model; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the RequiredConfigRequiredConfigOr model. - */ -public class RequiredConfigRequiredConfigOrTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRequiredConfigRequiredConfigOr() throws Throwable { - RequiredConfigItemsRequiredConfigOr requiredConfigItemsModel = new RequiredConfigItemsRequiredConfigOr.Builder() - .description("testString") - .build(); - assertEquals(requiredConfigItemsModel.description(), "testString"); - - RequiredConfigRequiredConfigOr requiredConfigRequiredConfigOrModel = new RequiredConfigRequiredConfigOr.Builder() - .description("testString") - .or(java.util.Arrays.asList(requiredConfigItemsModel)) - .build(); - assertEquals(requiredConfigRequiredConfigOrModel.description(), "testString"); - assertEquals(requiredConfigRequiredConfigOrModel.or(), java.util.Arrays.asList(requiredConfigItemsModel)); - - String json = TestUtilities.serialize(requiredConfigRequiredConfigOrModel); - - RequiredConfigRequiredConfigOr requiredConfigRequiredConfigOrModelNew = TestUtilities.deserialize(json, RequiredConfigRequiredConfigOr.class); - assertTrue(requiredConfigRequiredConfigOrModelNew instanceof RequiredConfigRequiredConfigOr); - assertEquals(requiredConfigRequiredConfigOrModelNew.description(), "testString"); - } -} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java index 60efce86..34309d65 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigTest.java @@ -15,7 +15,8 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfig; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java index f2ec5d84..cef72dce 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RuleTest.java @@ -17,8 +17,9 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Import; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java index 8732fc1c..c8576153 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RulesPageBaseTest.java @@ -20,8 +20,9 @@ import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefFirst; import com.ibm.cloud.security_and_compliance_center_api.v3.model.PageHRefNext; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Parameter; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOr; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigBase; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigOrDepth1; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Rule; import com.ibm.cloud.security_and_compliance_center_api.v3.model.RulesPageBase; import com.ibm.cloud.security_and_compliance_center_api.v3.model.Target; diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java index 7fe184e2..37ab06ca 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/SettingsTest.java @@ -35,15 +35,15 @@ public class SettingsTest { @Test public void testSettings() throws Throwable { EventNotifications eventNotificationsModel = new EventNotifications.Builder() - .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .instanceCrn("crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") .updatedOn(DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")) - .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceId("crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") .sourceName("compliance") .build(); - assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); assertEquals(eventNotificationsModel.updatedOn(), DateUtils.parseAsDateTime("2000-01-23T04:56:07.000+00:00")); - assertEquals(eventNotificationsModel.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModel.sourceId(), "crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); assertEquals(eventNotificationsModel.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); assertEquals(eventNotificationsModel.sourceName(), "compliance"); diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototypeTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototypeTest.java new file mode 100644 index 00000000..6d0e5dfa --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetPrototypeTest.java @@ -0,0 +1,66 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.AdditionalTargetAttribute; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.TargetPrototype; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the TargetPrototype model. + */ +public class TargetPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testTargetPrototype() throws Throwable { + AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() + .name("name") + .operator("string_equals") + .value("value") + .build(); + assertEquals(additionalTargetAttributeModel.name(), "name"); + assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); + assertEquals(additionalTargetAttributeModel.value(), "value"); + + TargetPrototype targetPrototypeModel = new TargetPrototype.Builder() + .serviceName("testString") + .resourceKind("testString") + .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) + .build(); + assertEquals(targetPrototypeModel.serviceName(), "testString"); + assertEquals(targetPrototypeModel.resourceKind(), "testString"); + assertEquals(targetPrototypeModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); + + String json = TestUtilities.serialize(targetPrototypeModel); + + TargetPrototype targetPrototypeModelNew = TestUtilities.deserialize(json, TargetPrototype.class); + assertTrue(targetPrototypeModelNew instanceof TargetPrototype); + assertEquals(targetPrototypeModelNew.serviceName(), "testString"); + assertEquals(targetPrototypeModelNew.resourceKind(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testTargetPrototypeError() throws Throwable { + new TargetPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java index e4f584dd..54af5e1e 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/TargetTest.java @@ -32,38 +32,10 @@ public class TargetTest { @Test public void testTarget() throws Throwable { - AdditionalTargetAttribute additionalTargetAttributeModel = new AdditionalTargetAttribute.Builder() - .name("name") - .operator("string_equals") - .value("value") - .build(); - assertEquals(additionalTargetAttributeModel.name(), "name"); - assertEquals(additionalTargetAttributeModel.operator(), "string_equals"); - assertEquals(additionalTargetAttributeModel.value(), "value"); - - Target targetModel = new Target.Builder() - .serviceName("testString") - .serviceDisplayName("testString") - .resourceKind("testString") - .additionalTargetAttributes(java.util.Arrays.asList(additionalTargetAttributeModel)) - .build(); - assertEquals(targetModel.serviceName(), "testString"); - assertEquals(targetModel.serviceDisplayName(), "testString"); - assertEquals(targetModel.resourceKind(), "testString"); - assertEquals(targetModel.additionalTargetAttributes(), java.util.Arrays.asList(additionalTargetAttributeModel)); - - String json = TestUtilities.serialize(targetModel); - - Target targetModelNew = TestUtilities.deserialize(json, Target.class); - assertTrue(targetModelNew instanceof Target); - assertEquals(targetModelNew.serviceName(), "testString"); - assertEquals(targetModelNew.serviceDisplayName(), "testString"); - assertEquals(targetModelNew.resourceKind(), "testString"); + Target targetModel = new Target(); + assertNull(targetModel.getServiceName()); + assertNull(targetModel.getServiceDisplayName()); + assertNull(targetModel.getResourceKind()); + assertNull(targetModel.getAdditionalTargetAttributes()); } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTargetError() throws Throwable { - new Target.Builder().build(); - } - } \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java index 57481521..837d1bea 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceOptionsTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceOptions; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; @@ -31,18 +32,21 @@ public class UpdateProviderTypeInstanceOptionsTest { @Test public void testUpdateProviderTypeInstanceOptions() throws Throwable { + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName updateProviderTypeInstanceRequestModel = new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.Builder() + .name("workload-protection-instance-1") + .build(); + assertEquals(updateProviderTypeInstanceRequestModel.name(), "workload-protection-instance-1"); + UpdateProviderTypeInstanceOptions updateProviderTypeInstanceOptionsModel = new UpdateProviderTypeInstanceOptions.Builder() .providerTypeId("testString") .providerTypeInstanceId("testString") - .name("workload-protection-instance-1") - .attributes(java.util.Collections.singletonMap("anyKey", "anyValue")) + .updateProviderTypeInstanceRequest(updateProviderTypeInstanceRequestModel) .xCorrelationId("testString") .xRequestId("testString") .build(); assertEquals(updateProviderTypeInstanceOptionsModel.providerTypeId(), "testString"); assertEquals(updateProviderTypeInstanceOptionsModel.providerTypeInstanceId(), "testString"); - assertEquals(updateProviderTypeInstanceOptionsModel.name(), "workload-protection-instance-1"); - assertEquals(updateProviderTypeInstanceOptionsModel.attributes(), java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(updateProviderTypeInstanceOptionsModel.updateProviderTypeInstanceRequest(), updateProviderTypeInstanceRequestModel); assertEquals(updateProviderTypeInstanceOptionsModel.xCorrelationId(), "testString"); assertEquals(updateProviderTypeInstanceOptionsModel.xRequestId(), "testString"); } diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesTest.java new file mode 100644 index 00000000..d8405175 --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes model. + */ +public class UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes() throws Throwable { + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesModel = new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.Builder() + .attributes(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesModel.attributes(), java.util.Collections.singletonMap("anyKey", "anyValue")); + + String json = TestUtilities.serialize(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesModel); + + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesModelNew = TestUtilities.deserialize(json, UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.class); + assertTrue(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesModelNew instanceof UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes); + assertEquals(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesModelNew.attributes().toString(), java.util.Collections.singletonMap("anyKey", "anyValue").toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributesError() throws Throwable { + new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingAttributes.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameTest.java new file mode 100644 index 00000000..bc8e06bb --- /dev/null +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * Licensed 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. + */ + +package com.ibm.cloud.security_and_compliance_center_api.v3.model; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName; +import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName model. + */ +public class UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName() throws Throwable { + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameModel = new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.Builder() + .name("workload-protection-instance-1") + .build(); + assertEquals(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameModel.name(), "workload-protection-instance-1"); + + String json = TestUtilities.serialize(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameModel); + + UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameModelNew = TestUtilities.deserialize(json, UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.class); + assertTrue(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameModelNew instanceof UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName); + assertEquals(updateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameModelNew.name(), "workload-protection-instance-1"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingNameError() throws Throwable { + new UpdateProviderTypeInstanceRequestProviderTypeInstancePrototypeForPatchingName.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestTest.java similarity index 55% rename from modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndTest.java rename to modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestTest.java index fec2b590..b9ea0a06 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/RequiredConfigItemsRequiredConfigAndTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateProviderTypeInstanceRequestTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.security_and_compliance_center_api.v3.model; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.security_and_compliance_center_api.v3.model.RequiredConfigItemsRequiredConfigAnd; +import com.ibm.cloud.security_and_compliance_center_api.v3.model.UpdateProviderTypeInstanceRequest; import com.ibm.cloud.security_and_compliance_center_api.v3.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; @@ -23,23 +23,16 @@ import static org.testng.Assert.*; /** - * Unit test class for the RequiredConfigItemsRequiredConfigAnd model. + * Unit test class for the UpdateProviderTypeInstanceRequest model. */ -public class RequiredConfigItemsRequiredConfigAndTest { +public class UpdateProviderTypeInstanceRequestTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + // TODO: Add tests for models that are abstract @Test - public void testRequiredConfigItemsRequiredConfigAnd() throws Throwable { - RequiredConfigItemsRequiredConfigAnd requiredConfigItemsRequiredConfigAndModel = new RequiredConfigItemsRequiredConfigAnd.Builder() - .description("testString") - .build(); - assertEquals(requiredConfigItemsRequiredConfigAndModel.description(), "testString"); - - String json = TestUtilities.serialize(requiredConfigItemsRequiredConfigAndModel); - - RequiredConfigItemsRequiredConfigAnd requiredConfigItemsRequiredConfigAndModelNew = TestUtilities.deserialize(json, RequiredConfigItemsRequiredConfigAnd.class); - assertTrue(requiredConfigItemsRequiredConfigAndModelNew instanceof RequiredConfigItemsRequiredConfigAnd); - assertEquals(requiredConfigItemsRequiredConfigAndModelNew.description(), "testString"); + public void testUpdateProviderTypeInstanceRequest() throws Throwable { + UpdateProviderTypeInstanceRequest updateProviderTypeInstanceRequestModel = new UpdateProviderTypeInstanceRequest(); + assertNotNull(updateProviderTypeInstanceRequestModel); } } \ No newline at end of file diff --git a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java index 737a867b..8d376241 100644 --- a/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java +++ b/modules/security-and-compliance-center-api/src/test/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptionsTest.java @@ -35,15 +35,15 @@ public class UpdateSettingsOptionsTest { @Test public void testUpdateSettingsOptions() throws Throwable { EventNotifications eventNotificationsModel = new EventNotifications.Builder() - .instanceCrn("crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") + .instanceCrn("crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::") .updatedOn(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .sourceId("crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") + .sourceId("crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::") .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.") .sourceName("compliance") .build(); - assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); + assertEquals(eventNotificationsModel.instanceCrn(), "crn:v1:bluemix:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::"); assertEquals(eventNotificationsModel.updatedOn(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(eventNotificationsModel.sourceId(), "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); + assertEquals(eventNotificationsModel.sourceId(), "crn:v1:bluemix:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::"); assertEquals(eventNotificationsModel.sourceDescription(), "This source is used for integration with IBM Cloud Security and Compliance Center."); assertEquals(eventNotificationsModel.sourceName(), "compliance");