|
| 1 | +/* eslint-disable */ |
| 2 | +/* tslint:disable */ |
| 3 | +// @ts-nocheck |
| 4 | +/* |
| 5 | + * --------------------------------------------------------------- |
| 6 | + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## |
| 7 | + * ## ## |
| 8 | + * ## AUTHOR: acacode ## |
| 9 | + * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## |
| 10 | + * --------------------------------------------------------------- |
| 11 | + */ |
| 12 | + |
| 13 | +import { |
| 14 | + ApiErrorEnvelope, |
| 15 | + ApiSecretCreateEnvelope, |
| 16 | + ApiSecretEnvelope, |
| 17 | + ApiSecretListEnvelope, |
| 18 | + SecretsSecretUpdate, |
| 19 | +} from './data-contracts'; |
| 20 | +import { ContentType, HttpClient, RequestParams } from './http-client'; |
| 21 | + |
| 22 | +export class Secrets<SecurityDataType = unknown> extends HttpClient<SecurityDataType> { |
| 23 | + /** |
| 24 | + * @description Provides a list of all secrets that the user has access to in the specified namespace |
| 25 | + * |
| 26 | + * @tags secrets |
| 27 | + * @name ListSecrets |
| 28 | + * @summary Returns a list of all secrets in a namespace |
| 29 | + * @request GET:/secrets/{namespace} |
| 30 | + * @response `200` `ApiSecretListEnvelope` Successful secrets response |
| 31 | + * @response `401` `ApiErrorEnvelope` Unauthorized |
| 32 | + * @response `403` `ApiErrorEnvelope` Forbidden |
| 33 | + * @response `422` `ApiErrorEnvelope` Unprocessable Entity. Validation error. |
| 34 | + * @response `500` `ApiErrorEnvelope` Internal server error |
| 35 | + */ |
| 36 | + listSecrets = (namespace: string, params: RequestParams = {}) => |
| 37 | + this.request<ApiSecretListEnvelope, ApiErrorEnvelope>({ |
| 38 | + path: `/secrets/${namespace}`, |
| 39 | + method: 'GET', |
| 40 | + format: 'json', |
| 41 | + ...params, |
| 42 | + }); |
| 43 | + /** |
| 44 | + * @description Creates a new secret in the specified namespace |
| 45 | + * |
| 46 | + * @tags secrets |
| 47 | + * @name CreateSecret |
| 48 | + * @summary Creates a new secret |
| 49 | + * @request POST:/secrets/{namespace} |
| 50 | + * @response `201` `ApiSecretCreateEnvelope` Secret created successfully |
| 51 | + * @response `400` `ApiErrorEnvelope` Bad request |
| 52 | + * @response `401` `ApiErrorEnvelope` Unauthorized |
| 53 | + * @response `403` `ApiErrorEnvelope` Forbidden |
| 54 | + * @response `409` `ApiErrorEnvelope` Secret already exists |
| 55 | + * @response `413` `ApiErrorEnvelope` Request Entity Too Large. The request body is too large. |
| 56 | + * @response `415` `ApiErrorEnvelope` Unsupported Media Type. Content-Type header is not correct. |
| 57 | + * @response `422` `ApiErrorEnvelope` Unprocessable Entity. Validation error. |
| 58 | + * @response `500` `ApiErrorEnvelope` Internal server error |
| 59 | + */ |
| 60 | + createSecret = (namespace: string, secret: ApiSecretCreateEnvelope, params: RequestParams = {}) => |
| 61 | + this.request<ApiSecretCreateEnvelope, ApiErrorEnvelope>({ |
| 62 | + path: `/secrets/${namespace}`, |
| 63 | + method: 'POST', |
| 64 | + body: secret, |
| 65 | + type: ContentType.Json, |
| 66 | + format: 'json', |
| 67 | + ...params, |
| 68 | + }); |
| 69 | + /** |
| 70 | + * @description Provides details of a specific secret by name and namespace |
| 71 | + * |
| 72 | + * @tags secrets |
| 73 | + * @name GetSecret |
| 74 | + * @summary Returns a specific secret |
| 75 | + * @request GET:/secrets/{namespace}/{name} |
| 76 | + * @response `200` `ApiSecretEnvelope` Successful secret response |
| 77 | + * @response `401` `ApiErrorEnvelope` Unauthorized |
| 78 | + * @response `403` `ApiErrorEnvelope` Forbidden |
| 79 | + * @response `404` `ApiErrorEnvelope` Secret not found |
| 80 | + * @response `422` `ApiErrorEnvelope` Unprocessable Entity. Validation error. |
| 81 | + * @response `500` `ApiErrorEnvelope` Internal server error |
| 82 | + */ |
| 83 | + getSecret = (namespace: string, name: string, params: RequestParams = {}) => |
| 84 | + this.request<ApiSecretEnvelope, ApiErrorEnvelope>({ |
| 85 | + path: `/secrets/${namespace}/${name}`, |
| 86 | + method: 'GET', |
| 87 | + format: 'json', |
| 88 | + ...params, |
| 89 | + }); |
| 90 | + /** |
| 91 | + * @description Updates an existing secret in the specified namespace |
| 92 | + * |
| 93 | + * @tags secrets |
| 94 | + * @name UpdateSecret |
| 95 | + * @summary Updates an existing secret |
| 96 | + * @request PUT:/secrets/{namespace}/{name} |
| 97 | + * @response `200` `ApiSecretEnvelope` Secret updated successfully |
| 98 | + * @response `400` `ApiErrorEnvelope` Bad request |
| 99 | + * @response `401` `ApiErrorEnvelope` Unauthorized |
| 100 | + * @response `403` `ApiErrorEnvelope` Forbidden |
| 101 | + * @response `404` `ApiErrorEnvelope` Secret not found |
| 102 | + * @response `413` `ApiErrorEnvelope` Request Entity Too Large. The request body is too large. |
| 103 | + * @response `415` `ApiErrorEnvelope` Unsupported Media Type. Content-Type header is not correct. |
| 104 | + * @response `422` `ApiErrorEnvelope` Unprocessable Entity. Validation error. |
| 105 | + * @response `500` `ApiErrorEnvelope` Internal server error |
| 106 | + */ |
| 107 | + updateSecret = ( |
| 108 | + namespace: string, |
| 109 | + name: string, |
| 110 | + secret: SecretsSecretUpdate, |
| 111 | + params: RequestParams = {}, |
| 112 | + ) => |
| 113 | + this.request<ApiSecretEnvelope, ApiErrorEnvelope>({ |
| 114 | + path: `/secrets/${namespace}/${name}`, |
| 115 | + method: 'PUT', |
| 116 | + body: secret, |
| 117 | + type: ContentType.Json, |
| 118 | + format: 'json', |
| 119 | + ...params, |
| 120 | + }); |
| 121 | + /** |
| 122 | + * @description Deletes a secret from the specified namespace |
| 123 | + * |
| 124 | + * @tags secrets |
| 125 | + * @name DeleteSecret |
| 126 | + * @summary Deletes a secret |
| 127 | + * @request DELETE:/secrets/{namespace}/{name} |
| 128 | + * @response `204` `void` No Content |
| 129 | + * @response `401` `ApiErrorEnvelope` Unauthorized |
| 130 | + * @response `403` `ApiErrorEnvelope` Forbidden |
| 131 | + * @response `404` `ApiErrorEnvelope` Secret not found |
| 132 | + * @response `500` `ApiErrorEnvelope` Internal server error |
| 133 | + */ |
| 134 | + deleteSecret = (namespace: string, name: string, params: RequestParams = {}) => |
| 135 | + this.request<void, ApiErrorEnvelope>({ |
| 136 | + path: `/secrets/${namespace}/${name}`, |
| 137 | + method: 'DELETE', |
| 138 | + type: ContentType.Json, |
| 139 | + ...params, |
| 140 | + }); |
| 141 | +} |
0 commit comments