Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "205c0e9", "specHash": "5bf3652", "version": "0.1.0" }
{ "engineHash": "47ff60c", "specHash": "d068f97", "version": "0.1.0" }
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ the SDK are available by topic:
* [Downloads](downloads.md)
* [Emailaliases](emailaliases.md)
* [Events](events.md)
* [Externalusers](externalusers.md)
* [Fileclassifications](fileclassifications.md)
* [Filemetadata](filemetadata.md)
* [Filerequests](filerequests.md)
Expand Down
32 changes: 32 additions & 0 deletions docs/externalusers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ExternalUsersManager


- [Submit job to delete external users](#submit-job-to-delete-external-users)

## Submit job to delete external users

Delete external users from current user enterprise. This will remove each
external user from all invited collaborations within the current enterprise.

This operation is performed by calling function `createExternalUserSubmitDeleteJobV2025R0`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/post-external-users-submit-delete-job/).

*Currently we don't have an example for calling `createExternalUserSubmitDeleteJobV2025R0` in integration tests*

### Arguments

- requestBody `ExternalUsersSubmitDeleteJobRequestV2025R0`
- Request body of createExternalUserSubmitDeleteJobV2025R0 method
- headers `CreateExternalUserSubmitDeleteJobV2025R0Headers`
- Headers of createExternalUserSubmitDeleteJobV2025R0 method


### Returns

This function returns a value of type `ExternalUsersSubmitDeleteJobResponseV2025R0`.




