use of com.auth0.net.VoidRequest in project auth0-java by auth0.
the class OrganizationsEntity method deleteInvitation.
/**
* Delete an invitation. A token with {@code delete:organization_invitations`} scope is required.
*
* @param orgId the ID of the organization
* @param invitationId the ID of the invitation to delete
* @return a Request to execute
*
* @see <a href="https://auth0.com/docs/api/management/v2#!/Organizations/delete_invitations_by_invitation_id">https://auth0.com/docs/api/management/v2#!/Organizations/delete_invitations_by_invitation_id</a>
*/
public Request<Void> deleteInvitation(String orgId, String invitationId) {
Asserts.assertNotNull(orgId, "organization ID");
Asserts.assertNotNull(invitationId, "invitation ID");
String url = baseUrl.newBuilder().addPathSegments(ORGS_PATH).addPathSegment(orgId).addPathSegment("invitations").addPathSegment(invitationId).build().toString();
VoidRequest request = new VoidRequest(client, url, "DELETE");
request.addHeader(AUTHORIZATION_HEADER, "Bearer " + apiToken);
return request;
}
use of com.auth0.net.VoidRequest in project auth0-java by auth0.
the class OrganizationsEntity method addMembers.
/**
* Add members to an organization. A token with {@code create:organization_members} scope is required.
*
* @param orgId the ID of the organization
* @param members The members to add
* @return a Request to execute
*
* @see <a href="https://auth0.com/docs/api/management/v2#!/Organizations/post_members">https://auth0.com/docs/api/management/v2#!/Organizations/post_members</a>
*/
public Request<Void> addMembers(String orgId, Members members) {
Asserts.assertNotNull(orgId, "organization ID");
Asserts.assertNotNull(members, "members");
String url = baseUrl.newBuilder().addPathSegments(ORGS_PATH).addPathSegment(orgId).addPathSegment("members").build().toString();
VoidRequest request = new VoidRequest(client, url, "POST");
request.addHeader(AUTHORIZATION_HEADER, "Bearer " + apiToken);
request.setBody(members);
return request;
}
use of com.auth0.net.VoidRequest in project auth0-java by auth0.
the class OrganizationsEntity method deleteConnection.
/**
* Delete a connection from an organization. A token with {@code delete:organization_connections} scope is required.
*
* @param orgId the ID of the organization
* @param connectionId the ID of the connection to delete
* @return a Request to execute
*
* @see <a href="https://auth0.com/docs/api/management/v2#!/Organizations/delete_enabled_connections_by_connectionId">https://auth0.com/docs/api/management/v2#!/Organizations/delete_enabled_connections_by_connectionId</a>
*/
public Request<Void> deleteConnection(String orgId, String connectionId) {
Asserts.assertNotNull(orgId, "organization ID");
Asserts.assertNotNull(connectionId, "connection ID");
String url = baseUrl.newBuilder().addPathSegments(ORGS_PATH).addPathSegment(orgId).addPathSegment("enabled_connections").addPathSegment(connectionId).build().toString();
VoidRequest voidRequest = new VoidRequest(client, url, "DELETE");
voidRequest.addHeader(AUTHORIZATION_HEADER, "Bearer " + apiToken);
return voidRequest;
}
use of com.auth0.net.VoidRequest in project auth0-java by auth0.
the class OrganizationsEntity method deleteMembers.
/**
* Delete members from an organization. A token with {@code delete:organization_members} scope is required.
*
* @param orgId the ID of the organization
* @param members The members to remove
* @return a Request to execute
*
* @see <a href="https://auth0.com/docs/api/management/v2#!/Organizations/delete_members">https://auth0.com/docs/api/management/v2#!/Organizations/delete_members</a>
*/
public Request<Void> deleteMembers(String orgId, Members members) {
Asserts.assertNotNull(orgId, "organization ID");
Asserts.assertNotNull(members, "members");
String url = baseUrl.newBuilder().addPathSegments(ORGS_PATH).addPathSegment(orgId).addPathSegment("members").build().toString();
VoidRequest request = new VoidRequest(client, url, "DELETE");
request.addHeader(AUTHORIZATION_HEADER, "Bearer " + apiToken);
request.setBody(members);
return request;
}
use of com.auth0.net.VoidRequest in project auth0-java by auth0.
the class ResourceServerEntity method delete.
/**
* Creates request for delete resource server by it's ID
* See <a href=https://auth0.com/docs/api/management/v2#!/Resource_Servers/delete_resource_servers_by_id>API documentation</a>
*
* @param resourceServerId {@link ResourceServer#id} field
* @return request to execute
*/
public Request<Void> delete(String resourceServerId) {
Asserts.assertNotNull(resourceServerId, "Resource server ID");
HttpUrl.Builder builder = baseUrl.newBuilder().addPathSegments("api/v2/resource-servers").addPathSegment(resourceServerId);
String url = builder.build().toString();
VoidRequest request = new VoidRequest(client, url, "DELETE");
request.addHeader("Authorization", "Bearer " + apiToken);
return request;
}
Aggregations