updateSecondFactorWithHttpInfo method

Future<Response> updateSecondFactorWithHttpInfo(
  1. String account,
  2. String user,
  3. String secondFactor,
  4. UpdateSecondFactorRequest updateSecondFactorRequest,
)

Update a second factor

Update an existing second factor for the user. This can be used to enable and disable a second factor as-needed.

Note: This method returns the HTTP Response.

Parameters:

  • String account (required): The identifier (UUID) or slug of your Keygen account.

  • String user (required): The identifier (UUID) or email of a user the second factor belongs to.

  • String secondFactor (required): The identifier (UUID) of the second factor to be updated.

  • UpdateSecondFactorRequest updateSecondFactorRequest (required):

Implementation

Future<Response> updateSecondFactorWithHttpInfo(String account, String user, String secondFactor, UpdateSecondFactorRequest updateSecondFactorRequest,) async {
  // ignore: prefer_const_declarations
  final path = r'/accounts/{account}/users/{user}/second-factors/{second-factor}'
    .replaceAll('{account}', account)
    .replaceAll('{user}', user)
    .replaceAll('{second-factor}', secondFactor);

  // ignore: prefer_final_locals
  Object? postBody = updateSecondFactorRequest;

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

  const contentTypes = <String>['application/vnd.api+json'];


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