17 changes: 17 additions & 0 deletions src/main/java/com/box/sdkgen/client/BoxClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.box.sdkgen.managers.downloads.DownloadsManager;
import com.box.sdkgen.managers.emailaliases.EmailAliasesManager;
import com.box.sdkgen.managers.events.EventsManager;
import com.box.sdkgen.managers.externalusers.ExternalUsersManager;
import com.box.sdkgen.managers.fileclassifications.FileClassificationsManager;
import com.box.sdkgen.managers.filemetadata.FileMetadataManager;
import com.box.sdkgen.managers.filerequests.FileRequestsManager;
Expand Down Expand Up @@ -256,6 +257,8 @@ public class BoxClient {

public final ArchivesManager archives;

public final ExternalUsersManager externalUsers;

public BoxClient(Authentication auth) {
this.auth = auth;
this.networkSession = new NetworkSession.Builder().baseUrls(new BaseUrls()).build();
Expand Down Expand Up @@ -584,6 +587,11 @@ public BoxClient(Authentication auth) {
.build();
this.archives =
new ArchivesManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.externalUsers =
new ExternalUsersManager.Builder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
}

protected BoxClient(Builder builder) {
Expand Down Expand Up @@ -914,6 +922,11 @@ protected BoxClient(Builder builder) {
.build();
this.archives =
new ArchivesManager.Builder().auth(this.auth).networkSession(this.networkSession).build();
this.externalUsers =
new ExternalUsersManager.Builder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
}

public FetchResponse makeRequest(FetchOptions fetchOptions) {
Expand Down Expand Up @@ -1299,6 +1312,10 @@ public ArchivesManager getArchives() {
return archives;
}

public ExternalUsersManager getExternalUsers() {
return externalUsers;
}

public static class Builder {

protected final Authentication auth;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.box.sdkgen.managers.externalusers;

import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;

import com.box.sdkgen.parameters.v2025r0.boxversionheaderv2025r0.BoxVersionHeaderV2025R0;
import com.box.sdkgen.serialization.json.EnumWrapper;
import java.util.Map;

public class CreateExternalUserSubmitDeleteJobV2025R0Headers {

public EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;

public Map<String, String> extraHeaders;

public CreateExternalUserSubmitDeleteJobV2025R0Headers() {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
this.extraHeaders = mapOf();
}

protected CreateExternalUserSubmitDeleteJobV2025R0Headers(Builder builder) {
this.boxVersion = builder.boxVersion;
this.extraHeaders = builder.extraHeaders;
}

public EnumWrapper<BoxVersionHeaderV2025R0> getBoxVersion() {
return boxVersion;
}

public Map<String, String> getExtraHeaders() {
return extraHeaders;
}

public static class Builder {

protected EnumWrapper<BoxVersionHeaderV2025R0> boxVersion;

protected Map<String, String> extraHeaders;

public Builder() {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(BoxVersionHeaderV2025R0._2025_0);
this.extraHeaders = mapOf();
}

public Builder boxVersion(BoxVersionHeaderV2025R0 boxVersion) {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2025R0>(boxVersion);
return this;
}

public Builder boxVersion(EnumWrapper<BoxVersionHeaderV2025R0> boxVersion) {
this.boxVersion = boxVersion;
return this;
}

public Builder extraHeaders(Map<String, String> extraHeaders) {
this.extraHeaders = extraHeaders;
return this;
}

public CreateExternalUserSubmitDeleteJobV2025R0Headers build() {
return new CreateExternalUserSubmitDeleteJobV2025R0Headers(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package com.box.sdkgen.managers.externalusers;

import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
import static com.box.sdkgen.internal.utils.UtilsManager.entryOf;
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;

import com.box.sdkgen.networking.auth.Authentication;
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
import com.box.sdkgen.networking.network.NetworkSession;
import com.box.sdkgen.schemas.v2025r0.externaluserssubmitdeletejobrequestv2025r0.ExternalUsersSubmitDeleteJobRequestV2025R0;
import com.box.sdkgen.schemas.v2025r0.externaluserssubmitdeletejobresponsev2025r0.ExternalUsersSubmitDeleteJobResponseV2025R0;
import com.box.sdkgen.serialization.json.JsonManager;
import java.util.Map;

public class ExternalUsersManager {

public Authentication auth;

public NetworkSession networkSession;

public ExternalUsersManager() {
this.networkSession = new NetworkSession();
}

protected ExternalUsersManager(Builder builder) {
this.auth = builder.auth;
this.networkSession = builder.networkSession;
}

public ExternalUsersSubmitDeleteJobResponseV2025R0 createExternalUserSubmitDeleteJobV2025R0(
ExternalUsersSubmitDeleteJobRequestV2025R0 requestBody) {
return createExternalUserSubmitDeleteJobV2025R0(
requestBody, new CreateExternalUserSubmitDeleteJobV2025R0Headers());
}

public ExternalUsersSubmitDeleteJobResponseV2025R0 createExternalUserSubmitDeleteJobV2025R0(
ExternalUsersSubmitDeleteJobRequestV2025R0 requestBody,
CreateExternalUserSubmitDeleteJobV2025R0Headers headers) {
Map<String, String> headersMap =
prepareParams(
mergeMaps(
mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
headers.getExtraHeaders()));
FetchResponse response =
this.networkSession
.getNetworkClient()
.fetch(
new FetchOptions.Builder(
String.join(
"",
this.networkSession.getBaseUrls().getBaseUrl(),
"/2.0/external_users/submit_delete_job"),
"POST")
.headers(headersMap)
.data(JsonManager.serialize(requestBody))
.contentType("application/json")
.responseFormat(ResponseFormat.JSON)
.auth(this.auth)
.networkSession(this.networkSession)
.build());
return JsonManager.deserialize(
response.getData(), ExternalUsersSubmitDeleteJobResponseV2025R0.class);
}

public Authentication getAuth() {
return auth;
}

public NetworkSession getNetworkSession() {
return networkSession;
}

public static class Builder {

protected Authentication auth;

protected NetworkSession networkSession;

public Builder() {
this.networkSession = new NetworkSession();
}

public Builder auth(Authentication auth) {
this.auth = auth;
return this;
}

public Builder networkSession(NetworkSession networkSession) {
this.networkSession = networkSession;
return this;
}

public ExternalUsersManager build() {
return new ExternalUsersManager(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package com.box.sdkgen.schemas.v2025r0.externaluserdeletionresultv2025r0;

import com.box.sdkgen.internal.NullableFieldTracker;
import com.box.sdkgen.internal.SerializableObject;
import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;

@JsonFilter("nullablePropertyFilter")
public class ExternalUserDeletionResultV2025R0 extends SerializableObject {

@JsonProperty("user_id")
protected final String userId;

protected final long status;

protected String detail;

public ExternalUserDeletionResultV2025R0(
@JsonProperty("user_id") String userId, @JsonProperty("status") long status) {
super();
this.userId = userId;
this.status = status;
}

protected ExternalUserDeletionResultV2025R0(Builder builder) {
super();
this.userId = builder.userId;
this.status = builder.status;
this.detail = builder.detail;
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
}

public String getUserId() {
return userId;
}

public long getStatus() {
return status;
}

public String getDetail() {
return detail;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExternalUserDeletionResultV2025R0 casted = (ExternalUserDeletionResultV2025R0) o;
return Objects.equals(userId, casted.userId)
&& Objects.equals(status, casted.status)
&& Objects.equals(detail, casted.detail);
}

@Override
public int hashCode() {
return Objects.hash(userId, status, detail);
}

@Override
public String toString() {
return "ExternalUserDeletionResultV2025R0{"
+ "userId='"
+ userId
+ '\''
+ ", "
+ "status='"
+ status
+ '\''
+ ", "
+ "detail='"
+ detail
+ '\''
+ "}";
}

public static class Builder extends NullableFieldTracker {

protected final String userId;

protected final long status;

protected String detail;

public Builder(String userId, long status) {
super();
this.userId = userId;
this.status = status;
}

public Builder detail(String detail) {
this.detail = detail;
return this;
}

public ExternalUserDeletionResultV2025R0 build() {
return new ExternalUserDeletionResultV2025R0(this);
}
}
}
Loading
Loading