rotateMachineSecretKeyWithHttpInfo method

Future<Response> rotateMachineSecretKeyWithHttpInfo(
  1. String machineId,
  2. RotateMachineSecretKeyRequest rotateMachineSecretKeyRequest
)

Rotate a machine's secret key

Rotates the machine's secret key. When the secret key is rotated, make sure to update it in your machine/application. The previous secret key will remain valid for the duration specified by the previous_token_ttl parameter.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<http.Response> rotateMachineSecretKeyWithHttpInfo(
  String machineId,
  RotateMachineSecretKeyRequest rotateMachineSecretKeyRequest,
) async {
  // ignore: prefer_const_declarations
  final path = r'/machines/{machine_id}/secret_key/rotate'
      .replaceAll('{machine_id}', machineId);

  // ignore: prefer_final_locals
  Object? postBody = rotateMachineSecretKeyRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}