@ibm-cloud/secrets-manager 1.0.33 → 1.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ var __assign = (this && this.__assign) || function () {
39
39
  return __assign.apply(this, arguments);
40
40
  };
41
41
  /**
42
- * IBM OpenAPI SDK Code Generator Version: 3.48.0-e80b60a1-20220414-145125
42
+ * IBM OpenAPI SDK Code Generator Version: 3.51.0-5b8b699d-20220613-200818
43
43
  */
44
44
  var extend = require("extend");
45
45
  var ibm_cloud_sdk_core_1 = require("ibm-cloud-sdk-core");
@@ -49,7 +49,7 @@ var common_1 = require("../lib/common");
49
49
  * services or your custom-built applications. Secrets are stored in a dedicated instance of Secrets Manager, which is
50
50
  * built on open source HashiCorp Vault.
51
51
  *
52
- * API Version: 1.0.33
52
+ * API Version: 1.0.0
53
53
  * See: https://cloud.ibm.com/docs/secrets-manager
54
54
  */
55
55
  var SecretsManagerV1 = /** @class */ (function (_super) {
@@ -361,12 +361,12 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
361
361
  * resources.
362
362
  *
363
363
  * **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
364
- * `../secrets/{secret-type}?limit=5`.
364
+ * `../secrets/{secret_type}?limit=5`.
365
365
  * @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
366
366
  * items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
367
367
  *
368
368
  * **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
369
- * `../secrets/{secret-type}?offset=25&limit=25`.
369
+ * `..?offset=25&limit=25`.
370
370
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
371
371
  * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
372
372
  */
@@ -412,28 +412,28 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
412
412
  * resources.
413
413
  *
414
414
  * **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
415
- * `../secrets/{secret-type}?limit=5`.
415
+ * `../secrets/{secret_type}?limit=5`.
416
416
  * @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
417
417
  * items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
418
418
  *
419
419
  * **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
420
- * `../secrets/{secret-type}?offset=25&limit=25`.
420
+ * `..?offset=25&limit=25`.
421
421
  * @param {string} [params.search] - Filter secrets that contain the specified string. The fields that are searched
422
422
  * include: id, name, description, labels, secret_type.
423
423
  *
424
424
  * **Usage:** If you want to list only the secrets that contain the string "text", use
425
- * `../secrets/{secret-type}?search=text`.
425
+ * `../secrets/{secret_type}?search=text`.
426
426
  * @param {string} [params.sortBy] - Sort a list of secrets by the specified field.
427
427
  *
428
428
  * **Usage:** To sort a list of secrets by their creation date, use
429
- * `../secrets/{secret-type}?sort_by=creation_date`.
429
+ * `../secrets/{secret_type}?sort_by=creation_date`.
430
430
  * @param {string[]} [params.groups] - Filter secrets by groups.
431
431
  *
432
432
  * You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter secrets
433
433
  * that are in the default secret group, use the `default` keyword.
434
434
  *
435
435
  * **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
436
- * use `../secrets?groups={secret_group_ID},default`.
436
+ * use `..?groups={secret_group_ID},default`.
437
437
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
438
438
  * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
439
439
  */
@@ -871,6 +871,441 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
871
871
  };
872
872
  return this.createRequest(parameters);
873
873
  };
