use of com.auth0.json.mgmt.Scope in project auth0-java by auth0.
the class RulesConfigsEntity method delete.
/**
* Delete an existing Rules Config. A token with scope delete:rules_configs is needed.
* See https://auth0.com/docs/api/management/v2#!/Rules_Configs/delete_rules_configs_by_key
*
* @param rulesConfigKey the rules config key
* @return a Request to execute.
*/
public Request<Void> delete(String rulesConfigKey) {
Asserts.assertNotNull(rulesConfigKey, "rules config key");
String url = baseUrl.newBuilder().addPathSegments("api/v2/rules-configs").addPathSegment(rulesConfigKey).build().toString();
VoidRequest request = new VoidRequest(client, url, "DELETE");
request.addHeader("Authorization", "Bearer " + apiToken);
return request;
}
use of com.auth0.json.mgmt.Scope in project auth0-java by auth0.
the class RulesEntity method delete.
/**
* Delete an existing Rule. A token with scope delete:rules is needed.
* See https://auth0.com/docs/api/management/v2#!/Rules/delete_rules_by_id
*
* @param ruleId the rule id
* @return a Request to execute.
*/
public Request<Void> delete(String ruleId) {
Asserts.assertNotNull(ruleId, "rule id");
String url = baseUrl.newBuilder().addPathSegments("api/v2/rules").addPathSegment(ruleId).build().toString();
VoidRequest request = new VoidRequest(client, url, "DELETE");
request.addHeader("Authorization", "Bearer " + apiToken);
return request;
}
use of com.auth0.json.mgmt.Scope in project auth0-java by auth0.
the class ActionsEntity method delete.
/**
* Delete an action and all of its associated versions. A token with {@code delete:action} scope is required.
*
* @param actionId the ID of the action to delete.
* @param force whether to force the action deletion even if it is bound to triggers.
* @return a request to execute.
*
* <a href="https://auth0.com/docs/api/management/v2#!/Actions/get_triggers">https://auth0.com/docs/api/management/v2#!/Actions/get_triggers</a>
*/
public Request<Void> delete(String actionId, boolean force) {
Asserts.assertNotNull(actionId, "action ID");
String url = baseUrl.newBuilder().addPathSegments(ACTIONS_BASE_PATH).addPathSegment(ACTIONS_PATH).addPathSegment(actionId).addQueryParameter("force", String.valueOf(force)).build().toString();
VoidRequest voidRequest = new VoidRequest(client, url, "DELETE");
voidRequest.addHeader(AUTHORIZATION_HEADER, "Bearer " + apiToken);
return voidRequest;
}
use of com.auth0.json.mgmt.Scope in project auth0-java by auth0.
the class UserBlocksEntity method delete.
/**
* Delete any existing User Blocks. A token with scope update:users is needed.
* See https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks_by_id
*
* @param userId the user id.
* @return a Request to execute.
*/
public Request<Void> delete(String userId) {
Asserts.assertNotNull(userId, "user id");
String url = baseUrl.newBuilder().addPathSegments("api/v2/user-blocks").addPathSegment(userId).build().toString();
VoidRequest request = new VoidRequest(client, url, "DELETE");
request.addHeader("Authorization", "Bearer " + apiToken);
return request;
}
use of com.auth0.json.mgmt.Scope in project auth0-java by auth0.
the class UserBlocksEntity method deleteByIdentifier.
/**
* Delete any existing User Blocks for a given identifier. A token with scope update:users is needed.
* See https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks
*
* @param identifier the identifier. Either a username, phone_number, or email.
* @return a Request to execute.
*/
public Request<Void> deleteByIdentifier(String identifier) {
Asserts.assertNotNull(identifier, "identifier");
String url = baseUrl.newBuilder().addPathSegments("api/v2/user-blocks").addQueryParameter("identifier", identifier).build().toString();
VoidRequest request = new VoidRequest(client, url, "DELETE");
request.addHeader("Authorization", "Bearer " + apiToken);
return request;
}
Aggregations