replaceRoleInRoleSetWithHttpInfo method

Future<Response> replaceRoleInRoleSetWithHttpInfo(
  1. String roleSetKeyOrId,
  2. ReplaceRoleInRoleSetRequest replaceRoleInRoleSetRequest
)

Replace a role in a role set

Replaces a role in a role set with another role. This atomically removes the source role and reassigns any members to the destination role.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<http.Response> replaceRoleInRoleSetWithHttpInfo(
  String roleSetKeyOrId,
  ReplaceRoleInRoleSetRequest replaceRoleInRoleSetRequest,
) async {
  // ignore: prefer_const_declarations
  final path = r'/role_sets/{role_set_key_or_id}/roles/replace'
      .replaceAll('{role_set_key_or_id}', roleSetKeyOrId);

  // ignore: prefer_final_locals
  Object? postBody = replaceRoleInRoleSetRequest;

  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,
  );
}