createSecret method

Future<SecretCreateResult> createSecret(
  1. SecretCreateOptions options, {
  2. Duration? timeout,
})

Creates a secret.

Implementation

Future<SecretCreateResult> createSecret(
  SecretCreateOptions options, {
  Duration? timeout,
}) async {
  final response = await _send(
    method: HttpMethod.post,
    path: '/secrets/create',
    queryParameters: options.toQueryParameters(),
    body: options.data,
    expectedStatusCodes: const <int>{200, 201},
    timeout: timeout,
  );

  return SecretCreateResult.fromJson(
    _decodeObject(response.bodyText, '/secrets/create'),
  );
}