874
+ /*************************
875
+ * locks
876
+ ************************/
877
+ /**
878
+ * List secret locks.
879
+ *
880
+ * List the locks that are associated with a specified secret.
881
+ *
882
+ * @param {Object} params - The parameters to send to the service.
883
+ * @param {string} params.secretType - The secret type.
884
+ * @param {string} params.id - The v4 UUID that uniquely identifies the secret.
885
+ * @param {number} [params.limit] - The number of secrets with locks to retrieve. By default, list operations return
886
+ * the first 25 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
887
+ * resources.
888
+ *
889
+ * **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 with locks, use
890
+ * `..?limit=5`.
891
+ * @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
892
+ * items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
893
+ *
894
+ * **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
895
+ * `..?offset=25&limit=25`.
896
+ * @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
897
+ *
898
+ * **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
899
+ * `..?search=text`.
900
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
901
+ * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretLocks>>}
902
+ */
903
+ SecretsManagerV1.prototype.getLocks = function (params) {
904
+ var _params = __assign({}, params);
905
+ var _requiredParams = ['secretType', 'id'];
906
+ var _validParams = ['secretType', 'id', 'limit', 'offset', 'search', 'headers'];
907
+ var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
908
+ if (_validationErrors) {
909
+ return Promise.reject(_validationErrors);
910
+ }
911
+ var query = {
912
+ 'limit': _params.limit,
913
+ 'offset': _params.offset,
914
+ 'search': _params.search,
915
+ };
916
+ var path = {
917
+ 'secret_type': _params.secretType,
918
+ 'id': _params.id,
919
+ };
920
+ var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getLocks');
921
+ var parameters = {
922
+ options: {
923
+ url: '/api/v1/locks/{secret_type}/{id}',
924
+ method: 'GET',
925
+ qs: query,
926
+ path: path,
927
+ },
928
+ defaultOptions: extend(true, {}, this.baseOptions, {
929
+ headers: extend(true, sdkHeaders, {
930
+ 'Accept': 'application/json',
931
+ }, _params.headers),
932
+ }),
933
+ };
934
+ return this.createRequest(parameters);
935
+ };
936
+ /**
937
+ * Lock a secret.
938
+ *
939
+ * Create a lock on the current version of a secret.
940
+ *
941
+ * A lock can be used to prevent a secret from being deleted or modified while it's in use by your applications. A
942
+ * successful request attaches a new lock to your secret, or replaces a lock of the same name if it already exists.
943
+ * Additionally, you can use this method to clear any matching locks on a secret by using one of the following
944
+ * optional lock modes:
945
+ *
946
+ * - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
947
+ * - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
948
+ * it doesn't have any locks.
949
+ *
950
+ * For more information about locking secrets, check out the
951
+ * [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-locks).
952
+ *
953
+ * @param {Object} params - The parameters to send to the service.
954
+ * @param {string} params.secretType - The secret type.
955
+ * @param {string} params.id - The v4 UUID that uniquely identifies the secret.
956
+ * @param {LockSecretBodyLocksItem[]} [params.locks] - The lock data to be attached to a secret version.
957
+ * @param {string} [params.mode] - An optional lock mode. At lock creation, you can set one of the following modes to
958
+ * clear any matching locks on a secret version.
959
+ *
960
+ * - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
961
+ * - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
962
+ * it doesn't have any locks.
963
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
964
+ * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
965
+ */
966
+ SecretsManagerV1.prototype.lockSecret = function (params) {
967
+ var _params = __assign({}, params);
968
+ var _requiredParams = ['secretType', 'id'];
969
+ var _validParams = ['secretType', 'id', 'locks', 'mode', 'headers'];
970
+ var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
971
+ if (_validationErrors) {
972
+ return Promise.reject(_validationErrors);
973
+ }
974
+ var body = {
975
+ 'locks': _params.locks,
976
+ };
977
+ var query = {
978
+ 'mode': _params.mode,
979
+ };
980
+ var path = {
981
+ 'secret_type': _params.secretType,
982
+ 'id': _params.id,
983
+ };
984
+ var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'lockSecret');
985
+ var parameters = {
986
+ options: {
987
+ url: '/api/v1/locks/{secret_type}/{id}/lock',
988
+ method: 'POST',
989
+ body: body,
990
+ qs: query,
991
+ path: path,
992
+ },
993
+ defaultOptions: extend(true, {}, this.baseOptions, {
994
+ headers: extend(true, sdkHeaders, {
995
+ 'Accept': 'application/json',
996
+ 'Content-Type': 'application/json',
997
+ }, _params.headers),
998
+ }),
999
+ };
1000
+ return this.createRequest(parameters);
1001
+ };
1002
+ /**
1003
+ * Unlock a secret.
1004
+ *
1005
+ * Delete one or more locks that are associated with the current version of a secret.
1006
+ *
1007
+ * A successful request deletes the locks that you specify. To remove all locks, you can pass `{"locks": ["*"]}` in in
1008
+ * the request body. Otherwise, specify the names of the locks that you want to delete. For example, `{"locks":
1009
+ * ["lock1", "lock2"]}`.
1010
+ *
1011
+ * **Note:** A secret is considered unlocked and able to be revoked or deleted only after all of its locks are
1012
+ * removed. To understand whether a secret contains locks, check the `locks_total` field that is returned as part of
1013
+ * the metadata of your secret.
1014
+ *
1015
+ * @param {Object} params - The parameters to send to the service.
1016
+ * @param {string} params.secretType - The secret type.
1017
+ * @param {string} params.id - The v4 UUID that uniquely identifies the secret.
1018
+ * @param {string[]} [params.locks] - A comma-separated list of locks to delete.
1019
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1020
+ * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
1021
+ */
1022
+ SecretsManagerV1.prototype.unlockSecret = function (params) {
1023
+ var _params = __assign({}, params);
1024
+ var _requiredParams = ['secretType', 'id'];
1025
+ var _validParams = ['secretType', 'id', 'locks', 'headers'];
1026
+ var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
1027
+ if (_validationErrors) {
1028
+ return Promise.reject(_validationErrors);
1029
+ }
1030
+ var body = {
1031
+ 'locks': _params.locks,
1032
+ };
1033
+ var path = {
1034
+ 'secret_type': _params.secretType,
1035
+ 'id': _params.id,
1036
+ };
1037
+ var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'unlockSecret');
1038
+ var parameters = {
1039
+ options: {
1040
+ url: '/api/v1/locks/{secret_type}/{id}/unlock',
1041
+ method: 'POST',
1042
+ body: body,
1043
+ path: path,
1044
+ },
1045
+ defaultOptions: extend(true, {}, this.baseOptions, {
1046
+ headers: extend(true, sdkHeaders, {
1047
+ 'Accept': 'application/json',
1048
+ 'Content-Type': 'application/json',
1049
+ }, _params.headers),
1050
+ }),
1051
+ };
1052
+ return this.createRequest(parameters);
1053
+ };
1054
+ /**
1055
+ * List secret version locks.
1056
+ *
1057
+ * List the locks that are associated with a specified secret version.
1058
+ *
1059
+ * @param {Object} params - The parameters to send to the service.
1060
+ * @param {string} params.secretType - The secret type.
1061
+ * @param {string} params.id - The v4 UUID that uniquely identifies the secret.
1062
+ * @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
1063
+ * `previous` to retrieve the previous version.
1064
+ *
1065
+ * **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
1066
+ * the response details.
1067
+ * @param {number} [params.limit] - The number of secrets with locks to retrieve. By default, list operations return
1068
+ * the first 25 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
1069
+ * resources.
1070
+ *
1071
+ * **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 with locks, use
1072
+ * `..?limit=5`.
1073
+ * @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
1074
+ * items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
1075
+ *
1076
+ * **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
1077
+ * `..?offset=25&limit=25`.
1078
+ * @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
1079
+ *
1080
+ * **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
1081
+ * `..?search=text`.
1082
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1083
+ * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretLocks>>}
1084
+ */
1085
+ SecretsManagerV1.prototype.getSecretVersionLocks = function (params) {
1086
+ var _params = __assign({}, params);
1087
+ var _requiredParams = ['secretType', 'id', 'versionId'];
1088
+ var _validParams = ['secretType', 'id', 'versionId', 'limit', 'offset', 'search', 'headers'];
1089
+ var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
1090
+ if (_validationErrors) {
1091
+ return Promise.reject(_validationErrors);
1092
+ }
1093
+ var query = {
1094
+ 'limit': _params.limit,
1095
+ 'offset': _params.offset,
1096
+ 'search': _params.search,
1097
+ };
1098
+ var path = {
1099
+ 'secret_type': _params.secretType,
1100
+ 'id': _params.id,
1101
+ 'version_id': _params.versionId,
1102
+ };
1103
+ var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecretVersionLocks');
1104
+ var parameters = {
1105
+ options: {
1106
+ url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}',
1107
+ method: 'GET',
1108
+ qs: query,
1109
+ path: path,
1110
+ },
1111
+ defaultOptions: extend(true, {}, this.baseOptions, {
1112
+ headers: extend(true, sdkHeaders, {
1113
+ 'Accept': 'application/json',
1114
+ }, _params.headers),
1115
+ }),
1116
+ };
1117
+ return this.createRequest(parameters);
1118
+ };
1119
+ /**
1120
+ * Lock a secret version.
1121
+ *
1122
+ * Create a lock on the specified version of a secret.
1123
+ *
1124
+ * A lock can be used to prevent a secret from being deleted or modified while it's in use by your applications. A
1125
+ * successful request attaches a new lock to the specified version, or replaces a lock of the same name if it already
1126
+ * exists. Additionally, you can use this method to clear any matching locks on a secret version by using one of the
1127
+ * following optional lock modes:
1128
+ *
1129
+ * - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
1130
+ * - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
1131
+ * it doesn't have any locks.
1132
+ *
1133
+ * For more information about locking secrets, check out the
1134
+ * [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-locks).
1135
+ *
1136
+ * @param {Object} params - The parameters to send to the service.
1137
+ * @param {string} params.secretType - The secret type.
1138
+ * @param {string} params.id - The v4 UUID that uniquely identifies the secret.
1139
+ * @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
1140
+ * `previous` to retrieve the previous version.
1141
+ *
1142
+ * **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
1143
+ * the response details.
1144
+ * @param {LockSecretBodyLocksItem[]} [params.locks] - The lock data to be attached to a secret version.
1145
+ * @param {string} [params.mode] - An optional lock mode. At lock creation, you can set one of the following modes to
1146
+ * clear any matching locks on a secret version.
1147
+ *
1148
+ * - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
1149
+ * - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
1150
+ * it doesn't have any locks.
1151
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1152
+ * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
1153
+ */
1154
+ SecretsManagerV1.prototype.lockSecretVersion = function (params) {
1155
+ var _params = __assign({}, params);
1156
+ var _requiredParams = ['secretType', 'id', 'versionId'];
1157
+ var _validParams = ['secretType', 'id', 'versionId', 'locks', 'mode', 'headers'];
1158
+ var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
1159
+ if (_validationErrors) {
1160
+ return Promise.reject(_validationErrors);
1161
+ }
1162
+ var body = {
1163
+ 'locks': _params.locks,
1164
+ };
1165
+ var query = {
1166
+ 'mode': _params.mode,
1167
+ };
1168
+ var path = {
1169
+ 'secret_type': _params.secretType,
1170
+ 'id': _params.id,
1171
+ 'version_id': _params.versionId,
1172
+ };
1173
+ var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'lockSecretVersion');
1174
+ var parameters = {
1175
+ options: {
1176
+ url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}/lock',
1177
+ method: 'POST',
1178
+ body: body,
1179
+ qs: query,
1180
+ path: path,
1181
+ },
1182
+ defaultOptions: extend(true, {}, this.baseOptions, {
1183
+ headers: extend(true, sdkHeaders, {
1184
+ 'Accept': 'application/json',
1185
+ 'Content-Type': 'application/json',
1186
+ }, _params.headers),
1187
+ }),
1188
+ };
1189
+ return this.createRequest(parameters);
1190
+ };
1191
+ /**
1192
+ * Unlock a secret version.
1193
+ *
1194
+ * Delete one or more locks that are associated with the specified secret version.
1195
+ *
1196
+ * A successful request deletes the locks that you specify. To remove all locks, you can pass `{"locks": ["*"]}` in in
1197
+ * the request body. Otherwise, specify the names of the locks that you want to delete. For example, `{"locks":
1198
+ * ["lock-1", "lock-2"]}`.
1199
+ *
1200
+ * **Note:** A secret is considered unlocked and able to be revoked or deleted only after all of its locks are
1201
+ * removed. To understand whether a secret contains locks, check the `locks_total` field that is returned as part of
1202
+ * the metadata of your secret.
1203
+ *
1204
+ * @param {Object} params - The parameters to send to the service.
1205
+ * @param {string} params.secretType - The secret type.
1206
+ * @param {string} params.id - The v4 UUID that uniquely identifies the secret.
1207
+ * @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
1208
+ * `previous` to retrieve the previous version.
1209
+ *
1210
+ * **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
1211
+ * the response details.
1212
+ * @param {string[]} [params.locks] - A comma-separated list of locks to delete.
1213
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1214
+ * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
1215
+ */
1216
+ SecretsManagerV1.prototype.unlockSecretVersion = function (params) {
1217
+ var _params = __assign({}, params);
1218
+ var _requiredParams = ['secretType', 'id', 'versionId'];
1219
+ var _validParams = ['secretType', 'id', 'versionId', 'locks', 'headers'];
1220
+ var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
1221
+ if (_validationErrors) {
1222
+ return Promise.reject(_validationErrors);
1223
+ }
1224
+ var body = {
1225
+ 'locks': _params.locks,
1226
+ };
1227
+ var path = {
1228
+ 'secret_type': _params.secretType,
1229
+ 'id': _params.id,
1230
+ 'version_id': _params.versionId,
1231
+ };
1232
+ var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'unlockSecretVersion');
1233
+ var parameters = {
1234
+ options: {
1235
+ url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}/unlock',
1236
+ method: 'POST',
1237
+ body: body,
1238
+ path: path,
1239
+ },
1240
+ defaultOptions: extend(true, {}, this.baseOptions, {
1241
+ headers: extend(true, sdkHeaders, {
1242
+ 'Accept': 'application/json',
1243
+ 'Content-Type': 'application/json',
1244
+ }, _params.headers),
1245
+ }),
1246
+ };
1247
+ return this.createRequest(parameters);
1248
+ };
1249
+ /**
1250
+ * List all secrets and locks.
1251
+ *
1252
+ * List the lock details that are associated with all secrets in your Secrets Manager instance.
1253
+ *
1254
+ * @param {Object} [params] - The parameters to send to the service.
1255
+ * @param {number} [params.limit] - The number of secrets with locks to retrieve. By default, list operations return
1256
+ * the first 25 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
1257
+ * resources.
1258
+ *
1259
+ * **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 with locks, use
1260
+ * `..?limit=5`.
1261
+ * @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
1262
+ * items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
1263
+ *
1264
+ * **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
1265
+ * `..?offset=25&limit=25`.
1266
+ * @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
1267
+ *
1268
+ * **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
1269
+ * `..?search=text`.
1270
+ * @param {string[]} [params.groups] - Filter secrets by groups.
1271
+ *
1272
+ * You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter secrets
1273
+ * that are in the default secret group, use the `default` keyword.
1274
+ *
1275
+ * **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
1276
+ * use `..?groups={secret_group_ID},default`.
1277
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1278
+ * @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetInstanceLocks>>}
1279
+ */
1280
+ SecretsManagerV1.prototype.listInstanceSecretsLocks = function (params) {
1281
+ var _params = __assign({}, params);
1282
+ var _requiredParams = [];
1283
+ var _validParams = ['limit', 'offset', 'search', 'groups', 'headers'];
1284
+ var _validationErrors = ibm_cloud_sdk_core_1.validateParams(_params, _requiredParams, _validParams);
1285
+ if (_validationErrors) {
1286
+ return Promise.reject(_validationErrors);
1287
+ }
1288
+ var query = {
1289
+ 'limit': _params.limit,
1290
+ 'offset': _params.offset,
1291
+ 'search': _params.search,
1292
+ 'groups': _params.groups,
1293
+ };
1294
+ var sdkHeaders = common_1.getSdkHeaders(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listInstanceSecretsLocks');
1295
+ var parameters = {
1296
+ options: {
1297
+ url: '/api/v1/locks',
1298
+ method: 'GET',
1299
+ qs: query,
1300
+ },
1301
+ defaultOptions: extend(true, {}, this.baseOptions, {
1302
+ headers: extend(true, sdkHeaders, {
1303
+ 'Accept': 'application/json',
1304
+ }, _params.headers),
1305
+ }),
1306
+ };
1307
+ return this.createRequest(parameters);
1308
+ };
874
1309
  /*************************
875
1310
  * policies
876
1311
  ************************/
@@ -1534,7 +1969,7 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
1534
1969
  /** Constants for the `listAllSecrets` operation. */
1535
1970
  var ListAllSecretsConstants;
1536
1971
  (function (ListAllSecretsConstants) {
1537
- /** Sort a list of secrets by the specified field. **Usage:** To sort a list of secrets by their creation date, use `../secrets/{secret-type}?sort_by=creation_date`. */
1972
+ /** Sort a list of secrets by the specified field. **Usage:** To sort a list of secrets by their creation date, use `../secrets/{secret_type}?sort_by=creation_date`. */
1538
1973
  var SortBy;
1539
1974
  (function (SortBy) {
1540
1975
  SortBy["ID"] = "id";
@@ -1686,6 +2121,108 @@ var SecretsManagerV1 = /** @class */ (function (_super) {
1686
2121
  SecretType["KV"] = "kv";
1687
2122
  })(SecretType = UpdateSecretMetadataConstants.SecretType || (UpdateSecretMetadataConstants.SecretType = {}));
1688
2123
  })(UpdateSecretMetadataConstants = SecretsManagerV1.UpdateSecretMetadataConstants || (SecretsManagerV1.UpdateSecretMetadataConstants = {}));
2124
+ /** Constants for the `getLocks` operation. */
2125
+ var GetLocksConstants;
2126
+ (function (GetLocksConstants) {
2127
+ /** The secret type. */
2128
+ var SecretType;
2129
+ (function (SecretType) {
2130
+ SecretType["ARBITRARY"] = "arbitrary";
2131
+ SecretType["IAM_CREDENTIALS"] = "iam_credentials";
2132
+ SecretType["IMPORTED_CERT"] = "imported_cert";
2133
+ SecretType["PUBLIC_CERT"] = "public_cert";
2134
+ SecretType["PRIVATE_CERT"] = "private_cert";
2135
+ SecretType["USERNAME_PASSWORD"] = "username_password";
2136
+ SecretType["KV"] = "kv";
2137
+ })(SecretType = GetLocksConstants.SecretType || (GetLocksConstants.SecretType = {}));
2138
+ })(GetLocksConstants = SecretsManagerV1.GetLocksConstants || (SecretsManagerV1.GetLocksConstants = {}));
2139
+ /** Constants for the `lockSecret` operation. */
2140
+ var LockSecretConstants;
2141
+ (function (LockSecretConstants) {
2142
+ /** The secret type. */
2143
+ var SecretType;
2144
+ (function (SecretType) {
2145
+ SecretType["ARBITRARY"] = "arbitrary";
2146
+ SecretType["IAM_CREDENTIALS"] = "iam_credentials";
2147
+ SecretType["IMPORTED_CERT"] = "imported_cert";
2148
+ SecretType["PUBLIC_CERT"] = "public_cert";
2149
+ SecretType["PRIVATE_CERT"] = "private_cert";
2150
+ SecretType["USERNAME_PASSWORD"] = "username_password";
2151
+ SecretType["KV"] = "kv";
2152
+ })(SecretType = LockSecretConstants.SecretType || (LockSecretConstants.SecretType = {}));
2153
+ /** An optional lock mode. At lock creation, you can set one of the following modes to clear any matching locks on a secret version. - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret. - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if it doesn't have any locks. */
2154
+ var Mode;
2155
+ (function (Mode) {
2156
+ Mode["EXCLUSIVE"] = "exclusive";
2157
+ Mode["EXCLUSIVE_DELETE"] = "exclusive_delete";
2158
+ })(Mode = LockSecretConstants.Mode || (LockSecretConstants.Mode = {}));
2159
+ })(LockSecretConstants = SecretsManagerV1.LockSecretConstants || (SecretsManagerV1.LockSecretConstants = {}));
2160
+ /** Constants for the `unlockSecret` operation. */
2161
+ var UnlockSecretConstants;
2162
+ (function (UnlockSecretConstants) {
2163
+ /** The secret type. */
2164
+ var SecretType;
2165
+ (function (SecretType) {
2166
+ SecretType["ARBITRARY"] = "arbitrary";
2167
+ SecretType["IAM_CREDENTIALS"] = "iam_credentials";
2168
+ SecretType["IMPORTED_CERT"] = "imported_cert";
2169
+ SecretType["PUBLIC_CERT"] = "public_cert";
2170
+ SecretType["PRIVATE_CERT"] = "private_cert";
2171
+ SecretType["USERNAME_PASSWORD"] = "username_password";
2172
+ SecretType["KV"] = "kv";
2173
+ })(SecretType = UnlockSecretConstants.SecretType || (UnlockSecretConstants.SecretType = {}));
2174
+ })(UnlockSecretConstants = SecretsManagerV1.UnlockSecretConstants || (SecretsManagerV1.UnlockSecretConstants = {}));
2175
+ /** Constants for the `getSecretVersionLocks` operation. */
2176
+ var GetSecretVersionLocksConstants;
2177
+ (function (GetSecretVersionLocksConstants) {
2178
+ /** The secret type. */
2179
+ var SecretType;
2180
+ (function (SecretType) {
2181
+ SecretType["ARBITRARY"] = "arbitrary";
2182
+ SecretType["IAM_CREDENTIALS"] = "iam_credentials";
2183
+ SecretType["IMPORTED_CERT"] = "imported_cert";
2184
+ SecretType["PUBLIC_CERT"] = "public_cert";
2185
+ SecretType["PRIVATE_CERT"] = "private_cert";
2186
+ SecretType["USERNAME_PASSWORD"] = "username_password";
2187
+ SecretType["KV"] = "kv";
2188
+ })(SecretType = GetSecretVersionLocksConstants.SecretType || (GetSecretVersionLocksConstants.SecretType = {}));
2189
+ })(GetSecretVersionLocksConstants = SecretsManagerV1.GetSecretVersionLocksConstants || (SecretsManagerV1.GetSecretVersionLocksConstants = {}));
2190
+ /** Constants for the `lockSecretVersion` operation. */
2191
+ var LockSecretVersionConstants;
2192
+ (function (LockSecretVersionConstants) {
2193
+ /** The secret type. */
2194
+ var SecretType;
2195
+ (function (SecretType) {
2196
+ SecretType["ARBITRARY"] = "arbitrary";
2197
+ SecretType["IAM_CREDENTIALS"] = "iam_credentials";
2198
+ SecretType["IMPORTED_CERT"] = "imported_cert";
2199
+ SecretType["PUBLIC_CERT"] = "public_cert";
2200
+ SecretType["PRIVATE_CERT"] = "private_cert";
2201
+ SecretType["USERNAME_PASSWORD"] = "username_password";
2202
+ SecretType["KV"] = "kv";
2203
+ })(SecretType = LockSecretVersionConstants.SecretType || (LockSecretVersionConstants.SecretType = {}));
2204
+ /** An optional lock mode. At lock creation, you can set one of the following modes to clear any matching locks on a secret version. - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret. - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if it doesn't have any locks. */
2205
+ var Mode;
2206
+ (function (Mode) {
2207
+ Mode["EXCLUSIVE"] = "exclusive";
2208
+ Mode["EXCLUSIVE_DELETE"] = "exclusive_delete";
2209
+ })(Mode = LockSecretVersionConstants.Mode || (LockSecretVersionConstants.Mode = {}));
2210
+ })(LockSecretVersionConstants = SecretsManagerV1.LockSecretVersionConstants || (SecretsManagerV1.LockSecretVersionConstants = {}));
2211
+ /** Constants for the `unlockSecretVersion` operation. */
2212
+ var UnlockSecretVersionConstants;
2213
+ (function (UnlockSecretVersionConstants) {
2214
+ /** The secret type. */
2215
+ var SecretType;
2216
+ (function (SecretType) {
2217
+ SecretType["ARBITRARY"] = "arbitrary";
2218
+ SecretType["IAM_CREDENTIALS"] = "iam_credentials";
2219
+ SecretType["IMPORTED_CERT"] = "imported_cert";
2220
+ SecretType["PUBLIC_CERT"] = "public_cert";
2221
+ SecretType["PRIVATE_CERT"] = "private_cert";
2222
+ SecretType["USERNAME_PASSWORD"] = "username_password";
2223
+ SecretType["KV"] = "kv";
2224
+ })(SecretType = UnlockSecretVersionConstants.SecretType || (UnlockSecretVersionConstants.SecretType = {}));
2225
+ })(UnlockSecretVersionConstants = SecretsManagerV1.UnlockSecretVersionConstants || (SecretsManagerV1.UnlockSecretVersionConstants = {}));
1689
2226
  /** Constants for the `putPolicy` operation. */
1690
2227
  var PutPolicyConstants;
1691
2228
  (function (PutPolicyConstants) {