it = this.linkedHashSet.iterator();
21 | it.next();
22 | it.remove();
23 | }
24 |
25 | return newItem;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/MetadataFieldFilter.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import com.eclipsesource.json.Json;
4 | import com.eclipsesource.json.JsonObject;
5 | import com.eclipsesource.json.JsonValue;
6 |
7 | /**
8 | * Filter for matching against a metadata field.
9 | */
10 | public class MetadataFieldFilter {
11 |
12 | private final String field;
13 | private final JsonValue value;
14 |
15 | /**
16 | * Create a filter for matching against a string metadata field.
17 | *
18 | * @param field the field to match against.
19 | * @param value the value to match against.
20 | */
21 | public MetadataFieldFilter(String field, String value) {
22 |
23 | this.field = field;
24 | this.value = Json.value(value);
25 | }
26 |
27 | /**
28 | * Create a filter for matching against a metadata field defined in JSON.
29 | *
30 | * @param jsonObj the JSON object to construct the filter from.
31 | */
32 | public MetadataFieldFilter(JsonObject jsonObj) {
33 | this.field = jsonObj.get("field").asString();
34 | this.value = jsonObj.get("value");
35 | }
36 |
37 | /**
38 | * Get the JSON representation of the metadata field filter.
39 | *
40 | * @return the JSON object representing the filter.
41 | */
42 | public JsonObject getJsonObject() {
43 |
44 | JsonObject obj = new JsonObject();
45 | obj.add("field", this.field);
46 |
47 | obj.add("value", this.value);
48 |
49 | return obj;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/ProgressListener.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | /**
4 | * The listener interface for monitoring the progress of a long-running API call.
5 | */
6 | public interface ProgressListener {
7 |
8 | /**
9 | * Invoked when the progress of the API call changes.
10 | * In case of file uploads which are coming from a dynamic stream the file size cannot be determined and
11 | * total bytes will be reported as -1.
12 | *
13 | * @param numBytes the number of bytes completed.
14 | * @param totalBytes the total number of bytes.
15 | */
16 | void onProgressChanged(long numBytes, long totalBytes);
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/RequestBodyFromCallback.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import java.io.IOException;
4 | import okhttp3.MediaType;
5 | import okhttp3.RequestBody;
6 | import okio.BufferedSink;
7 |
8 | /**
9 | *
10 | */
11 | final class RequestBodyFromCallback extends RequestBody {
12 |
13 | private final UploadFileCallback callback;
14 | private final MediaType mediaType;
15 |
16 | RequestBodyFromCallback(UploadFileCallback callback, MediaType mediaType) {
17 | this.callback = callback;
18 | this.mediaType = mediaType;
19 | }
20 |
21 | @Override
22 | public MediaType contentType() {
23 | return mediaType;
24 | }
25 |
26 | @Override
27 | public void writeTo(BufferedSink bufferedSink) throws IOException {
28 | callback.writeToStream(bufferedSink.outputStream());
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/RequestInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | /**
4 | * The interface for intercepting requests to the Box API.
5 | *
6 | * An interceptor may handle a request in any way it sees fit. It may update a request before it's sent, or it may
7 | * choose to return a custom response. If an interceptor returns a null response, then the request will continue to be
8 | * sent to the API along with any changes that the interceptor may have made to it.
9 | *
10 | * public BoxAPIResponse onRequest(BoxAPIRequest request) {
11 | * request.addHeader("My-Header", "My-Value");
12 | *
13 | * // Returning null means the request will be sent along with our new header.
14 | * return null;
15 | * }
16 | *
17 | * However, if a response is returned, then the request won't be sent and the interceptor's response will take the
18 | * place of the normal response.
19 | *
20 | * public BoxAPIResponse onRequest(BoxAPIRequest request) {
21 | * // Returning our own response means the request won't be sent at all.
22 | * return new BoxAPIResponse();
23 | * }
24 | *
25 | * A RequestInterceptor can be very useful for testing purposes. Requests to the Box API can be intercepted and fake
26 | * responses can be returned, allowing you to effectively test your code without needing to actually communicate with
27 | * the Box API.
28 | */
29 | public interface RequestInterceptor {
30 | /**
31 | * Invoked when a request is about to be sent to the API.
32 | *
33 | * @param request the request that is about to be sent.
34 | * @return an optional response to the request. If the response is null, then the request will continue to
35 | * be sent to the Box API.
36 | */
37 | BoxAPIResponse onRequest(BoxAPIRequest request);
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/StandardCharsets.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import java.nio.charset.Charset;
4 |
5 | /**
6 | * Constant definitions for the standard Charsets.
7 | *
8 | * NB: Replace with java.nio.charset.StandardCharsets when we drop 1.6 support.
9 | */
10 | public final class StandardCharsets {
11 |
12 | /**
13 | * Eight-bit UCS Transformation Format.
14 | */
15 | public static final Charset UTF_8 = Charset.forName("UTF-8");
16 |
17 | private StandardCharsets() {
18 | throw new UnsupportedOperationException();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/Time.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | class Time {
4 | private static final ThreadLocal THREAD_LOCAL_INSTANCE = new ThreadLocal() {
5 | @Override
6 | protected Time initialValue() {
7 | return new Time();
8 | }
9 | };
10 |
11 | static Time getInstance() {
12 | return THREAD_LOCAL_INSTANCE.get();
13 | }
14 |
15 | void waitDuration(int milliseconds) throws InterruptedException {
16 | Thread.sleep(milliseconds);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/UploadFileCallback.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import java.io.IOException;
4 | import java.io.OutputStream;
5 |
6 | /**
7 | * The callback which allows file content to be written on output stream.
8 | */
9 | public interface UploadFileCallback {
10 |
11 | /**
12 | * Called when file upload api is called and requests to write content to output stream.
13 | *
14 | * @param outputStream Output stream to write file content to be uploaded.
15 | * @throws IOException Exception while writing to output stream.
16 | */
17 | void writeToStream(OutputStream outputStream) throws IOException;
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/http/ContentType.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk.http;
2 |
3 | /**
4 | * HTTP Content-Type constants.
5 | */
6 | public final class ContentType {
7 |
8 | /**
9 | * It is used when the HTTP request content type is application/json.
10 | */
11 | public static final String APPLICATION_JSON = "application/json";
12 |
13 | /**
14 | * It is used when the HTTP request content type is application/octet-stream.
15 | */
16 | public static final String APPLICATION_OCTET_STREAM = "application/octet-stream";
17 |
18 | /**
19 | * It is used when the HTTP request content type is application/x-www-form-urlencoded.
20 | */
21 | public static final String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded";
22 |
23 | /**
24 | * It is used when the HTTP request content type is application/json-patch+json.
25 | */
26 | public static final String APPLICATION_JSON_PATCH = "application/json-patch+json";
27 |
28 | //Prevents instantiation
29 | private ContentType() {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/http/HttpHeaders.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk.http;
2 |
3 | /**
4 | * HTTP header Key constants.
5 | */
6 | public final class HttpHeaders {
7 |
8 | /**
9 | * HTTP header key Content-Length.
10 | */
11 | public static final String CONTENT_LENGTH = "Content-Length";
12 |
13 | /**
14 | * HTTP header key X-Original-Content-Length.
15 | */
16 | public static final String X_ORIGINAL_CONTENT_LENGTH = "X-Original-Content-Length";
17 |
18 | /**
19 | * HTTP header key Content-Type.
20 | */
21 | public static final String CONTENT_TYPE = "Content-Type";
22 |
23 | /**
24 | * HTTP header key Content-Range.
25 | */
26 | public static final String CONTENT_RANGE = "Content-Range";
27 |
28 | /**
29 | * HTTP header key DIgest.
30 | */
31 | public static final String DIGEST = "Digest";
32 |
33 | /**
34 | * HTTP header key If-Match.
35 | */
36 | public static final String IF_MATCH = "If-Match";
37 |
38 | /**
39 | * HTTP header key If-None-Match.
40 | */
41 | public static final String IF_NONE_MATCH = "If-None-Match";
42 |
43 | /**
44 | * HTTP header key X-Box-Part-Id.
45 | */
46 | public static final String X_BOX_PART_ID = "X-Box-Part-Id";
47 |
48 | /**
49 | * HTTP header key Authorization.
50 | */
51 | public static final String AUTHORIZATION = "Authorization";
52 |
53 | //Prevents instantiation
54 | private HttpHeaders() {
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/http/HttpMethod.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk.http;
2 |
3 | /**
4 | * HTTP method constants.
5 | */
6 | public enum HttpMethod {
7 | /**
8 | * HTTP GET method.
9 | */
10 | GET,
11 |
12 | /**
13 | * HTTP HEAD method.
14 | */
15 | HEAD,
16 |
17 | /**
18 | * HTTP POST method.
19 | */
20 | POST,
21 |
22 | /**
23 | * HTTP PUT method.
24 | */
25 | PUT,
26 |
27 | /**
28 | * HTTP PATCH method.
29 | */
30 | PATCH,
31 |
32 | /**
33 | * HTTP DELETE method.
34 | */
35 | DELETE,
36 |
37 | /**
38 | * HTTP OPTIONS method.
39 | */
40 | OPTIONS,
41 |
42 | /**
43 | * HTTP TRACE method.
44 | */
45 | TRACE;
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Not a part of Public API - the backward-compatibility is not maintained.
3 | * Whole 'internal' package is not a part of the public API and package (and all sub-packages and their classes) are
4 | * determined only for SDK implementation.
5 | */
6 | package com.box.sdk.internal;
7 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides classes and methods for interacting with the Box API.
3 | */
4 | package com.box.sdk;
5 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/sharedlink/BoxSharedLinkRequest.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk.sharedlink;
2 |
3 | import com.box.sdk.BoxSharedLink;
4 |
5 | /**
6 | * Represents request to create shared link with permissions.
7 | */
8 | public class BoxSharedLinkRequest extends AbstractSharedLinkRequest {
9 |
10 | /**
11 | * Sets the permissions associated with this shared link.
12 | *
13 | * @param canDownload whether the shared link can be downloaded.
14 | * @param canPreview whether the shared link can be previewed.
15 | * @param canEdit whether the file shared with the link can be edited.
16 | * @return this request.
17 | */
18 | public BoxSharedLinkRequest permissions(boolean canDownload, boolean canPreview, boolean canEdit) {
19 | BoxSharedLink.Permissions permissions = new BoxSharedLink.Permissions();
20 | permissions.setCanDownload(canDownload);
21 | permissions.setCanPreview(canPreview);
22 | permissions.setCanEdit(canEdit);
23 | getLink().setPermissions(permissions);
24 | return this;
25 | }
26 |
27 | /**
28 | * Sets the permissions associated with this shared link.
29 | *
30 | * @param canDownload whether the shared link can be downloaded.
31 | * @param canPreview whether the shared link can be previewed.
32 | * @return this request.
33 | */
34 | public BoxSharedLinkRequest permissions(boolean canDownload, boolean canPreview) {
35 | return this.permissions(canDownload, canPreview, false);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/box/sdk/sharedlink/BoxSharedLinkWithoutPermissionsRequest.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk.sharedlink;
2 |
3 | /**
4 | * Represents request to create shared link.
5 | */
6 | public class BoxSharedLinkWithoutPermissionsRequest
7 | extends AbstractSharedLinkRequest {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAI/ExtractMetadataFreeform200.json:
--------------------------------------------------------------------------------
1 | {
2 | "answer": "Public APIs are important because of key and important reasons.",
3 | "completion_reason": "done",
4 | "created_at": "2012-12-12T10:53:43.123-08:00"
5 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAI/ExtractMetadataStructured200.json:
--------------------------------------------------------------------------------
1 | {
2 | "answer": {
3 | "firstName": "John",
4 | "lastName": "Doe",
5 | "age": 25,
6 | "hobbies": [
7 | "reading",
8 | "travelling"
9 | ]
10 | },
11 | "completion_reason": "done",
12 | "created_at": "2012-12-12T10:53:43.123-08:00"
13 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAI/GetAIAgentDefaultConfigExtract200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "ai_agent_extract",
3 | "basic_text": {
4 | "llm_endpoint_params": {
5 | "type": "openai_params",
6 | "frequency_penalty": 1.5,
7 | "presence_penalty": 1.5,
8 | "stop": "<|im_end|>",
9 | "temperature": 0,
10 | "top_p": 1
11 | },
12 | "model": "azure__openai__gpt_3_5_turbo_16k",
13 | "num_tokens_for_completion": 8400,
14 | "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
15 | "system_message": "You are a helpful travel assistant specialized in budget travel"
16 | },
17 | "long_text": {
18 | "embeddings": {
19 | "model": "openai__text_embedding_ada_002",
20 | "strategy": {
21 | "id": "basic",
22 | "num_tokens_per_chunk": 64
23 | }
24 | },
25 | "llm_endpoint_params": {
26 | "type": "openai_params",
27 | "frequency_penalty": 1.5,
28 | "presence_penalty": 1.5,
29 | "stop": "<|im_end|>",
30 | "temperature": 0,
31 | "top_p": 1
32 | },
33 | "model": "azure__openai__gpt_3_5_turbo_16k",
34 | "num_tokens_for_completion": 8400,
35 | "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
36 | "system_message": "You are a helpful travel assistant specialized in budget travel"
37 | }
38 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAI/GetAIAgentDefaultConfigExtractStructured200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "ai_agent_extract_structured",
3 | "basic_text": {
4 | "llm_endpoint_params": {
5 | "type": "openai_params",
6 | "frequency_penalty": 1.5,
7 | "presence_penalty": 1.5,
8 | "stop": "<|im_end|>",
9 | "temperature": 0,
10 | "top_p": 1
11 | },
12 | "model": "azure__openai__gpt_3_5_turbo_16k",
13 | "num_tokens_for_completion": 8400,
14 | "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
15 | "system_message": "You are a helpful travel assistant specialized in budget travel"
16 | },
17 | "long_text": {
18 | "embeddings": {
19 | "model": "openai__text_embedding_ada_002",
20 | "strategy": {
21 | "id": "basic",
22 | "num_tokens_per_chunk": 64
23 | }
24 | },
25 | "llm_endpoint_params": {
26 | "type": "openai_params",
27 | "frequency_penalty": 1.5,
28 | "presence_penalty": 1.5,
29 | "stop": "<|im_end|>",
30 | "temperature": 0,
31 | "top_p": 1
32 | },
33 | "model": "azure__openai__gpt_3_5_turbo_16k",
34 | "num_tokens_for_completion": 8400,
35 | "prompt_template": "It is `{current_date}`, consider these travel options `{content}` and answer the `{user_question}`.",
36 | "system_message": "You are a helpful travel assistant specialized in budget travel"
37 | }
38 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAI/GetAIAgentDefaultConfigTextGen200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "ai_agent_text_gen",
3 | "basic_gen": {
4 | "content_template": "---{content}---",
5 | "embeddings": {
6 | "model": "openai__text_embedding_ada_002",
7 | "strategy": {
8 | "id": "basic",
9 | "num_tokens_per_chunk": 64
10 | }
11 | },
12 | "llm_endpoint_params": {
13 | "type": "openai_params",
14 | "frequency_penalty": 1.5,
15 | "presence_penalty": 1.5,
16 | "stop": "<|im_end|>",
17 | "temperature": 0,
18 | "top_p": 1
19 | },
20 | "model": "openai__gpt_3_5_turbo",
21 | "num_tokens_for_completion": 8400,
22 | "prompt_template": "It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. `{user_question}`",
23 | "system_message": "You are a helpful travel assistant specialized in budget travel"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAI/SendAIRequest200.json:
--------------------------------------------------------------------------------
1 | {
2 | "answer": "Public APIs are important because of key and important reasons.",
3 | "completion_reason": "done",
4 | "created_at": "2012-12-12T10:53:43.123-08:00"
5 | }
6 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAI/SendAITextGen200.json:
--------------------------------------------------------------------------------
1 | {
2 | "answer": "Public APIs are important because of key and important reasons.",
3 | "completion_reason": "done",
4 | "created_at": "2012-12-12T10:53:43.123-08:00"
5 | }
6 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAPIConnection/State.json:
--------------------------------------------------------------------------------
1 | {
2 | "accessToken": "iKqkOC4FWkd1kG1HV9P17s5N7mqJBC2N",
3 | "refreshToken": "QALVa7gLVz8bYf4B5wDYoXfhmR7746c4",
4 | "lastRefresh": 0,
5 | "expires": 0,
6 | "userAgent": "Box Java SDK v2.45.0 (Java 1.8.0_131)",
7 | "tokenURL": "https://api.box.com/oauth2/token",
8 | "baseURL": "https://api.box.com/2.0/",
9 | "baseUploadURL": "https://upload.box.com/api/2.0/",
10 | "autoRefresh": true,
11 | "maxRetryAttempts": 1
12 | }
13 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxAPIConnection/StateDeprecated.json:
--------------------------------------------------------------------------------
1 | {
2 | "accessToken": "iKqkOC4FWkd1kG1HV9P17s5N7mqJBC2N",
3 | "refreshToken": "QALVa7gLVz8bYf4B5wDYoXfhmR7746c4",
4 | "lastRefresh": 0,
5 | "expires": 0,
6 | "userAgent": "Box Java SDK v2.45.0 (Java 1.8.0_131)",
7 | "tokenURL": "https://api.box.com/oauth2/token",
8 | "baseURL": "https://api.box.com/2.0/",
9 | "baseUploadURL": "https://upload.box.com/api/2.0/",
10 | "autoRefresh": true,
11 | "maxRequestAttempts": 2
12 | }
13 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxBatch/BatchCreateMetadataRequest.json:
--------------------------------------------------------------------------------
1 | {
2 | "requests": [
3 | {
4 | "method": "POST",
5 | "relative_url": "/files/12345/metadata/global/properties",
6 | "headers": {
7 | "Content-Type": "application/json",
8 | "Accept-Encoding": "gzip",
9 | "Accept-Charset": "utf-8"
10 | }
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxBatch/BatchCreateMetadataResponse.json:
--------------------------------------------------------------------------------
1 | {
2 | "responses": [
3 | {
4 | "status": 201,
5 | "response": {
6 | "foo": "bar",
7 | "$type": "properties",
8 | "$parent": "file_12345",
9 | "$id": "c1234-bda4-421a-a420-2142167bb98",
10 | "$version": 0,
11 | "$typeVersion": 5,
12 | "$template": "properties",
13 | "$scope": "global",
14 | "$canEdit": true
15 | },
16 | "headers": {}
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaboration/CreateCollaboration201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration",
3 | "id": "12345",
4 | "created_by": {
5 | "type": "user",
6 | "id": "1111",
7 | "name": "Test User",
8 | "login": "test@user.com"
9 | },
10 | "created_at": "2018-04-18T15:05:29-07:00",
11 | "modified_at": "2018-04-18T15:05:29-07:00",
12 | "expires_at": "2020-04-07T12:51:30-07:00",
13 | "status": "accepted",
14 | "accessible_by": {
15 | "type": "user",
16 | "id": "2222",
17 | "name": "Example User",
18 | "login": "example@user.com"
19 | },
20 | "role": "editor",
21 | "acknowledged_at": "2018-04-18T15:05:28-07:00",
22 | "item": {
23 | "type": "folder",
24 | "id": "5678",
25 | "sequence_id": "2",
26 | "etag": "2",
27 | "name": "Ball Valve Diagram"
28 | },
29 | "is_access_only": false
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaboration/CreateFileCollaboration201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration",
3 | "id": "12345",
4 | "created_by": {
5 | "type": "user",
6 | "id": "1111",
7 | "name": "Test User",
8 | "login": "example@test.com"
9 | },
10 | "created_at": "2018-04-19T10:43:14-07:00",
11 | "modified_at": "2018-04-19T10:43:14-07:00",
12 | "expires_at": "2020-04-07T12:51:30-07:00",
13 | "status": "accepted",
14 | "accessible_by": {
15 | "type": "user",
16 | "id": "2222",
17 | "name": "SDK User",
18 | "login": "sdk@user.com"
19 | },
20 | "role": "editor",
21 | "acknowledged_at": "2018-04-19T10:43:14-07:00",
22 | "item": {
23 | "type": "file",
24 | "id": "3333",
25 | "file_version": {
26 | "type": "file_version",
27 | "id": "4444",
28 | "sha1": "aa810e72823f3c3dad2d1d4488966f6f1e0a8a9d"
29 | },
30 | "sequence_id": "5",
31 | "etag": "5",
32 | "sha1": "aa810e72823f3c3dad2d1d4488966f6f1e0a8a9d",
33 | "name": "1_1-4_bsp_ball_valve.pdf"
34 | },
35 | "is_access_only": true
36 | }
37 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaboration/GetCollaborationInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration",
3 | "id": "12345",
4 | "created_by": {
5 | "type": "user",
6 | "id": "5678",
7 | "name": "Carl Callahan",
8 | "login": "testuser@example.com"
9 | },
10 | "created_at": "2016-06-06T11:38:58-07:00",
11 | "modified_at": "2016-06-06T11:42:37-07:00",
12 | "expires_at": null,
13 | "status": "accepted",
14 | "accessible_by": {
15 | "type": "user",
16 | "id": "1111",
17 | "name": "Cary Cheng",
18 | "login": "example@test.com"
19 | },
20 | "role": "editor",
21 | "acknowledged_at": "2016-06-06T11:38:58-07:00",
22 | "item": {
23 | "type": "folder",
24 | "id": "2222",
25 | "sequence_id": "2",
26 | "etag": "2",
27 | "name": "Ball Valve Diagram"
28 | },
29 | "is_access_only": false
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaboration/GetInviteEmailAttributesOnCollaboration200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration",
3 | "id": "12345",
4 | "invite_email": "example@test.com"
5 | }
6 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaboration/GetPendingCollaborationInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "collaboration",
6 | "id": "12345",
7 | "created_by": {
8 | "type": "user",
9 | "id": "1111",
10 | "name": "Test User",
11 | "login": "test@user.com"
12 | },
13 | "created_at": "2018-04-18T16:57:50-07:00",
14 | "modified_at": "2018-04-18T17:22:53-07:00",
15 | "expires_at": null,
16 | "status": "pending",
17 | "accessible_by": {
18 | "type": "user",
19 | "id": "2222",
20 | "name": "Example User",
21 | "login": "example@user.com"
22 | },
23 | "role": "editor",
24 | "acknowledged_at": null,
25 | "item": null,
26 | "is_access_only": false
27 | }
28 | ],
29 | "limit": 100,
30 | "offset": 0
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaboration/UpdateCollaboration200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration",
3 | "id": "13261262875",
4 | "created_by": {
5 | "type": "user",
6 | "id": "235699372",
7 | "name": "Cary Cheng",
8 | "login": "ccheng+demo@box.com"
9 | },
10 | "created_at": "2018-04-18T15:05:29-07:00",
11 | "modified_at": "2018-04-18T15:37:40-07:00",
12 | "expires_at": "2020-04-07T12:51:30-07:00",
13 | "status": "accepted",
14 | "accessible_by": {
15 | "type": "user",
16 | "id": "244764141",
17 | "name": "Anthony Towns",
18 | "login": "towns@kroger.com"
19 | },
20 | "role": "viewer",
21 | "acknowledged_at": "2018-04-18T15:05:28-07:00",
22 | "item": {
23 | "type": "folder",
24 | "id": "8271532885",
25 | "sequence_id": "2",
26 | "etag": "2",
27 | "name": "Ball Valve Diagram"
28 | },
29 | "is_access_only": false
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaborationAllowlist/CreateAllowlistForAUser201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration_whitelist_exempt_target",
3 | "id": "12345",
4 | "user": {
5 | "type": "user",
6 | "id": "1111",
7 | "name": "Test User",
8 | "login": "test@user.com"
9 | },
10 | "enterprise": {
11 | "type": "enterprise",
12 | "id": "2222",
13 | "name": "Box"
14 | },
15 | "created_at": "2018-04-19T15:41:10-07:00",
16 | "modified_at": "2018-04-19T15:41:10-07:00"
17 | }
18 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaborationAllowlist/CreateAllowlistForDomain201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration_whitelist_entry",
3 | "id": "12345",
4 | "domain": "example.com",
5 | "direction": "both",
6 | "enterprise": {
7 | "type": "enterprise",
8 | "id": "1111",
9 | "name": "Example"
10 | },
11 | "created_at": "2018-04-19T14:41:24-07:00",
12 | "modified_at": "2018-04-19T14:41:24-07:00"
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaborationAllowlist/GetAllowlistInfoForADomain200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration_whitelist_entry",
3 | "id": "12345",
4 | "domain": "example.com",
5 | "direction": "both",
6 | "enterprise": {
7 | "type": "enterprise",
8 | "id": "1111",
9 | "name": "Example"
10 | },
11 | "created_at": "2018-04-19T14:41:24-07:00",
12 | "modified_at": "2018-04-19T14:41:24-07:00"
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaborationAllowlist/GetAllowlistInfoForAUser200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "collaboration_whitelist_exempt_target",
3 | "id": "12345",
4 | "user": {
5 | "type": "user",
6 | "id": "1111",
7 | "name": "Test User",
8 | "login": "test@user.com"
9 | },
10 | "enterprise": {
11 | "type": "enterprise",
12 | "id": "2222",
13 | "name": "Example"
14 | },
15 | "created_at": "2018-04-19T15:41:10-07:00",
16 | "modified_at": "2018-04-19T15:41:10-07:00"
17 | }
18 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaborationAllowlist/GetAllowlistInfoForAllDomains200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "collaboration_whitelist_entry",
5 | "id": "1111",
6 | "domain": "test.com",
7 | "direction": "both"
8 | },
9 | {
10 | "type": "collaboration_whitelist_entry",
11 | "id": "2222",
12 | "domain": "example.com",
13 | "direction": "both"
14 | },
15 | {
16 | "type": "collaboration_whitelist_entry",
17 | "id": "3333",
18 | "domain": "user.com",
19 | "direction": "both"
20 | }
21 | ],
22 | "limit": 100,
23 | "order": [
24 | {
25 | "by": "id",
26 | "direction": "ASC"
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollaborationAllowlist/GetAllowlistInfoForAllUsers200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "collaboration_whitelist_exempt_target",
5 | "id": "1234",
6 | "user": {
7 | "type": "user",
8 | "id": "1111",
9 | "name": "Test User",
10 | "login": "test@user.com"
11 | }
12 | },
13 | {
14 | "type": "collaboration_whitelist_exempt_target",
15 | "id": "5678",
16 | "user": {
17 | "type": "user",
18 | "id": "2222",
19 | "name": "Example User",
20 | "login": "example@user.com"
21 | }
22 | }
23 | ],
24 | "limit": 100,
25 | "order": [
26 | {
27 | "by": "id",
28 | "direction": "ASC"
29 | }
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollection/GetCollectionItems200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 4,
3 | "entries": [
4 | {
5 | "type": "file",
6 | "id": "12345",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "5678",
10 | "sha1": "9f425a006e19bb38566af5b2122abd2e0c5dd851"
11 | },
12 | "sequence_id": "1",
13 | "etag": "1",
14 | "sha1": "9f425a006e19bb38566af5b2122abd2e0c5dd851",
15 | "name": "Simple Contract Final.pdf"
16 | },
17 | {
18 | "type": "web_link",
19 | "id": "123456",
20 | "sequence_id": "0",
21 | "etag": "0",
22 | "name": "google.com",
23 | "url": ""
24 | }
25 | ],
26 | "limit": 100,
27 | "offset": 0
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxCollection/GetCollections200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 14,
3 | "entries": [
4 | {
5 | "id": "123456",
6 | "type": "collection",
7 | "name": "Favorites",
8 | "collection_type": "favorites"
9 | }
10 | ],
11 | "limit": 100,
12 | "offset": 0
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxComment/CreateComment201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "comment",
3 | "id": "12345",
4 | "is_reply_comment": false,
5 | "message": "This is a test message.",
6 | "created_by": {
7 | "type": "user",
8 | "id": "1111",
9 | "name": "Test User",
10 | "login": "test@user.com"
11 | },
12 | "created_at": "2018-04-19T14:00:43-07:00",
13 | "item": {
14 | "id": "2222",
15 | "type": "file"
16 | },
17 | "modified_at": "2018-04-19T14:00:43-07:00"
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxComment/GetCommentInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "comment",
3 | "id": "12345",
4 | "is_reply_comment": false,
5 | "message": "@Test User yes",
6 | "created_by": {
7 | "type": "user",
8 | "id": "1111",
9 | "name": "Example User",
10 | "login": "example@user.com"
11 | },
12 | "created_at": "2016-07-06T15:53:54-07:00",
13 | "item": {
14 | "id": "2222",
15 | "type": "file"
16 | },
17 | "modified_at": "2016-07-06T15:53:54-07:00"
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxComment/GetCommentsOnFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 3,
3 | "offset": 0,
4 | "limit": 100,
5 | "entries": [
6 | {
7 | "type": "comment",
8 | "id": "1111",
9 | "is_reply_comment": false,
10 | "message": "@Test User default comment.",
11 | "created_by": {
12 | "type": "user",
13 | "id": "12345",
14 | "name": "Example User",
15 | "login": "example@user.com"
16 | },
17 | "created_at": "2016-07-06T14:48:18-07:00"
18 | },
19 | {
20 | "type": "comment",
21 | "id": "2222",
22 | "is_reply_comment": false,
23 | "message": "@Example User This works.",
24 | "created_by": {
25 | "type": "user",
26 | "id": "32422",
27 | "name": "Test User",
28 | "login": "test@user.com"
29 | },
30 | "created_at": "2016-07-06T15:25:00-07:00"
31 | },
32 | {
33 | "type": "comment",
34 | "id": "3333",
35 | "is_reply_comment": false,
36 | "message": "@Test User yes\n\n",
37 | "created_by": {
38 | "type": "user",
39 | "id": "12345",
40 | "name": "Example User",
41 | "login": "example@user.com"
42 | },
43 | "created_at": "2016-07-06T15:53:54-07:00"
44 | }
45 | ]
46 | }
47 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxComment/UpdateCommentsMessage200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "comment",
3 | "id": "12345",
4 | "is_reply_comment": false,
5 | "message": "This is an updated message.",
6 | "created_by": {
7 | "type": "user",
8 | "id": "1111",
9 | "name": "Test User",
10 | "login": "test@user.com"
11 | },
12 | "created_at": "2018-04-19T14:00:43-07:00",
13 | "item": {
14 | "id": "2222",
15 | "type": "file"
16 | },
17 | "modified_at": "2018-04-19T14:26:25-07:00"
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxDevicePin/GetAllEnterpriseDevicePins200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "device_pinner",
5 | "id": "12345",
6 | "owned_by": {
7 | "type": "user",
8 | "id": "1111",
9 | "name": "Test User",
10 | "login": "test@user.com"
11 | },
12 | "product_name": "iPad"
13 | },
14 | {
15 | "type": "device_pinner",
16 | "id": "23523",
17 | "owned_by": {
18 | "type": "user",
19 | "id": "2222",
20 | "name": "Example User",
21 | "login": "example@user.com"
22 | },
23 | "product_name": "iPad"
24 | }
25 | ],
26 | "limit": 100,
27 | "order": [
28 | {
29 | "by": "id",
30 | "direction": "ASC"
31 | }
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxDevicePin/GetDevicePinInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "device_pinner",
3 | "id": "12345",
4 | "owned_by": {
5 | "type": "user",
6 | "id": "1111",
7 | "name": "Test User",
8 | "login": "test@user.com"
9 | },
10 | "product_name": "iPhone",
11 | "created_at": "2016-04-23T11:03:16-07:00",
12 | "modified_at": "2016-04-23T11:03:16-07:00"
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxEvent/GetEnterpriseEvents200.json:
--------------------------------------------------------------------------------
1 | {
2 | "chunk_size": 2,
3 | "next_stream_position": "1152922986252290886",
4 | "entries": [
5 | {
6 | "source": {
7 | "type": "user",
8 | "id": "12345",
9 | "name": "Test User",
10 | "login": "test@user.com"
11 | },
12 | "created_by": {
13 | "type": "user",
14 | "id": "54321",
15 | "name": "Example User",
16 | "login": "example@user.com"
17 | },
18 | "created_at": "2015-12-02T09:41:31-08:00",
19 | "event_id": "1a4ade16-b1ff-4cc3-89a8-955e1522557c",
20 | "event_type": "ADD_LOGIN_ACTIVITY_DEVICE",
21 | "ip_address": "Unknown IP",
22 | "type": "event",
23 | "session_id": null,
24 | "additional_details": null,
25 | "action_by": {
26 | "type": "user",
27 | "id": "54321",
28 | "name": "Example User",
29 | "login": "example@user.com"
30 | }
31 | },
32 | {
33 | "source": {
34 | "type": "user",
35 | "id": "12345",
36 | "name": "Test User",
37 | "login": "test@user.com"
38 | },
39 | "created_by": {
40 | "type": "user",
41 | "id": "54321",
42 | "name": "Example User",
43 | "login": "example@user.com"
44 | },
45 | "created_at": "2015-12-02T09:41:31-08:00",
46 | "event_id": "1a4ade16-b1ff-4cc3-89a8-955e1522557c",
47 | "event_type": "ADD_LOGIN_ACTIVITY_DEVICE",
48 | "ip_address": "Unknown IP",
49 | "type": "event",
50 | "session_id": null,
51 | "additional_details": null,
52 | "action_by": {
53 | "type": "user",
54 | "id": "54321",
55 | "name": "Example User",
56 | "login": "example@user.com"
57 | }
58 | }
59 | ]
60 | }
61 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxException/BoxResponseException400WithErrorAndErrorDescription.json:
--------------------------------------------------------------------------------
1 | {
2 | "status": 403,
3 | "error": "Forbidden",
4 | "error_description": "Unauthorized Access",
5 | "request_id": "22222"
6 | }
7 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxException/BoxResponseException403.json:
--------------------------------------------------------------------------------
1 | {
2 | "status": 403,
3 | "code": "Forbidden"
4 | }
5 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxException/BoxResponseException403WithRequestID.json:
--------------------------------------------------------------------------------
1 | {
2 | "status": 403,
3 | "code": "Forbidden",
4 | "request_id": "22222"
5 | }
6 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxException/BoxResponseException404.json:
--------------------------------------------------------------------------------
1 | {
2 | "status": 404,
3 | "code": "instance_not_found"
4 | }
5 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxException/BoxResponseException409.json:
--------------------------------------------------------------------------------
1 | {
2 | "status": 409,
3 | "code": "Conflict"
4 | }
5 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxException/BoxResponseException500.json:
--------------------------------------------------------------------------------
1 | {
2 | "status": 500,
3 | "code": "Internal Server Error"
4 | }
5 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/CanUploadFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "upload_token": "Pc3FIOG9vSGV4VHo4QzAyg5T1JvNnJoZ3ExaVNyQWw6WjRsanRKZG5lQk9qUE1BVQP",
3 | "upload_url": "https://upload-las.app.box.com/api/2.0/files/content?upload_session_id=1234"
4 | }
5 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/CopyFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "file_version": {
5 | "type": "file_version",
6 | "id": "305010059772",
7 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
8 | },
9 | "sequence_id": "0",
10 | "etag": "0",
11 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
12 | "name": "New File Name",
13 | "description": "",
14 | "size": 68142,
15 | "path_collection": {
16 | "total_count": 1,
17 | "entries": [
18 | {
19 | "type": "folder",
20 | "id": "0",
21 | "sequence_id": null,
22 | "etag": null,
23 | "name": "All Files"
24 | }
25 | ]
26 | },
27 | "created_at": "2018-04-25T11:00:18-07:00",
28 | "modified_at": "2018-04-25T11:00:18-07:00",
29 | "trashed_at": null,
30 | "purged_at": null,
31 | "content_created_at": "2018-04-24T12:15:12-07:00",
32 | "content_modified_at": "2018-04-24T12:15:12-07:00",
33 | "created_by": {
34 | "type": "user",
35 | "id": "1111",
36 | "name": "Test User",
37 | "login": "test@user.com"
38 | },
39 | "modified_by": {
40 | "type": "user",
41 | "id": "1111",
42 | "name": "Test User",
43 | "login": "test@user.com"
44 | },
45 | "owned_by": {
46 | "type": "user",
47 | "id": "1111",
48 | "name": "Test User",
49 | "login": "test@user.com"
50 | },
51 | "shared_link": null,
52 | "parent": {
53 | "type": "folder",
54 | "id": "0",
55 | "sequence_id": null,
56 | "etag": null,
57 | "name": "All Files"
58 | },
59 | "item_status": "active"
60 | }
61 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/CreateClassificationOnFile201.json:
--------------------------------------------------------------------------------
1 | {
2 | "Box__Security__Classification__Key": "Public",
3 | "$type": "securityClassification-6VMVochwUWo-2113c92e-6de3-4f48-bb3c-ef08817b5e63",
4 | "$parent": "file_12345",
5 | "$id": "e1224150-9a7b-4760-96d9-fa845c140967",
6 | "$version": 0,
7 | "$typeVersion": 6,
8 | "$template": "securityClassification-6VMVochwUWo",
9 | "$scope": "enterprise_12345",
10 | "$canEdit": true
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/CreateMetadataOnFile201.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "bar",
3 | "$type": "properties",
4 | "$parent": "file_1111",
5 | "$id": "12345",
6 | "$version": 0,
7 | "$typeVersion": 4,
8 | "$template": "properties",
9 | "$scope": "global"
10 | }
11 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/CreateUploadSession201.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_parts": 1,
3 | "part_size": 5,
4 | "session_endpoints": {
5 | "list_parts": "https://localhost:53621/2.0/files/upload_sessions/D5E3F8ADA11A38F0A66AD0B64AACA658/parts",
6 | "commit": "https://localhost:53621/2.0/files/upload_sessions/D5E3F8ADA11A38F0A66AD0B64AACA658/commit",
7 | "log_event": "https://localhost:53621/2.0/files/upload_sessions/D5E3F8ADA11A38F0A66AD0B64AACA658/log",
8 | "upload_part": "https://localhost:53621/2.0/files/upload_sessions/D5E3F8ADA11A38F0A66AD0B64AACA658",
9 | "status": "https://localhost:53621/2.0/files/upload_sessions/D5E3F8ADA11A38F0A66AD0B64AACA658",
10 | "abort": "https://localhost:53621/2.0/files/upload_sessions/D5E3F8ADA11A38F0A66AD0B64AACA658"
11 | },
12 | "session_expires_at": "2017-11-09T21:59:16Z",
13 | "id": "D5E3F8ADA11A38F0A66AD0B64AACA658",
14 | "type": "upload_session",
15 | "num_parts_processed": 0
16 | }
17 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/GetAllFileVersions200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "file_version",
6 | "id": "12345",
7 | "sha1": "a783fb33dcc129625d36c1b401fd315222590b5d",
8 | "name": "Example.jpg",
9 | "size": 37921,
10 | "created_at": "2018-05-02T13:50:57-07:00",
11 | "modified_at": "2018-05-02T13:50:59-07:00",
12 | "modified_by": {
13 | "type": "user",
14 | "id": "1111",
15 | "name": "Test User",
16 | "login": "test@user.com"
17 | },
18 | "trashed_at": null,
19 | "purged_at": null
20 | }
21 | ],
22 | "limit": 1000,
23 | "offset": 0
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/GetFileRepresentation200.json:
--------------------------------------------------------------------------------
1 | {
2 | "representation": "jpg",
3 | "properties": {
4 | "dimensions": "32x32",
5 | "paged": false,
6 | "thumb": true
7 | },
8 | "info": {
9 | "url": "https://localhost:53621/2.0/internal_files/1030335435441/versions/1116437417841/representations/jpg_thumb_32x32"
10 | },
11 | "status": {
12 | "state": "success"
13 | },
14 | "content": {
15 | "url_template": "https://localhost:53621/2.0/internal_files/1030335435441/versions/1116437417841/representations/jpg_thumb_32x32/content/{+asset_path}"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/GetFileRepresentation200WithPending.json:
--------------------------------------------------------------------------------
1 | {
2 | "representation": "jpg",
3 | "properties": {
4 | "dimensions": "32x32",
5 | "paged": false,
6 | "thumb": true
7 | },
8 | "info": {
9 | "url": "https://localhost:53621/2.0/internal_files/1030335435441/versions/1116437417841/representations/jpg_thumb_32x32"
10 | },
11 | "status": {
12 | "state": "pending"
13 | },
14 | "content": {
15 | "url_template": "https://localhost:53621/2.0/internal_files/1030335435441/versions/1116437417841/representations/jpg_thumb_32x32/content/{+asset_path}"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/GetFileRepresentations200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "etag": "0",
5 | "representations": {
6 | "entries": [
7 | {
8 | "representation": "jpg",
9 | "properties": {
10 | "dimensions": "32x32",
11 | "paged": false,
12 | "thumb": true
13 | },
14 | "info": {
15 | "url": "https://localhost:53621/2.0/internal_files/12345/versions/1116420931563/representations/jpg_thumb_32x32"
16 | },
17 | "status": {
18 | "state": "none"
19 | },
20 | "content": {
21 | "url_template": "https://localhost:53621/2.0/internal_files/12345/versions/1116420931563/representations/jpg_thumb_32x32/content/{+asset_path}"
22 | }
23 | }
24 | ]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/GetFileTasksInfoWithFields200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 5,
3 | "entries": [
4 | {
5 | "type": "task",
6 | "id": "38599261",
7 | "is_completed": true
8 | },
9 | {
10 | "type": "task",
11 | "id": "38620737",
12 | "is_completed": true
13 | },
14 | {
15 | "type": "task",
16 | "id": "38620945",
17 | "is_completed": true
18 | },
19 | {
20 | "type": "task",
21 | "id": "38621621",
22 | "is_completed": true
23 | },
24 | {
25 | "type": "task",
26 | "id": "44118229",
27 | "is_completed": true
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/GetFileVersion200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file_version",
3 | "id": "12345",
4 | "sha1": "a783fb33dcc129625d36c1b401fd315222590b5d",
5 | "name": "Example.jpg",
6 | "size": 37921,
7 | "created_at": "2018-05-02T13:50:57-07:00",
8 | "modified_at": "2018-05-02T13:50:59-07:00",
9 | "modified_by": {
10 | "type": "user",
11 | "id": "1111",
12 | "name": "Test User",
13 | "login": "test@user.com"
14 | },
15 | "trashed_at": null,
16 | "purged_at": null
17 | }
18 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/GetMetadataOnFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "bar",
3 | "$type": "properties",
4 | "$parent": "file_1111",
5 | "$id": "12345",
6 | "$version": 0,
7 | "$typeVersion": 4,
8 | "$template": "properties",
9 | "$scope": "global"
10 | }
11 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/ListUploadedPart200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "limit": 100,
4 | "offset": 0,
5 | "order": [
6 | {
7 | "by": "type",
8 | "direction": "ASC"
9 | }
10 | ],
11 | "entries": [
12 | {
13 | "part_id": "CFEB5BA9",
14 | "offset": 0,
15 | "size": 5,
16 | "sha1": "5fde1ccb603e6566d20da811c9c8bcccb044d4ae"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/ListUploadedParts200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 2,
3 | "limit": 100,
4 | "offset": 0,
5 | "order": [
6 | {
7 | "by": "type",
8 | "direction": "ASC"
9 | }
10 | ],
11 | "entries": [
12 | {
13 | "part_id": "AHDJNA9",
14 | "offset": 5,
15 | "size": 5,
16 | "sha1": "5fde1cfjwuvbjkafhryejwocb044d4ae"
17 | },
18 | {
19 | "part_id": "BHFYWL5BA9",
20 | "offset": 11,
21 | "size": 5,
22 | "sha1": "nfyuwknf6566d20da811c9c8bcccb044d4ae"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/LockFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "etag": "1",
5 | "lock": {
6 | "type": "lock",
7 | "id": "1111",
8 | "created_by": {
9 | "type": "user",
10 | "id": "2222",
11 | "name": "Test User",
12 | "login": "test@user.com"
13 | },
14 | "created_at": "2018-04-25T11:48:45-07:00",
15 | "expires_at": null,
16 | "is_download_prevented": true
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/MoveFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "file_version": {
5 | "type": "file_version",
6 | "id": "304867920258",
7 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
8 | },
9 | "sequence_id": "1",
10 | "etag": "1",
11 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
12 | "name": "New File Name",
13 | "description": "",
14 | "size": 68142,
15 | "path_collection": {
16 | "total_count": 2,
17 | "entries": [
18 | {
19 | "type": "folder",
20 | "id": "0",
21 | "sequence_id": null,
22 | "etag": null,
23 | "name": "All Files"
24 | },
25 | {
26 | "type": "folder",
27 | "id": "1111",
28 | "sequence_id": "0",
29 | "etag": "0",
30 | "name": "Another Move Folder"
31 | }
32 | ]
33 | },
34 | "created_at": "2018-04-24T17:00:44-07:00",
35 | "modified_at": "2018-04-25T10:47:00-07:00",
36 | "trashed_at": null,
37 | "purged_at": null,
38 | "content_created_at": "2018-04-24T12:15:12-07:00",
39 | "content_modified_at": "2018-04-24T12:15:12-07:00",
40 | "created_by": {
41 | "type": "user",
42 | "id": "1111",
43 | "name": "Test User",
44 | "login": "test@user.com"
45 | },
46 | "modified_by": {
47 | "type": "user",
48 | "id": "1111",
49 | "name": "Test User",
50 | "login": "test@user.com"
51 | },
52 | "owned_by": {
53 | "type": "user",
54 | "id": "1111",
55 | "name": "Test User",
56 | "login": "test@user.com"
57 | },
58 | "shared_link": null,
59 | "parent": {
60 | "type": "folder",
61 | "id": "1111",
62 | "sequence_id": "0",
63 | "etag": "0",
64 | "name": "Another Move Folder"
65 | },
66 | "item_status": "active"
67 | }
68 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/UnlockFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "etag": "1",
5 | "lock": null
6 | }
7 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/UpdateClassificationOnFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "Box__Security__Classification__Key": "Internal",
3 | "$type": "securityClassification-6VMVochwUWo-2113c92e-6de3-4f48-bb3c-ef08817b5e63",
4 | "$parent": "file_12345",
5 | "$id": "e1224150-9a7b-4760-96d9-fa845c140967",
6 | "$version": 0,
7 | "$typeVersion": 6,
8 | "$template": "securityClassification-6VMVochwUWo",
9 | "$scope": "enterprise_12345",
10 | "$canEdit": true
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/UpdateFileInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "file_version": {
5 | "type": "file_version",
6 | "id": "304867920258",
7 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
8 | },
9 | "sequence_id": "0",
10 | "etag": "0",
11 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
12 | "name": "New File Name",
13 | "description": "",
14 | "size": 68142,
15 | "path_collection": {
16 | "total_count": 2,
17 | "entries": [
18 | {
19 | "type": "folder",
20 | "id": "0",
21 | "sequence_id": null,
22 | "etag": null,
23 | "name": "All Files"
24 | },
25 | {
26 | "type": "folder",
27 | "id": "1111",
28 | "sequence_id": "0",
29 | "etag": "0",
30 | "name": "Example Folder"
31 | }
32 | ]
33 | },
34 | "created_at": "2018-04-24T17:00:44-07:00",
35 | "modified_at": "2018-04-24T17:01:11-07:00",
36 | "trashed_at": null,
37 | "purged_at": null,
38 | "content_created_at": "2018-04-24T12:15:12-07:00",
39 | "content_modified_at": "2018-04-24T12:15:12-07:00",
40 | "created_by": {
41 | "type": "user",
42 | "id": "1111",
43 | "name": "Test User",
44 | "login": "test@user.com"
45 | },
46 | "modified_by": {
47 | "type": "user",
48 | "id": "1111",
49 | "name": "Test User",
50 | "login": "test@user.com"
51 | },
52 | "owned_by": {
53 | "type": "user",
54 | "id": "1111",
55 | "name": "Test User",
56 | "login": "test@user.com"
57 | },
58 | "shared_link": null,
59 | "parent": {
60 | "type": "folder",
61 | "id": "2222",
62 | "sequence_id": "0",
63 | "etag": "0",
64 | "name": "Test Folder"
65 | },
66 | "item_status": "active"
67 | }
68 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/UpdateMetadataOnFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "test1": "text",
3 | "test2": [
4 | "first",
5 | "second",
6 | "third"
7 | ],
8 | "test3": 2,
9 | "test4": 2.33333333333333344E17,
10 | "$type": "account-e68798f0-347f-4882-a1ae-f65b032780ac",
11 | "$parent": "file_12345",
12 | "$id": "0db91053-c355-4fc7-b69c-9d511974bbc4",
13 | "$version": 1,
14 | "$typeVersion": 1,
15 | "$template": "testtemplate",
16 | "$scope": "enterprise_11111",
17 | "$canEdit": true
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFile/UploadPartOne200.json:
--------------------------------------------------------------------------------
1 | {
2 | "part": {
3 | "part_id": "CFEB5BA9",
4 | "offset": 0,
5 | "size": 5,
6 | "sha1": "5fde1ccb603e6566d20da811c9c8bcccb044d4ae"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFileRequest/CopyFileRequest200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "42037322",
3 | "type": "file-request",
4 | "created_at": "2020-09-28T10:53:43-08:00",
5 | "created_by": {
6 | "id": "11446498",
7 | "type": "user",
8 | "login": "ceo@example.com",
9 | "name": "Aaron Levie"
10 | },
11 | "description": "Following documents are requested for your process",
12 | "etag": "1",
13 | "expires_at": "2020-09-28T10:53:43-08:00",
14 | "folder": {
15 | "id": "12345",
16 | "type": "folder",
17 | "etag": "1",
18 | "name": "Contracts",
19 | "sequence_id": "3"
20 | },
21 | "is_description_required": true,
22 | "is_email_required": true,
23 | "status": "active",
24 | "title": "Please upload documents",
25 | "updated_at": "2020-09-28T10:53:43-08:00",
26 | "updated_by": {
27 | "id": "11446498",
28 | "type": "user",
29 | "login": "ceo@example.com",
30 | "name": "Aaron Levie"
31 | },
32 | "url": "/f/19e57f40ace247278a8e3d336678c64a"
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFileRequest/GetFileRequest200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "42037322",
3 | "type": "file-request",
4 | "created_at": "2020-09-28T10:53:43-08:00",
5 | "created_by": {
6 | "id": "11446498",
7 | "type": "user",
8 | "login": "ceo@example.com",
9 | "name": "Aaron Levie"
10 | },
11 | "description": "Following documents are requested for your process",
12 | "etag": "1",
13 | "expires_at": "2020-09-28T10:53:43-08:00",
14 | "folder": {
15 | "id": "12345",
16 | "type": "folder",
17 | "etag": "1",
18 | "name": "Contracts",
19 | "sequence_id": "3"
20 | },
21 | "is_description_required": true,
22 | "is_email_required": true,
23 | "status": "active",
24 | "title": "Please upload documents",
25 | "updated_at": "2020-09-28T10:53:43-08:00",
26 | "updated_by": {
27 | "id": "11446498",
28 | "type": "user",
29 | "login": "ceo@example.com",
30 | "name": "Aaron Levie"
31 | },
32 | "url": "/f/19e57f40ace247278a8e3d336678c64a"
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFileRequest/UpdateFileRequest200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "42037322",
3 | "type": "file-request",
4 | "created_at": "2020-09-28T10:53:43-08:00",
5 | "created_by": {
6 | "id": "11446498",
7 | "type": "user",
8 | "login": "ceo@example.com",
9 | "name": "Aaron Levie"
10 | },
11 | "description": "Following documents are requested for your process",
12 | "etag": "1",
13 | "expires_at": "2020-09-28T10:53:43-08:00",
14 | "folder": {
15 | "id": "12345",
16 | "type": "folder",
17 | "etag": "1",
18 | "name": "Contracts",
19 | "sequence_id": "3"
20 | },
21 | "is_description_required": true,
22 | "is_email_required": true,
23 | "status": "active",
24 | "title": "Please upload documents",
25 | "updated_at": "2020-09-28T10:53:43-08:00",
26 | "updated_by": {
27 | "id": "11446498",
28 | "type": "user",
29 | "login": "ceo@example.com",
30 | "name": "Aaron Levie"
31 | },
32 | "url": "/f/19e57f40ace247278a8e3d336678c64a"
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/CreateClassificationOnFolder201.json:
--------------------------------------------------------------------------------
1 | {
2 | "Box__Security__Classification__Key": "Public",
3 | "$type": "securityClassification-6VMVochwUWo-2113c92e-6de3-4f48-bb3c-ef08817b5e63",
4 | "$parent": "folder_12345",
5 | "$id": "e1224150-9a7b-4760-96d9-fa845c140967",
6 | "$version": 0,
7 | "$typeVersion": 6,
8 | "$template": "securityClassification-6VMVochwUWo",
9 | "$scope": "enterprise_12345",
10 | "$canEdit": true
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/CreateFolderLock200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "12345678",
3 | "type": "folder_lock",
4 | "created_at": "2020-09-14T23:12:53Z",
5 | "created_by": {
6 | "id": "11446498",
7 | "type": "user"
8 | },
9 | "folder": {
10 | "id": "12345",
11 | "type": "folder",
12 | "etag": "1",
13 | "name": "Contracts",
14 | "sequence_id": "3"
15 | },
16 | "lock_type": "freeze",
17 | "locked_operations": {
18 | "delete": true,
19 | "move": true
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/CreateMetadataOnFolder201.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "bar",
3 | "$type": "properties",
4 | "$parent": "folder_12345",
5 | "$id": "12345",
6 | "$version": 0,
7 | "$typeVersion": 4,
8 | "$template": "properties",
9 | "$scope": "global"
10 | }
11 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/CreateNewFolder201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "folder",
3 | "id": "0",
4 | "sequence_id": "0",
5 | "etag": "0",
6 | "name": "Example Test Folder",
7 | "created_at": "2018-04-24T12:50:03-07:00",
8 | "modified_at": "2018-04-24T12:50:03-07:00",
9 | "description": "",
10 | "size": 0,
11 | "path_collection": {
12 | "total_count": 1,
13 | "entries": [
14 | {
15 | "type": "folder",
16 | "id": "0",
17 | "sequence_id": null,
18 | "etag": null,
19 | "name": "All Files"
20 | }
21 | ]
22 | },
23 | "created_by": {
24 | "type": "user",
25 | "id": "1111",
26 | "name": "Test User",
27 | "login": "test@user.com"
28 | },
29 | "modified_by": {
30 | "type": "user",
31 | "id": "1111",
32 | "name": "Test User",
33 | "login": "test@user.com"
34 | },
35 | "trashed_at": null,
36 | "purged_at": null,
37 | "content_created_at": "2018-04-24T12:50:03-07:00",
38 | "content_modified_at": "2018-04-24T12:50:03-07:00",
39 | "owned_by": {
40 | "type": "user",
41 | "id": "1111",
42 | "name": "Test User",
43 | "login": "test@user.com"
44 | },
45 | "shared_link": null,
46 | "folder_upload_email": null,
47 | "parent": {
48 | "type": "folder",
49 | "id": "0",
50 | "sequence_id": null,
51 | "etag": null,
52 | "name": "All Files"
53 | },
54 | "item_status": "active",
55 | "item_collection": {
56 | "total_count": 0,
57 | "entries": [],
58 | "offset": 0,
59 | "limit": 100,
60 | "order": [
61 | {
62 | "by": "type",
63 | "direction": "ASC"
64 | },
65 | {
66 | "by": "name",
67 | "direction": "ASC"
68 | }
69 | ]
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/CreateSharedLinkForFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "folder",
3 | "id": "12345",
4 | "etag": "1",
5 | "shared_link": {
6 | "url": "https://example.box.com/s/kg4dt71xs1u552ctef3pb023ben0bk7vs",
7 | "download_url": null,
8 | "vanity_url": null,
9 | "effective_access": "open",
10 | "effective_permission": "can_download",
11 | "is_password_enabled": false,
12 | "unshared_at": null,
13 | "download_count": 0,
14 | "preview_count": 0,
15 | "access": "open",
16 | "permissions": {
17 | "can_preview": true,
18 | "can_download": true
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/GetAllFolderCollaborations200WithFields.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 2,
3 | "entries": [
4 | {
5 | "type": "collaboration",
6 | "id": "12345",
7 | "item": {
8 | "type": "folder",
9 | "id": "3333",
10 | "sequence_id": "1",
11 | "etag": "1",
12 | "name": "Test Folder"
13 | },
14 | "can_view_path": false
15 | },
16 | {
17 | "type": "collaboration",
18 | "id": "124783",
19 | "item": {
20 | "type": "folder",
21 | "id": "3333",
22 | "sequence_id": "1",
23 | "etag": "1",
24 | "name": "Test Folder"
25 | },
26 | "can_view_path": true
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/GetAllFolderItems200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 2,
3 | "entries": [
4 | {
5 | "type": "file",
6 | "id": "12345",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "72464630113",
10 | "sha1": "05e74cbb2f89a3ded0ab1d5c4f7f1a086c259ac3"
11 | },
12 | "sequence_id": "10",
13 | "etag": "10",
14 | "sha1": "05e74cbb2f89a3ded0ab1d5c4f7f1a086c259ac3",
15 | "name": "Example.pdf"
16 | },
17 | {
18 | "type": "file",
19 | "id": "23423",
20 | "file_version": {
21 | "type": "file_version",
22 | "id": "77379685333",
23 | "sha1": "aa810e72823f3c3dad2d1d4488966f6f1e0a8a9d"
24 | },
25 | "sequence_id": "5",
26 | "etag": "5",
27 | "sha1": "aa810e72823f3c3dad2d1d4488966f6f1e0a8a9d",
28 | "name": "Example2.com"
29 | }
30 | ],
31 | "offset": 0,
32 | "limit": 100,
33 | "order": [
34 | {
35 | "by": "type",
36 | "direction": "ASC"
37 | },
38 | {
39 | "by": "name",
40 | "direction": "ASC"
41 | }
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/GetAllMetadataOnFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "foo": "bar",
5 | "$type": "properties",
6 | "$parent": "folder_12345",
7 | "$id": "12345",
8 | "$version": 0,
9 | "$typeVersion": 4,
10 | "$template": "properties",
11 | "$scope": "global"
12 | }
13 | ],
14 | "limit": 100
15 | }
16 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/GetAllRootFolderItems200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "folder",
3 | "id": "0",
4 | "sequence_id": null,
5 | "etag": null,
6 | "name": "All Files",
7 | "created_at": null,
8 | "modified_at": null,
9 | "description": "",
10 | "size": 22392366495,
11 | "path_collection": {
12 | "total_count": 0,
13 | "entries": []
14 | },
15 | "created_by": {
16 | "type": "user",
17 | "id": "",
18 | "name": "",
19 | "login": ""
20 | },
21 | "modified_by": {
22 | "type": "user",
23 | "id": "1111",
24 | "name": "Test User",
25 | "login": "test@user.com"
26 | },
27 | "trashed_at": null,
28 | "purged_at": null,
29 | "content_created_at": null,
30 | "content_modified_at": null,
31 | "owned_by": {
32 | "type": "user",
33 | "id": "2222",
34 | "name": "Test User",
35 | "login": "test@user.com"
36 | },
37 | "shared_link": null,
38 | "folder_upload_email": null,
39 | "parent": null,
40 | "item_status": "active",
41 | "item_collection": {
42 | "total_count": 2,
43 | "entries": [
44 | {
45 | "type": "folder",
46 | "id": "12345",
47 | "sequence_id": "0",
48 | "etag": "0",
49 | "name": "Example Folder"
50 | },
51 | {
52 | "type": "folder",
53 | "id": "43243",
54 | "sequence_id": "1",
55 | "etag": "1",
56 | "name": "Example Folder 2"
57 | }
58 | ],
59 | "offset": 0,
60 | "limit": 100,
61 | "order": [
62 | {
63 | "by": "type",
64 | "direction": "ASC"
65 | },
66 | {
67 | "by": "name",
68 | "direction": "ASC"
69 | }
70 | ]
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/GetCollaborations200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "collaboration",
6 | "id": "13237653007",
7 | "created_by": {
8 | "type": "user",
9 | "id": "235699372",
10 | "name": "Cary Cheng",
11 | "login": "ccheng+demo@box.com"
12 | },
13 | "created_at": "2018-04-11T13:33:14-07:00",
14 | "modified_at": "2018-04-11T13:33:14-07:00",
15 | "expires_at": null,
16 | "status": "pending",
17 | "accessible_by": null,
18 | "role": "viewer",
19 | "acknowledged_at": null,
20 | "item": {
21 | "type": "folder",
22 | "id": "48577276286",
23 | "sequence_id": "0",
24 | "etag": "0",
25 | "name": "Retention Test"
26 | }
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/GetFolderLocks200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "folder": {
5 | "id": "12345",
6 | "etag": "1",
7 | "type": "folder",
8 | "sequence_id": "3",
9 | "name": "Contracts"
10 | },
11 | "id": "12345678",
12 | "type": "folder_lock",
13 | "created_by": {
14 | "id": "11446498",
15 | "type": "user"
16 | },
17 | "created_at": "2020-09-14T23:12:53Z",
18 | "locked_operations": {
19 | "move": true,
20 | "delete": true
21 | },
22 | "lock_type": "freeze"
23 | }
24 | ],
25 | "limit": 1000,
26 | "next_marker": null
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/GetMetadataForFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "bar",
3 | "$type": "properties",
4 | "$parent": "folder_12345",
5 | "$id": "12345",
6 | "$version": 0,
7 | "$typeVersion": 4,
8 | "$template": "properties",
9 | "$scope": "global"
10 | }
11 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/PutTransferFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "folder",
3 | "id": "0",
4 | "sequence_id": "0",
5 | "etag": "0",
6 | "name": "Example Test Folder",
7 | "created_at": "2018-04-24T12:50:03-07:00",
8 | "modified_at": "2018-04-24T12:50:03-07:00",
9 | "description": "",
10 | "size": 0,
11 | "path_collection": {
12 | "total_count": 1,
13 | "entries": [
14 | {
15 | "type": "folder",
16 | "id": "0",
17 | "sequence_id": null,
18 | "etag": null,
19 | "name": "All Files"
20 | }
21 | ]
22 | },
23 | "created_by": {
24 | "type": "user",
25 | "id": "1111",
26 | "name": "Test User",
27 | "login": "test@user.com"
28 | },
29 | "modified_by": {
30 | "type": "user",
31 | "id": "1111",
32 | "name": "Test User",
33 | "login": "test@user.com"
34 | },
35 | "trashed_at": null,
36 | "purged_at": null,
37 | "content_created_at": "2018-04-24T12:50:03-07:00",
38 | "content_modified_at": "2018-04-24T12:50:03-07:00",
39 | "owned_by": {
40 | "type": "user",
41 | "id": "1111",
42 | "name": "Test User",
43 | "login": "test@user.com"
44 | },
45 | "shared_link": null,
46 | "folder_upload_email": null,
47 | "parent": {
48 | "type": "folder",
49 | "id": "0",
50 | "sequence_id": null,
51 | "etag": null,
52 | "name": "All Files"
53 | },
54 | "item_status": "active",
55 | "item_collection": {
56 | "total_count": 0,
57 | "entries": [],
58 | "offset": 0,
59 | "limit": 100,
60 | "order": [
61 | {
62 | "by": "type",
63 | "direction": "ASC"
64 | },
65 | {
66 | "by": "name",
67 | "direction": "ASC"
68 | }
69 | ]
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/UpdateClassificationOnFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "Box__Security__Classification__Key": "Internal",
3 | "$type": "securityClassification-6VMVochwUWo-2113c92e-6de3-4f48-bb3c-ef08817b5e63",
4 | "$parent": "folder_12345",
5 | "$id": "e1224150-9a7b-4760-96d9-fa845c140967",
6 | "$version": 0,
7 | "$typeVersion": 6,
8 | "$template": "securityClassification-6VMVochwUWo",
9 | "$scope": "enterprise_12345",
10 | "$canEdit": true
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxFolder/UpdateMetadataOnFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "test1": "text",
3 | "test2": [
4 | "first",
5 | "second",
6 | "third"
7 | ],
8 | "test3": 2,
9 | "test4": 2.33333333333333344E17,
10 | "$type": "account-e68798f0-347f-4882-a1ae-f65b032780ac",
11 | "$parent": "folder_12345",
12 | "$id": "0db91053-c355-4fc7-b69c-9d511974bbc4",
13 | "$version": 1,
14 | "$typeVersion": 1,
15 | "$template": "testtemplate",
16 | "$scope": "enterprise_11111",
17 | "$canEdit": true
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/CreateAGroup201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "group",
3 | "id": "12345",
4 | "name": "Test Group",
5 | "group_type": "managed_group",
6 | "created_at": "2018-04-20T12:51:49-07:00",
7 | "modified_at": "2018-04-20T12:51:49-07:00"
8 | }
9 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/CreateGroupMembership201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "group_membership",
3 | "id": "12345",
4 | "user": {
5 | "type": "user",
6 | "id": "1111",
7 | "name": "Test User",
8 | "login": "test@user.com"
9 | },
10 | "group": {
11 | "type": "group",
12 | "id": "2222",
13 | "name": "Example Group",
14 | "group_type": "managed_group"
15 | },
16 | "role": "member",
17 | "configurable_permissions": null,
18 | "created_at": "2018-04-20T15:26:10-07:00",
19 | "modified_at": "2018-04-20T15:26:10-07:00"
20 | }
21 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetAGroupsCollaborations1stPage200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 200,
3 | "entries": [
4 | {
5 | "type": "collaboration",
6 | "id": "12345",
7 | "created_by": null,
8 | "created_at": "2018-04-20T14:57:25-07:00",
9 | "modified_at": "2018-04-20T14:57:25-07:00",
10 | "expires_at": null,
11 | "status": "accepted",
12 | "accessible_by": {
13 | "type": "group",
14 | "id": "1111",
15 | "name": "New Group Name",
16 | "group_type": "managed_group"
17 | },
18 | "role": "editor",
19 | "acknowledged_at": "2018-04-20T14:57:25-07:00",
20 | "item": {
21 | "type": "folder",
22 | "id": "2222",
23 | "sequence_id": "2",
24 | "etag": "2",
25 | "name": "Ball Valve Diagram"
26 | }
27 | }
28 | ],
29 | "offset": 0,
30 | "limit": 100
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetAGroupsCollaborations2ndPage200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 200,
3 | "entries": [
4 | {
5 | "type": "collaboration",
6 | "id": "23647",
7 | "created_by": null,
8 | "created_at": "2018-04-20T14:57:25-07:00",
9 | "modified_at": "2018-04-20T14:57:25-07:00",
10 | "expires_at": null,
11 | "status": "accepted",
12 | "accessible_by": {
13 | "type": "group",
14 | "id": "1111",
15 | "name": "New Group Name",
16 | "group_type": "managed_group"
17 | },
18 | "role": "editor",
19 | "acknowledged_at": "2018-04-20T14:57:25-07:00",
20 | "item": {
21 | "type": "file",
22 | "id": "12342",
23 | "sequence_id": "2",
24 | "etag": "2",
25 | "name": "Ball Valve Diagram"
26 | }
27 | }
28 | ],
29 | "offset": 1,
30 | "limit": 100
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetAGroupsInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "group",
3 | "id": "12345",
4 | "name": "Test Group",
5 | "group_type": "managed_group",
6 | "created_at": "2018-04-20T12:51:49-07:00",
7 | "modified_at": "2018-04-20T12:51:49-07:00"
8 | }
9 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetAllGroups200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 2,
3 | "entries": [
4 | {
5 | "type": "group",
6 | "id": "12345",
7 | "name": "Test Group 1",
8 | "group_type": "managed_group"
9 | },
10 | {
11 | "type": "group",
12 | "id": "53453",
13 | "name": "Test Group 2",
14 | "group_type": "managed_group"
15 | }
16 | ],
17 | "limit": 100,
18 | "offset": 0
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetGroupMembershipForAUser200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 2,
3 | "entries": [
4 | {
5 | "type": "group_membership",
6 | "id": "12345",
7 | "user": {
8 | "type": "user",
9 | "id": "1111",
10 | "name": "Example User",
11 | "login": "example@user.com"
12 | },
13 | "group": {
14 | "type": "group",
15 | "id": "1111",
16 | "name": "Test Group 1",
17 | "group_type": "managed_group"
18 | },
19 | "role": "member"
20 | },
21 | {
22 | "type": "group_membership",
23 | "id": "32423",
24 | "user": {
25 | "type": "user",
26 | "id": "1111",
27 | "name": "Example User",
28 | "login": "example@user.com"
29 | },
30 | "group": {
31 | "type": "group",
32 | "id": "2222",
33 | "name": "Test Group 2",
34 | "group_type": "managed_group"
35 | },
36 | "role": "admin"
37 | }
38 | ],
39 | "limit": 100,
40 | "offset": 0
41 | }
42 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetGroupsByName200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "group",
6 | "id": "12345",
7 | "name": "[getCollaborationsSucceedsAndHandlesResponseCorrectly] Test Group"
8 | }
9 | ],
10 | "limit": 100,
11 | "offset": 0
12 | }
13 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetGroupsByNameWithFieldsOption200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "group",
6 | "id": "12345",
7 | "description": "This is Test Group"
8 | }
9 | ],
10 | "limit": 100,
11 | "offset": 0
12 | }
13 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/GetMembershipForAGroup200.json:
--------------------------------------------------------------------------------
1 | {
2 | "offset": 0,
3 | "limit": 100,
4 | "total_count": 1,
5 | "entries": [
6 | {
7 | "type": "group_membership",
8 | "id": "12345",
9 | "user": {
10 | "type": "user",
11 | "id": "2222",
12 | "name": "Example User",
13 | "login": "example@user.com"
14 | },
15 | "group": {
16 | "type": "group",
17 | "id": "1111",
18 | "name": "Example Group",
19 | "group_type": "managed_group"
20 | },
21 | "role": "admin"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/UpdateAGroupsInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "group",
3 | "id": "12345",
4 | "name": "New Group Name",
5 | "group_type": "managed_group",
6 | "created_at": "2018-04-20T12:51:49-07:00",
7 | "modified_at": "2018-04-20T13:56:06-07:00"
8 | }
9 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxGroup/UpdateGroupMembership200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "group_membership",
3 | "id": "12345",
4 | "user": {
5 | "type": "user",
6 | "id": "1111",
7 | "name": "Test User",
8 | "login": "test@user.com"
9 | },
10 | "group": {
11 | "type": "group",
12 | "id": "2222",
13 | "name": "Example Group",
14 | "group_type": "managed_group"
15 | },
16 | "role": "admin",
17 | "configurable_permissions": {
18 | "can_create_accounts": true,
19 | "can_edit_accounts": true,
20 | "can_instant_login": true,
21 | "can_run_reports": true
22 | },
23 | "created_at": "2018-04-20T15:26:10-07:00",
24 | "modified_at": "2018-04-20T15:40:11-07:00"
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/GetFileVersionLegalHolds200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "legal_hold",
5 | "id": "99999"
6 | }
7 | ],
8 | "limit": 100,
9 | "order": [
10 | {
11 | "by": "retention_policy_set_id, file_version_id",
12 | "direction": "ASC"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/GetFileVersionLegalHoldsID200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold",
3 | "id": "99999",
4 | "file_version": {
5 | "type": "file_version",
6 | "id": "77777"
7 | },
8 | "file": {
9 | "type": "file",
10 | "id": "88888",
11 | "etag": "0"
12 | },
13 | "legal_hold_policy_assignments": [
14 | {
15 | "type": "legal_hold_policy_assignment",
16 | "id": "12345"
17 | }
18 | ],
19 | "deleted_at": null
20 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/GetLegalHoldPolicies200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "legal_hold_policy",
5 | "id": "22222",
6 | "policy_name": "IRS Audit"
7 | },
8 | {
9 | "type": "legal_hold_policy",
10 | "id": "11111",
11 | "policy_name": "Trial Documents"
12 | }
13 | ],
14 | "limit": 100,
15 | "order": [
16 | {
17 | "by": "policy_name",
18 | "direction": "ASC"
19 | }
20 | ]
21 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/GetLegalHoldPoliciesID200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold_policy",
3 | "id": "11111",
4 | "policy_name": "Trial Documents",
5 | "description": "",
6 | "status": "active",
7 | "assignment_counts": {
8 | "user": 0,
9 | "folder": 0,
10 | "file": 0,
11 | "file_version": 0
12 | },
13 | "is_ongoing": true,
14 | "created_by": {
15 | "type": "user",
16 | "id": "33333",
17 | "name": "Test User",
18 | "login": "testuser@example.com"
19 | },
20 | "created_at": "2018-04-25T16:37:05-07:00",
21 | "modified_at": "2018-04-25T16:37:05-07:00",
22 | "deleted_at": null,
23 | "filter_started_at": null,
24 | "filter_ended_at": null
25 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/GetLegalHoldPolicyAssignmentsID200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold_policy_assignment",
3 | "id": "12345",
4 | "legal_hold_policy": {
5 | "type": "legal_hold_policy",
6 | "id": "11111",
7 | "policy_name": "Trial Documents"
8 | },
9 | "assigned_to": {
10 | "type": "folder",
11 | "id": "55555"
12 | },
13 | "assigned_by": {
14 | "type": "user",
15 | "id": "33333",
16 | "name": "Test User",
17 | "login": "testuser@example.com"
18 | },
19 | "assigned_at": "2018-04-25T17:07:56-07:00",
20 | "deleted_at": null,
21 | "modified_at": "2018-04-25T17:07:57-07:00"
22 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/GetLegalHoldPolicyAssignmentsPolicyID200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "legal_hold_policy_assignment",
5 | "id": "12345"
6 | }
7 | ],
8 | "limit": 100,
9 | "order": [
10 | {
11 | "by": "retention_policy_id, retention_policy_object_id",
12 | "direction": "ASC"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/PostLegalHoldPolicies201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold_policy",
3 | "id": "11111",
4 | "policy_name": "Trial Documents",
5 | "description": "",
6 | "status": "active",
7 | "assignment_counts": {
8 | "user": 0,
9 | "folder": 0,
10 | "file": 0,
11 | "file_version": 0
12 | },
13 | "created_by": {
14 | "type": "user",
15 | "id": "33333",
16 | "name": "Test User",
17 | "login": "testuser@example.com"
18 | },
19 | "created_at": "2018-04-25T16:37:05-07:00",
20 | "modified_at": "2018-04-25T16:37:05-07:00",
21 | "deleted_at": null,
22 | "filter_started_at": "2018-04-25T16:37:05-07:00",
23 | "filter_ended_at": "2020-04-25T16:37:05-07:00"
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/PostLegalHoldPolicyAssignments201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold_policy_assignment",
3 | "id": "12345",
4 | "legal_hold_policy": {
5 | "type": "legal_hold_policy",
6 | "id": "11111",
7 | "policy_name": "Trial Documents"
8 | },
9 | "assigned_to": {
10 | "type": "folder",
11 | "id": "55555"
12 | },
13 | "assigned_by": {
14 | "type": "user",
15 | "id": "33333",
16 | "name": "Test User",
17 | "login": "testuser@example.com"
18 | },
19 | "is_ongoing": true,
20 | "assigned_at": "2018-04-25T17:07:56-07:00",
21 | "deleted_at": null,
22 | "modified_at": "2018-04-25T17:07:57-07:00"
23 | }
24 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/PostOngoingLegalHoldPolicies201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold_policy",
3 | "id": "11111",
4 | "policy_name": "Trial Documents",
5 | "description": "This is a description.",
6 | "status": "active",
7 | "assignment_counts": {
8 | "user": 0,
9 | "folder": 0,
10 | "file": 0,
11 | "file_version": 0
12 | },
13 | "is_ongoing": true,
14 | "created_by": {
15 | "type": "user",
16 | "id": "33333",
17 | "name": "Test User",
18 | "login": "testuser@example.com"
19 | },
20 | "created_at": "2018-04-25T16:37:05-07:00",
21 | "modified_at": "2018-04-25T16:37:05-07:00",
22 | "deleted_at": null,
23 | "filter_started_at": null,
24 | "filter_ended_at": null
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/PostOngoingWithStartDateLegalHoldPolicies201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold_policy",
3 | "id": "11111",
4 | "policy_name": "Trial Documents",
5 | "description": "This is a description.",
6 | "status": "active",
7 | "assignment_counts": {
8 | "user": 0,
9 | "folder": 0,
10 | "file": 0,
11 | "file_version": 0
12 | },
13 | "is_ongoing": true,
14 | "created_by": {
15 | "type": "user",
16 | "id": "33333",
17 | "name": "Test User",
18 | "login": "testuser@example.com"
19 | },
20 | "created_at": "2018-04-25T16:37:05-07:00",
21 | "modified_at": "2018-04-25T16:37:05-07:00",
22 | "deleted_at": null,
23 | "filter_started_at": "2018-04-25T16:37:05-07:00",
24 | "filter_ended_at": null
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxLegalHold/PutLegalHoldPoliciesID200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "legal_hold_policy",
3 | "id": "11111",
4 | "policy_name": "Trial Documents",
5 | "description": "Documents related to our ongoing litigation",
6 | "status": "active",
7 | "assignment_counts": {
8 | "user": 0,
9 | "folder": 0,
10 | "file": 0,
11 | "file_version": 0
12 | },
13 | "is_ongoing": true,
14 | "created_by": {
15 | "type": "user",
16 | "id": "33333",
17 | "name": "Test User",
18 | "login": "testuser@example.com"
19 | },
20 | "created_at": "2018-04-25T16:37:05-07:00",
21 | "modified_at": "2018-04-25T16:45:55-07:00",
22 | "deleted_at": null,
23 | "filter_started_at": null,
24 | "filter_ended_at": null
25 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataCascadePolicy/CreateMetadataCascadePolicies201.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "84113349-794d-445c-b93c-d8481b223434",
3 | "type": "metadata_cascade_policy",
4 | "owner_enterprise": {
5 | "type": "enterprise",
6 | "id": "11111"
7 | },
8 | "parent": {
9 | "type": "folder",
10 | "id": "22222"
11 | },
12 | "scope": "enterprise_11111",
13 | "templateKey": "testTemplate"
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataCascadePolicy/GetAllMetadataCascadePolicies200.json:
--------------------------------------------------------------------------------
1 | {
2 | "limit": 100,
3 | "entries": [
4 | {
5 | "id": "84113349-794d-445c-b93c-d8481b223434",
6 | "type": "metadata_cascade_policy",
7 | "owner_enterprise": {
8 | "type": "enterprise",
9 | "id": "11111"
10 | },
11 | "parent": {
12 | "type": "folder",
13 | "id": "22222"
14 | },
15 | "scope": "enterprise_11111",
16 | "templateKey": "testTemplate"
17 | }
18 | ],
19 | "next_marker": null,
20 | "prev_marker": null
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataCascadePolicy/GetMetadataCascadePoliciesID200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "84113349-794d-445c-b93c-d8481b223434",
3 | "type": "metadata_cascade_policy",
4 | "owner_enterprise": {
5 | "type": "enterprise",
6 | "id": "11111"
7 | },
8 | "parent": {
9 | "type": "folder",
10 | "id": "22222"
11 | },
12 | "scope": "enterprise_11111",
13 | "templateKey": "testTemplate"
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/CreateMetadataTemplate200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "f7a9891f",
3 | "templateKey": "documentFlow03",
4 | "scope": "enterprise",
5 | "displayName": "Document Flow 03",
6 | "hidden": false,
7 | "fields": [
8 | {
9 | "id": "f7a9894f",
10 | "type": "enum",
11 | "key": "fy",
12 | "displayName": "FY",
13 | "options": [
14 | {
15 | "id": "f7a9895f",
16 | "key": "FY16"
17 | },
18 | {
19 | "id": "f7a9896f",
20 | "key": "FY17"
21 | }
22 | ]
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/GetAMetadataTemplateInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "12345",
3 | "type": "metadata_template",
4 | "templateKey": "Test Template Key",
5 | "scope": "global",
6 | "displayName": "Test Template",
7 | "hidden": false,
8 | "fields": [
9 | {
10 | "id": "35252",
11 | "type": "string",
12 | "key": "keywords",
13 | "displayName": "Keywords",
14 | "hidden": false
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/GetAllEnterpriseTemplates200.json:
--------------------------------------------------------------------------------
1 | {
2 | "limit": 100,
3 | "entries": [
4 | {
5 | "id": "12345",
6 | "type": "metadata_template",
7 | "templateKey": "Test Template",
8 | "scope": "global",
9 | "displayName": "Template",
10 | "hidden": false,
11 | "fields": [
12 | {
13 | "id": "1111",
14 | "type": "string",
15 | "key": "keywords",
16 | "displayName": "Keywords",
17 | "hidden": false
18 | }
19 | ]
20 | },
21 | {
22 | "id": "23131",
23 | "type": "metadata_template",
24 | "templateKey": "Test Template 2",
25 | "scope": "global",
26 | "displayName": "Template 2",
27 | "hidden": false,
28 | "fields": [
29 | {
30 | "id": "2222",
31 | "type": "string",
32 | "key": "timelines",
33 | "displayName": "Timelines",
34 | "hidden": false
35 | }
36 | ]
37 | }
38 | ],
39 | "next_marker": null,
40 | "prev_marker": null
41 | }
42 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/GetMetadataTemplateOptionInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "f7a9891f",
3 | "templateKey": "productInfo",
4 | "scope": "enterprise_12345",
5 | "displayName": "Product Info",
6 | "hidden": false,
7 | "fields": [
8 | {
9 | "id": "f7a9892f",
10 | "type": "float",
11 | "key": "skuNumber",
12 | "displayName": "SKU Number",
13 | "hidden": false
14 | },
15 | {
16 | "id": "f7a9893f",
17 | "type": "string",
18 | "key": "description",
19 | "displayName": "Description",
20 | "hidden": false
21 | },
22 | {
23 | "id": "f7a9894f",
24 | "type": "enum",
25 | "key": "department",
26 | "displayName": "Department",
27 | "hidden": false,
28 | "options": [
29 | {
30 | "id": "f7a9895f",
31 | "key": "Beauty"
32 | },
33 | {
34 | "id": "f7a9896f",
35 | "key": "Shoes"
36 | }
37 | ]
38 | },
39 | {
40 | "id": "f7a9897f",
41 | "type": "date",
42 | "key": "displayDate",
43 | "displayName": "Display Date",
44 | "hidden": false
45 | }
46 | ]
47 | }
48 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/MetadataQuery1stRequest.json:
--------------------------------------------------------------------------------
1 | {
2 | "from": "enterprise_67890.relayWorkflowInformation",
3 | "query": "templateName >= :arg",
4 | "query_params": {
5 | "arg": "Templ Name"
6 | },
7 | "ancestor_folder_id": "0",
8 | "limit": 2
9 | }
10 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/MetadataQuery2ndRequest.json:
--------------------------------------------------------------------------------
1 | {
2 | "from": "enterprise_67890.relayWorkflowInformation",
3 | "query": "templateName >= :arg",
4 | "query_params": {
5 | "arg": "Templ Name"
6 | },
7 | "ancestor_folder_id": "0",
8 | "limit": 2,
9 | "marker": "0!asdfghjklzxcvbnmqwertyuiop1234567890qwertyuiopasdfghjklzxcvbnmasdfghjkl1234567890asdfghjklzxcvbnmzxcvbnmqwertyuiopasdfghjklzxcvbnm1234567890asdfghjklzxcvbnmqweRTYuiOpasDfGhjKlzxcvBNmqwerTYuIopasdFghJkLzxCvbnmASdfghJklqweRtyUiOpzxCvbnasdfghjKLqwerTYUiopasdFGHjklertyuIOp1234567890zxcvBnmasdFghJkLqwErtYuIoPasdfGhjksdFGHJKertyuIFGHJcvbnqwertyuiopasdFGHjkLzxcvbnmdfgHJdfg765fbbd."
10 | }
11 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/MetadataQueryResponseForFields200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "file",
5 | "id": "1244738582",
6 | "etag": "1",
7 | "sha1": "012b5jdunwkfu438991344044",
8 | "name": "Very Important.docx",
9 | "metadata": {
10 | "enterprise_67890": {
11 | "catalogImages": {
12 | "$parent": "file_50347290",
13 | "$version": 2,
14 | "$template": "catalogImages",
15 | "$scope": "enterprise_67890",
16 | "photographer": "Bob Dylan"
17 | }
18 | }
19 | }
20 | },
21 | {
22 | "type": "folder",
23 | "id": "124242482",
24 | "etag": "1",
25 | "sha1": "012b5ir8391344044",
26 | "name": "Also Important.docx",
27 | "metadata": {
28 | "enterprise_67890": {
29 | "catalogImages": {
30 | "$parent": "file_50427290",
31 | "$version": 2,
32 | "$template": "catalogImages",
33 | "$scope": "enterprise_67890",
34 | "photographer": "Bob Dylan"
35 | }
36 | }
37 | }
38 | }
39 | ],
40 | "limit": 2,
41 | "next_marker": "0!WkeoDQ3mm5cI_RzSN--UOG1ICuw0gz3729kfhwuoagt54nbv[qmgfhsygreh98nfu94344PpctrcgVa8AMIe7gRwSNBNloVR-XuGmfqTw"
42 | }
43 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/UpdateMetadataTemplate200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "f7a9891f",
3 | "templateKey": "documentFlow03",
4 | "scope": "enterprise",
5 | "displayName": "Document Flow 03",
6 | "hidden": false,
7 | "fields": [
8 | {
9 | "id": "f7a9894f",
10 | "type": "enum",
11 | "key": "fy",
12 | "displayName": "FY",
13 | "options": [
14 | {
15 | "id": "f7a9895f",
16 | "key": "FY16"
17 | },
18 | {
19 | "id": "f7a9896f",
20 | "key": "FY17"
21 | }
22 | ]
23 | }
24 | ],
25 | "copyInstanceOnItemCopy": true
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxMetadataTemplate/UpdateMetadataTemplateWithStaticConfig200.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "id": "f7a9891f",
4 | "templateKey": "documentFlow03",
5 | "scope": "enterprise",
6 | "displayName": "Document Flow 03",
7 | "hidden": false,
8 | "fields": [
9 | {
10 | "type": "enum",
11 | "key": "Box__Security__Classification__Key",
12 | "displayName": "Classification",
13 | "hidden": false,
14 | "options": [
15 | {
16 | "key": "Classified",
17 | "staticConfig": {
18 | "classification": {
19 | "colorID": 4,
20 | "classificationDefinition": "Top Seret"
21 | }
22 | }
23 | }
24 | ]
25 | }
26 | ],
27 | "copyInstanceOnItemCopy": true
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/CreateRetentionPolicy201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "retention_policy",
3 | "id": "12345",
4 | "policy_name": "Test Retention Policy",
5 | "policy_type": "indefinite",
6 | "retention_length": "indefinite",
7 | "disposition_action": "remove_retention",
8 | "can_owner_extend_retention": false,
9 | "status": "active",
10 | "are_owners_notified": false,
11 | "custom_notification_recipients": [],
12 | "assignment_counts": {
13 | "enterprise": 0,
14 | "folder": 0,
15 | "metadata_template": 0
16 | },
17 | "created_by": {
18 | "type": "user",
19 | "id": "1111",
20 | "name": "Test User",
21 | "login": "test@user.com"
22 | },
23 | "created_at": "2018-04-23T10:17:14-07:00",
24 | "modified_at": "2018-04-23T10:17:14-07:00",
25 | "description": "description",
26 | "retention_type": "modifiable"
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/CreateRetentionPolicyAssignmentForEnterprise201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "retention_policy_assignment",
3 | "id": "12345",
4 | "retention_policy": {
5 | "type": "retention_policy",
6 | "id": "1111",
7 | "policy_name": "A Retention Policy"
8 | },
9 | "assigned_to": {
10 | "type": "enterprise",
11 | "id": "2222"
12 | },
13 | "filter_fields": [],
14 | "assigned_by": {
15 | "type": "user",
16 | "id": "3333",
17 | "name": "Test User",
18 | "login": "test@user.com"
19 | },
20 | "assigned_at": "2018-04-23T12:37:36-07:00",
21 | "start_date_field": "upload_date"
22 | }
23 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/CreateRetentionPolicyAssignmentForMetadataTemplate201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "retention_policy_assignment",
3 | "id": "12345",
4 | "retention_policy": {
5 | "type": "retention_policy",
6 | "id": "1111",
7 | "policy_name": "A Retention Policy",
8 | "retention_length": "30",
9 | "disposition_action": "remove_retention"
10 | },
11 | "assigned_to": {
12 | "type": "metadata_template",
13 | "id": "c5c3a90a-7530-44c9-a47a-e522473a8d06"
14 | },
15 | "filter_fields": [],
16 | "assigned_by": {
17 | "type": "user",
18 | "id": "3333",
19 | "name": "Test User",
20 | "login": "test@user.com"
21 | },
22 | "assigned_at": "2021-12-16T10:37:10-08:00",
23 | "start_date_field": "68144df9-597b-4ccb-b1ca-b981eaa321c4"
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/CreateRetentionPolicyAssignmentForMetadataTemplateWithoutStartDateField201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "retention_policy_assignment",
3 | "id": "12345",
4 | "retention_policy": {
5 | "type": "retention_policy",
6 | "id": "1111",
7 | "policy_name": "A Retention Policy",
8 | "retention_length": "30",
9 | "disposition_action": "remove_retention"
10 | },
11 | "assigned_to": {
12 | "type": "metadata_template",
13 | "id": "c5c3a90a-7530-44c9-a47a-e522473a8d06"
14 | },
15 | "filter_fields": [],
16 | "assigned_by": {
17 | "type": "user",
18 | "id": "3333",
19 | "name": "Test User",
20 | "login": "test@user.com"
21 | },
22 | "assigned_at": "2021-12-16T10:37:10-08:00",
23 | "start_date_field": "upload_date"
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetAllFileVersionRetentions200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "file_version_retention",
5 | "id": "12345"
6 | },
7 | {
8 | "type": "file_version_retention",
9 | "id": "32442"
10 | }
11 | ],
12 | "limit": 100,
13 | "next_marker": "eyJ0eXBlIjoiZmlsZV92ZXJzaW9uX2lkIiwiZGlyIjoibmV4dCIsInRhaWwiOiIyODcwNzUyNjY2NDEifQ",
14 | "order": [
15 | {
16 | "by": "file_version_id",
17 | "direction": "ASC"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetAllRetentionPolicies200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "retention_policy",
5 | "disposition_action": "remove_retention",
6 | "id": "12345",
7 | "policy_name": "A Retention Policy",
8 | "retention_length": "30"
9 | },
10 | {
11 | "type": "retention_policy",
12 | "disposition_action": "permanently_delete",
13 | "id": "32421",
14 | "policy_name": "A Retention Policy 2",
15 | "retention_length": "1"
16 | }
17 | ],
18 | "limit": 1000
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetAllRetentionPolicyAssignments200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "retention_policy_assignment",
5 | "id": "12345"
6 | },
7 | {
8 | "type": "retention_policy_assignment",
9 | "id": "42342"
10 | }
11 | ],
12 | "limit": 1000
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetFileRetentionInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file_version_retention",
3 | "id": "12345",
4 | "applied_at": "2018-02-28T18:03:31-08:00",
5 | "disposition_at": "2106-02-06T22:28:15-08:00",
6 | "winning_retention_policy": {
7 | "type": "retention_policy",
8 | "id": "1111",
9 | "policy_name": "test2"
10 | },
11 | "file_version": {
12 | "type": "file_version",
13 | "id": "2222",
14 | "sha1": null
15 | },
16 | "file": {
17 | "type": "file",
18 | "id": "3333",
19 | "etag": "1"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetFileVersionsUnderRetention200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "id": "123456",
5 | "etag": "1",
6 | "type": "file_version",
7 | "sequence_id": "3",
8 | "name": "Contract.pdf",
9 | "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
10 | "file_version": {
11 | "id": "1234567",
12 | "type": "file_version",
13 | "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
14 | },
15 | "applied_at": "2012-12-12T10:53:43-08:00"
16 | }
17 | ],
18 | "limit": 1000,
19 | "marker": "SomeMarker"
20 | }
21 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetFilesUnderRetention200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "id": "12345",
5 | "etag": "1",
6 | "type": "file",
7 | "sequence_id": "3",
8 | "name": "Contract.pdf",
9 | "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
10 | "file_version": {
11 | "id": "123456",
12 | "type": "file_version",
13 | "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
14 | },
15 | "applied_at": "2012-12-12T10:53:43-08:00"
16 | }
17 | ],
18 | "limit": 1000,
19 | "marker": "some marker"
20 | }
21 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetRetentionPolicyAssignment200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "retention_policy_assignment",
5 | "id": "12345"
6 | }
7 | ],
8 | "limit": 1000
9 | }
10 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetRetentionPolicyAssignmentInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "retention_policy_assignment",
3 | "id": "12345",
4 | "retention_policy": {
5 | "type": "retention_policy",
6 | "id": "1111",
7 | "policy_name": "A Retention Policy"
8 | },
9 | "assigned_to": {
10 | "type": "enterprise",
11 | "id": "2222"
12 | },
13 | "filter_fields": [],
14 | "assigned_by": {
15 | "type": "user",
16 | "id": "3333",
17 | "name": "Test User",
18 | "login": "test@user.com"
19 | },
20 | "assigned_at": "2018-04-23T12:37:36-07:00",
21 | "start_date_field": "upload_date"
22 | }
23 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/GetRetentionPolicyInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "retention_policy",
3 | "id": "12345",
4 | "policy_name": "A Retention Policy",
5 | "policy_type": "finite",
6 | "retention_length": "2",
7 | "disposition_action": "remove_retention",
8 | "can_owner_extend_retention": true,
9 | "status": "active",
10 | "are_owners_notified": true,
11 | "custom_notification_recipients": [],
12 | "assignment_counts": {
13 | "enterprise": 0,
14 | "folder": 0,
15 | "metadata_template": 0
16 | },
17 | "created_by": {
18 | "type": "user",
19 | "id": "1111",
20 | "name": "Test User",
21 | "login": "test@user.com"
22 | },
23 | "created_at": "2018-04-09T15:16:39-07:00",
24 | "modified_at": "2018-04-09T15:16:39-07:00",
25 | "description": "description",
26 | "retention_type": "non_modifiable"
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxRetentionPolicy/UpdateRetentionPolicyInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "retention_policy",
3 | "id": "12345",
4 | "policy_name": "New Policy Name",
5 | "policy_type": "finite",
6 | "retention_length": "44",
7 | "disposition_action": "remove_retention",
8 | "can_owner_extend_retention": false,
9 | "status": "retired",
10 | "are_owners_notified": false,
11 | "custom_notification_recipients": [],
12 | "assignment_counts": {
13 | "enterprise": 0,
14 | "folder": 0,
15 | "metadata_template": 0
16 | },
17 | "created_by": {
18 | "type": "user",
19 | "id": "1111",
20 | "name": "Test User",
21 | "login": "test@user.com"
22 | },
23 | "created_at": "2018-04-23T10:17:14-07:00",
24 | "modified_at": "2018-04-23T11:07:29-07:00",
25 | "description": "updated description",
26 | "retention_type": "non_modifiable"
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxSharedLink/CreateEditableSharedLink201.json:
--------------------------------------------------------------------------------
1 | {
2 | "shared_link": {
3 | "url": "https://testt3t2t2t2.box.com/s/12345",
4 | "download_url": "https://testt3t2t2t2.box.com/shared/static/12345.png",
5 | "vanity_url": null,
6 | "effective_access": "open",
7 | "effective_permission": "can_download",
8 | "is_password_enabled": true,
9 | "unshared_at": null,
10 | "download_count": 0,
11 | "preview_count": 0,
12 | "access": "open",
13 | "permissions": {
14 | "can_preview": true,
15 | "can_download": true,
16 | "can_edit": true
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxSharedLink/CreateSharedLink201.json:
--------------------------------------------------------------------------------
1 | {
2 | "shared_link": {
3 | "url": "https://testt3t2t2t2.box.com/s/12345",
4 | "download_url": "https://testt3t2t2t2.box.com/shared/static/12345.png",
5 | "vanity_url": null,
6 | "effective_access": "open",
7 | "effective_permission": "can_download",
8 | "is_password_enabled": true,
9 | "unshared_at": null,
10 | "download_count": 0,
11 | "preview_count": 0,
12 | "access": "open"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxStoragePolicy/Get_A_Storage_Policy_200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "storage_policy",
3 | "id": "11",
4 | "name": "AWS Frankfurt / AWS Dublin with in region Uploads/Downloads/Previews"
5 | }
6 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxStoragePolicy/Get_All_Storage_Policies_200.json:
--------------------------------------------------------------------------------
1 | {
2 | "next_marker": null,
3 | "limit": 1000,
4 | "entries": [
5 | {
6 | "type": "storage_policy",
7 | "id": "11",
8 | "name": "AWS Montreal / AWS Dublin"
9 | },
10 | {
11 | "type": "storage_policy",
12 | "id": "22",
13 | "name": "AWS Frankfurt / AWS Dublin with in region Uploads/Downloads/Previews"
14 | },
15 | {
16 | "type": "storage_policy",
17 | "id": "33",
18 | "name": "US"
19 | }
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxStoragePolicy/Get_Storage_Policy_Assignments_200.json:
--------------------------------------------------------------------------------
1 | {
2 | "next_marker": null,
3 | "limit": 1,
4 | "entries": [
5 | {
6 | "type": "storage_policy_assignment",
7 | "id": "12345",
8 | "storage_policy": {
9 | "type": "storage_policy",
10 | "id": "11"
11 | },
12 | "assigned_to": {
13 | "type": "enterprise",
14 | "id": "22"
15 | }
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/CreateATaskWithActionComplete200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "1111",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "304867920258",
10 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
11 | },
12 | "sequence_id": "2",
13 | "etag": "2",
14 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
15 | "name": "Sample.pdf"
16 | },
17 | "due_at": null,
18 | "action": "complete",
19 | "message": "New Message",
20 | "completion_rule": "all_assignees",
21 | "task_assignment_collection": {
22 | "total_count": 0,
23 | "entries": []
24 | },
25 | "is_completed": false,
26 | "created_by": {
27 | "type": "user",
28 | "id": "2222",
29 | "name": "Test User",
30 | "login": "test@user.com"
31 | },
32 | "created_at": "2018-04-26T17:02:45-07:00"
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/CreateTaskAssignment201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task_assignment",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "22222",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "222220",
10 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223"
11 | },
12 | "sequence_id": "0",
13 | "etag": "0",
14 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223",
15 | "name": "Copied file.txt"
16 | },
17 | "assigned_to": {
18 | "type": "user",
19 | "id": "33333",
20 | "name": "Test User",
21 | "login": "testuser@example.com"
22 | },
23 | "message": "",
24 | "completed_at": null,
25 | "assigned_at": "2018-04-26T19:12:18-07:00",
26 | "reminded_at": null,
27 | "resolution_state": "incomplete",
28 | "assigned_by": {
29 | "type": "user",
30 | "id": "33333",
31 | "name": "Test User",
32 | "login": "testuser@example.com"
33 | },
34 | "status": "incomplete"
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/CreateTaskOnFile201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "1111",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "304867920258",
10 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
11 | },
12 | "sequence_id": "2",
13 | "etag": "2",
14 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
15 | "name": "Sample.pdf"
16 | },
17 | "due_at": null,
18 | "action": "review",
19 | "message": "Please Review",
20 | "completion_rule": "all_assignees",
21 | "task_assignment_collection": {
22 | "total_count": 0,
23 | "entries": []
24 | },
25 | "is_completed": false,
26 | "created_by": {
27 | "type": "user",
28 | "id": "11111",
29 | "name": "Test User",
30 | "login": "test@user.com"
31 | },
32 | "created_at": "2018-04-26T17:02:45-07:00"
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/GetATaskOnFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "1111",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "304867920258",
10 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
11 | },
12 | "sequence_id": "2",
13 | "etag": "2",
14 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
15 | "name": "Sample.pdf"
16 | },
17 | "due_at": null,
18 | "action": "review",
19 | "message": "Please Review",
20 | "task_assignment_collection": {
21 | "total_count": 0,
22 | "entries": []
23 | },
24 | "is_completed": false,
25 | "created_by": {
26 | "type": "user",
27 | "id": "2222",
28 | "name": "Test User",
29 | "login": "test@user.com"
30 | },
31 | "created_at": "2018-04-26T17:02:45-07:00"
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/GetAllTaskAssignments200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "task_assignment",
6 | "id": "12345",
7 | "item": {
8 | "type": "file",
9 | "id": "22222",
10 | "file_version": {
11 | "type": "file_version",
12 | "id": "222220",
13 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223"
14 | },
15 | "sequence_id": "0",
16 | "etag": "0",
17 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223",
18 | "name": "Copied file.txt"
19 | },
20 | "assigned_to": {
21 | "type": "user",
22 | "id": "33333",
23 | "name": "Test User",
24 | "login": "testuser@example.com"
25 | }
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/GetAllTasksOnFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "task",
6 | "id": "12345",
7 | "item": {
8 | "type": "file",
9 | "id": "1111",
10 | "file_version": {
11 | "type": "file_version",
12 | "id": "304867920258",
13 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
14 | },
15 | "sequence_id": "2",
16 | "etag": "2",
17 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
18 | "name": "Sample.pdf"
19 | },
20 | "due_at": "2019-05-01T00:00:00Z"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/GetStatusOnTaskAssignment200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task_assignment",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "11111",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "22222",
10 | "sha1": "8d0988e6ea5b310c529df6a8dcf3066815c6d218"
11 | },
12 | "sequence_id": "1",
13 | "etag": "1",
14 | "sha1": "8d0988e6ea5b310c529df6a8dcf3066815c6d218",
15 | "name": "test.jpg"
16 | },
17 | "assigned_to": {
18 | "type": "user",
19 | "id": "33333",
20 | "name": "Test User",
21 | "login": "test@example.com"
22 | },
23 | "message": "",
24 | "completed_at": null,
25 | "assigned_at": "2018-07-10T13:24:06-07:00",
26 | "reminded_at": null,
27 | "resolution_state": "incomplete",
28 | "assigned_by": {
29 | "type": "user",
30 | "id": "33333",
31 | "name": "Test User",
32 | "login": "test@example.com"
33 | },
34 | "status": "incomplete"
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/GetTaskAssignment200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task_assignment",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "22222",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "222220",
10 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223"
11 | },
12 | "sequence_id": "0",
13 | "etag": "0",
14 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223",
15 | "name": "Copied file.txt"
16 | },
17 | "assigned_to": {
18 | "type": "user",
19 | "id": "33333",
20 | "name": "Test User",
21 | "login": "testuser@example.com"
22 | },
23 | "message": "",
24 | "completed_at": null,
25 | "assigned_at": "2018-04-26T19:12:18-07:00",
26 | "reminded_at": null,
27 | "resolution_state": "incomplete",
28 | "assigned_by": {
29 | "type": "user",
30 | "id": "33333",
31 | "name": "Test User",
32 | "login": "testuser@example.com"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/GetTaskInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "11111",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "22222",
10 | "sha1": "0bbd79a106c504f99573e3799756debba4c760cd"
11 | },
12 | "sequence_id": "0",
13 | "etag": "0",
14 | "sha1": "0bbd79a106c504f99573e3799756debba4c760cd",
15 | "name": "test_file.txt"
16 | },
17 | "due_at": "2014-04-03T11:09:43-07:00",
18 | "action": "review_random_string",
19 | "message": "Please Review",
20 | "task_assignment_collection": {
21 | "total_count": 0,
22 | "entries": []
23 | },
24 | "is_completed": false,
25 | "created_by": {
26 | "type": "user",
27 | "id": "222222",
28 | "name": "Test User",
29 | "login": "test@user.com"
30 | },
31 | "created_at": "2013-04-03T11:12:54-07:00"
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/UpdateATaskAssignmentInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task_assignment",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "22222",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "222220",
10 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223"
11 | },
12 | "sequence_id": "0",
13 | "etag": "0",
14 | "sha1": "6afc05eae22e994f1c7dd48e58f8895dd9028223",
15 | "name": "Copied file.txt"
16 | },
17 | "assigned_to": {
18 | "type": "user",
19 | "id": "33333",
20 | "name": "Test User",
21 | "login": "testuser@example.com"
22 | },
23 | "message": "Looks good to me!",
24 | "completed_at": "2018-04-26T19:26:23-07:00",
25 | "assigned_at": "2018-04-26T19:12:18-07:00",
26 | "reminded_at": null,
27 | "resolution_state": "completed",
28 | "assigned_by": {
29 | "type": "user",
30 | "id": "33333",
31 | "name": "Test User",
32 | "login": "testuser@example.com"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTask/UpdateATaskInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "task",
3 | "id": "12345",
4 | "item": {
5 | "type": "file",
6 | "id": "1111",
7 | "file_version": {
8 | "type": "file_version",
9 | "id": "304867920258",
10 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27"
11 | },
12 | "sequence_id": "2",
13 | "etag": "2",
14 | "sha1": "7ea91497ad7351d80f3a8439ae3d89dcc2675d27",
15 | "name": "Sample.pdf"
16 | },
17 | "due_at": null,
18 | "action": "review",
19 | "message": "New Message",
20 | "completion_rule": "all_assignees",
21 | "task_assignment_collection": {
22 | "total_count": 0,
23 | "entries": []
24 | },
25 | "is_completed": false,
26 | "created_by": {
27 | "type": "user",
28 | "id": "2222",
29 | "name": "Test User",
30 | "login": "test@user.com"
31 | },
32 | "created_at": "2018-04-26T17:02:45-07:00"
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTermsOfService/GetATermsOfServiceInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "terms_of_service",
3 | "id": "12345",
4 | "status": "disabled",
5 | "enterprise": {
6 | "type": "enterprise",
7 | "id": "1111",
8 | "name": "Test"
9 | },
10 | "tos_type": "managed",
11 | "text": "",
12 | "created_at": "2015-06-03T18:01:29-07:00",
13 | "modified_at": "2018-04-18T17:44:10-07:00"
14 | }
15 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTermsOfService/GetAllTermsOfServices200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 2,
3 | "entries": [
4 | {
5 | "type": "terms_of_service",
6 | "id": "12345",
7 | "status": "disabled",
8 | "enterprise": {
9 | "type": "enterprise",
10 | "id": "1111",
11 | "name": "Test"
12 | },
13 | "tos_type": "managed",
14 | "text": "",
15 | "created_at": "2015-06-03T18:01:29-07:00",
16 | "modified_at": "2018-04-18T17:44:10-07:00"
17 | },
18 | {
19 | "type": "terms_of_service",
20 | "id": "42343",
21 | "status": "disabled",
22 | "enterprise": {
23 | "type": "enterprise",
24 | "id": "2222",
25 | "name": "Test"
26 | },
27 | "tos_type": "external",
28 | "text": "Example Terms Of Service Text.",
29 | "created_at": "2015-06-03T18:01:29-07:00",
30 | "modified_at": "2017-10-25T11:20:45-07:00"
31 | }
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTermsOfService/GetTermsOfServiceForUserStatuses200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "terms_of_service_user_status",
6 | "id": "5678",
7 | "tos": {
8 | "type": "terms_of_service",
9 | "id": "1234"
10 | },
11 | "user": {
12 | "type": "user",
13 | "id": "7777",
14 | "name": "Test User",
15 | "login": "test@example.com"
16 | },
17 | "is_accepted": true,
18 | "created_at": "2015-06-03T18:01:31-07:00",
19 | "modified_at": "2017-11-01T13:39:36-07:00"
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTrash/GetAllTrashItems200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 21,
3 | "entries": [
4 | {
5 | "type": "folder",
6 | "id": "12345",
7 | "sequence_id": "1",
8 | "etag": "1",
9 | "name": "Test Folder"
10 | },
11 | {
12 | "type": "file",
13 | "id": "32343",
14 | "file_version": {
15 | "type": "file_version",
16 | "id": "1111",
17 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49"
18 | },
19 | "sequence_id": "1",
20 | "etag": "1",
21 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49",
22 | "name": "File.pdf"
23 | }
24 | ],
25 | "offset": 0,
26 | "limit": 100,
27 | "order": [
28 | {
29 | "by": "type",
30 | "direction": "ASC"
31 | },
32 | {
33 | "by": "name",
34 | "direction": "ASC"
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTrash/GetAllTrashItemsUsingmarker200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "folder",
5 | "id": "12345",
6 | "sequence_id": "1",
7 | "etag": "1",
8 | "name": "Test Folder"
9 | },
10 | {
11 | "type": "file",
12 | "id": "32343",
13 | "file_version": {
14 | "type": "file_version",
15 | "id": "1111",
16 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49"
17 | },
18 | "sequence_id": "1",
19 | "etag": "1",
20 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49",
21 | "name": "File.pdf"
22 | }
23 | ],
24 | "limit": 500,
25 | "next_marker": "eyJ0eXBlIjoiT3duZWRCeUZpbGUiLCJkaXIiOiJuZXh0IiwidGFpbCI6ImV5SjJhV1YzVTJOdmNHVWlPaUpoYkd3aUxDSnNZWE4wU1dRaU9qazFNRFUwTlRVMU9UZzBNbjAifQ"
26 | }
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTrash/GetTrashedFileItemInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "file_version": {
5 | "type": "file_version",
6 | "id": "259642100187",
7 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49"
8 | },
9 | "sequence_id": "1",
10 | "etag": "1",
11 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49",
12 | "name": "File.pdf",
13 | "description": "",
14 | "size": 60023,
15 | "path_collection": {
16 | "total_count": 1,
17 | "entries": [
18 | {
19 | "type": "folder",
20 | "id": "1",
21 | "sequence_id": null,
22 | "etag": null,
23 | "name": "Trash"
24 | }
25 | ]
26 | },
27 | "created_at": "2017-11-09T16:26:51-08:00",
28 | "modified_at": "2018-04-09T13:22:31-07:00",
29 | "trashed_at": "2018-04-09T13:14:44-07:00",
30 | "purged_at": null,
31 | "content_created_at": "2017-10-18T18:53:51-07:00",
32 | "content_modified_at": "2017-10-18T18:53:51-07:00",
33 | "created_by": {
34 | "type": "user",
35 | "id": "1111",
36 | "name": "Test User",
37 | "login": "test@user.com"
38 | },
39 | "modified_by": {
40 | "type": "user",
41 | "id": "1111",
42 | "name": "Test User",
43 | "login": "test@user.com"
44 | },
45 | "owned_by": {
46 | "type": "user",
47 | "id": "1111",
48 | "name": "Test User",
49 | "login": "test@user.com"
50 | },
51 | "shared_link": null,
52 | "parent": {
53 | "type": "folder",
54 | "id": "41708454327",
55 | "sequence_id": "0",
56 | "etag": "0",
57 | "name": "sdk_test"
58 | },
59 | "item_status": "trashed"
60 | }
61 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTrash/GetTrashedFolderItemInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "folder",
3 | "id": "12345",
4 | "sequence_id": "1",
5 | "etag": "1",
6 | "name": "Another retention test",
7 | "created_at": "2018-04-09T14:37:57-07:00",
8 | "modified_at": "2018-04-09T14:38:32-07:00",
9 | "description": "",
10 | "size": 438370,
11 | "path_collection": {
12 | "total_count": 1,
13 | "entries": [
14 | {
15 | "type": "folder",
16 | "id": "1",
17 | "sequence_id": null,
18 | "etag": null,
19 | "name": "Trash"
20 | }
21 | ]
22 | },
23 | "created_by": {
24 | "type": "user",
25 | "id": "1111",
26 | "name": "Test User",
27 | "login": "test@user.com"
28 | },
29 | "modified_by": {
30 | "type": "user",
31 | "id": "1111",
32 | "name": "Test User",
33 | "login": "test@user.com"
34 | },
35 | "trashed_at": "2018-04-09T17:15:43-07:00",
36 | "purged_at": "2018-05-09T17:15:43-07:00",
37 | "content_created_at": "2018-04-09T14:37:57-07:00",
38 | "content_modified_at": "2018-04-09T14:38:32-07:00",
39 | "owned_by": {
40 | "type": "user",
41 | "id": "1111",
42 | "name": "Test User",
43 | "login": "test@user.com"
44 | },
45 | "shared_link": null,
46 | "folder_upload_email": null,
47 | "parent": {
48 | "type": "folder",
49 | "id": "0",
50 | "sequence_id": null,
51 | "etag": null,
52 | "name": "All Files"
53 | },
54 | "item_status": "trashed"
55 | }
56 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTrash/RestoreFileItemFromTrash201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "file",
3 | "id": "12345",
4 | "file_version": {
5 | "type": "file_version",
6 | "id": "259642100187",
7 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49"
8 | },
9 | "sequence_id": "2",
10 | "etag": "2",
11 | "sha1": "83348a9c7c6772d3c2b836adf16772ccd3545f49",
12 | "name": "File.pdf",
13 | "description": "",
14 | "size": 60023,
15 | "path_collection": {
16 | "total_count": 2,
17 | "entries": [
18 | {
19 | "type": "folder",
20 | "id": "0",
21 | "sequence_id": null,
22 | "etag": null,
23 | "name": "All Files"
24 | },
25 | {
26 | "type": "folder",
27 | "id": "1111",
28 | "sequence_id": "0",
29 | "etag": "0",
30 | "name": "Test Folder"
31 | }
32 | ]
33 | },
34 | "created_at": "2017-11-09T16:26:51-08:00",
35 | "modified_at": "2018-04-09T13:22:31-07:00",
36 | "trashed_at": null,
37 | "purged_at": null,
38 | "content_created_at": "2017-10-18T18:53:51-07:00",
39 | "content_modified_at": "2017-10-18T18:53:51-07:00",
40 | "created_by": {
41 | "type": "user",
42 | "id": "2222",
43 | "name": "Test User",
44 | "login": "test@user.com"
45 | },
46 | "modified_by": {
47 | "type": "user",
48 | "id": "2222",
49 | "name": "Test User",
50 | "login": "test@user.com"
51 | },
52 | "owned_by": {
53 | "type": "user",
54 | "id": "2222",
55 | "name": "Test User",
56 | "login": "test@user.com"
57 | },
58 | "shared_link": null,
59 | "parent": {
60 | "type": "folder",
61 | "id": "1111",
62 | "sequence_id": "0",
63 | "etag": "0",
64 | "name": "Test Folder"
65 | },
66 | "item_status": "active"
67 | }
68 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxTrash/RestoreFolderItemFromTrash201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "folder",
3 | "id": "12345",
4 | "sequence_id": "2",
5 | "etag": "2",
6 | "name": "Test Folder",
7 | "created_at": "2018-04-09T14:37:57-07:00",
8 | "modified_at": "2018-04-09T14:38:32-07:00",
9 | "description": "",
10 | "size": 438370,
11 | "path_collection": {
12 | "total_count": 1,
13 | "entries": [
14 | {
15 | "type": "folder",
16 | "id": "0",
17 | "sequence_id": null,
18 | "etag": null,
19 | "name": "All Files"
20 | }
21 | ]
22 | },
23 | "created_by": {
24 | "type": "user",
25 | "id": "1111",
26 | "name": "Test User",
27 | "login": "test@user.com"
28 | },
29 | "modified_by": {
30 | "type": "user",
31 | "id": "1111",
32 | "name": "Test User",
33 | "login": "test@user.com"
34 | },
35 | "trashed_at": null,
36 | "purged_at": null,
37 | "content_created_at": "2018-04-09T14:37:57-07:00",
38 | "content_modified_at": "2018-04-09T14:38:32-07:00",
39 | "owned_by": {
40 | "type": "user",
41 | "id": "1111",
42 | "name": "Test User",
43 | "login": "test@user.com"
44 | },
45 | "shared_link": null,
46 | "folder_upload_email": null,
47 | "parent": {
48 | "type": "folder",
49 | "id": "0",
50 | "sequence_id": null,
51 | "etag": null,
52 | "name": "All Files"
53 | },
54 | "item_status": "active"
55 | }
56 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/CreateAppUser201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "name": "Java SDK App User",
5 | "login": "testuser@boxdevedition.com",
6 | "created_at": "2018-04-25T13:51:04-07:00",
7 | "modified_at": "2018-04-25T13:51:04-07:00",
8 | "language": "en",
9 | "timezone": "America/Los_Angeles",
10 | "space_amount": 10737418240,
11 | "space_used": 0,
12 | "max_upload_size": 16106127360,
13 | "status": "active",
14 | "job_title": "",
15 | "phone": "",
16 | "address": "",
17 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345"
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/CreateEmailAlias201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "email_alias",
3 | "id": "12345",
4 | "is_confirmed": true,
5 | "email": "test@user.com"
6 | }
7 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/CreateManagedUser201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "name": "Test Managed User",
5 | "login": "test@user.com",
6 | "created_at": "2018-04-25T14:28:20-07:00",
7 | "modified_at": "2018-04-25T14:28:20-07:00",
8 | "language": "en",
9 | "timezone": "America/Los_Angeles",
10 | "space_amount": 10737418240,
11 | "space_used": 0,
12 | "max_upload_size": 16106127360,
13 | "status": "active",
14 | "job_title": "",
15 | "phone": "",
16 | "address": "",
17 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345"
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/CreateTrackingCodes200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "tracking_codes": [
5 | {
6 | "type": "tracking_code",
7 | "name": "Employee ID",
8 | "value": "12345"
9 | },
10 | {
11 | "type": "tracking_code",
12 | "name": "Department ID",
13 | "value": "8675"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetAllEnterpriseUsers200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 111,
3 | "entries": [
4 | {
5 | "type": "user",
6 | "id": "12345",
7 | "name": "Test User",
8 | "login": "test@user.com",
9 | "created_at": "2015-06-02T11:08:09-07:00",
10 | "modified_at": "2015-06-02T11:08:09-07:00",
11 | "language": "en",
12 | "timezone": "America/Los_Angeles",
13 | "space_amount": 10737418240,
14 | "space_used": 0,
15 | "max_upload_size": 16106127360,
16 | "status": "active",
17 | "job_title": "",
18 | "phone": "",
19 | "address": "",
20 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345"
21 | },
22 | {
23 | "type": "user",
24 | "id": "43242",
25 | "name": "Example User",
26 | "login": "example@user.com",
27 | "created_at": "2016-09-20T10:58:18-07:00",
28 | "modified_at": "2017-11-27T13:30:53-08:00",
29 | "language": "en",
30 | "timezone": "America/Los_Angeles",
31 | "space_amount": 10737418240,
32 | "space_used": 0,
33 | "max_upload_size": 16106127360,
34 | "status": "active",
35 | "job_title": "",
36 | "phone": "",
37 | "address": "",
38 | "avatar_url": "https://test.app.box.com/api/avatar/large/43242"
39 | }
40 | ],
41 | "limit": 100,
42 | "offset": 0
43 | }
44 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetAllEnterpriseUsersMarkerPagination200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "type": "user",
5 | "id": "12345",
6 | "name": "Test User",
7 | "login": "test@user.com",
8 | "created_at": "2015-06-02T11:08:09-07:00",
9 | "modified_at": "2015-06-02T11:08:09-07:00",
10 | "language": "en",
11 | "timezone": "America/Los_Angeles",
12 | "space_amount": 10737418240,
13 | "space_used": 0,
14 | "max_upload_size": 16106127360,
15 | "status": "active",
16 | "job_title": "",
17 | "phone": "",
18 | "address": "",
19 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345"
20 | },
21 | {
22 | "type": "user",
23 | "id": "43242",
24 | "name": "Example User",
25 | "login": "example@user.com",
26 | "created_at": "2016-09-20T10:58:18-07:00",
27 | "modified_at": "2017-11-27T13:30:53-08:00",
28 | "language": "en",
29 | "timezone": "America/Los_Angeles",
30 | "space_amount": 10737418240,
31 | "space_used": 0,
32 | "max_upload_size": 16106127360,
33 | "status": "active",
34 | "job_title": "",
35 | "phone": "",
36 | "address": "",
37 | "avatar_url": "https://test.app.box.com/api/avatar/large/43242"
38 | }
39 | ],
40 | "limit": 100,
41 | "next_marker": "eyJ0eXBlIWQiLfdsebwOiJuZXh0IiwidGFpbCI6IjEwOTMxOTE4MDc2In0"
42 | }
43 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetCurrentUserInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "name": "Test User",
5 | "login": "test@user.com",
6 | "created_at": "2015-04-09T12:32:40-07:00",
7 | "modified_at": "2018-04-25T11:00:20-07:00",
8 | "language": "en",
9 | "timezone": "America/Los_Angeles",
10 | "space_amount": 1000000000000000,
11 | "space_used": 22392578035,
12 | "max_upload_size": 16106127360,
13 | "status": "active",
14 | "job_title": "",
15 | "phone": "1111111111",
16 | "address": "",
17 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345",
18 | "notification_email": {
19 | "email": "notifications@example.com",
20 | "is_confirmed": true
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetCurrentUserInfoWithNoNotifcationEmail200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "name": "Test User",
5 | "login": "test@user.com",
6 | "created_at": "2015-04-09T12:32:40-07:00",
7 | "modified_at": "2018-04-25T11:00:20-07:00",
8 | "language": "en",
9 | "timezone": "America/Los_Angeles",
10 | "space_amount": 1000000000000000,
11 | "space_used": 22392578035,
12 | "max_upload_size": 16106127360,
13 | "status": "active",
14 | "job_title": "",
15 | "phone": "1111111111",
16 | "address": "",
17 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345",
18 | "notification_email": []
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetUserEmailAlias200.json:
--------------------------------------------------------------------------------
1 | {
2 | "total_count": 1,
3 | "entries": [
4 | {
5 | "type": "email_alias",
6 | "id": "12345",
7 | "is_confirmed": true,
8 | "email": "test@user.com"
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetUserInfoCausesDeserializationException.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "name": "Test User",
5 | "login": "test@user.com",
6 | "created_at": "2015-04-09T12:32:40-07:00",
7 | "modified_at": "2018-04-25T11:00:20-07:00",
8 | "language": "en",
9 | "timezone": "America/Los_Angeles",
10 | "space_amount": 1000000000000000,
11 | "space_used": 22392578035,
12 | "max_upload_size": 16106127360,
13 | "status": "active",
14 | "job_title": "",
15 | "phone": 11111111,
16 | "address": "",
17 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345"
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetUserThreeTrackingCodes200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "tracking_codes": [
5 | {
6 | "type": "tracking_code",
7 | "name": "Employee ID",
8 | "value": "12345"
9 | },
10 | {
11 | "type": "tracking_code",
12 | "name": "Department ID",
13 | "value": "8675"
14 | },
15 | {
16 | "type": "tracking_code",
17 | "name": "Company ID",
18 | "value": "1701"
19 | }
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/GetUserTwoTrackingCodes200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "tracking_codes": [
5 | {
6 | "type": "tracking_code",
7 | "name": "Employee ID",
8 | "value": "12345"
9 | },
10 | {
11 | "type": "tracking_code",
12 | "name": "Department ID",
13 | "value": "8675"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/UpdateTrackingCodes200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "tracking_codes": [
5 | {
6 | "type": "tracking_code",
7 | "name": "Employee ID",
8 | "value": "12345"
9 | },
10 | {
11 | "type": "tracking_code",
12 | "name": "Department ID",
13 | "value": "8675"
14 | },
15 | {
16 | "type": "tracking_code",
17 | "name": "Company ID",
18 | "value": "1701"
19 | }
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/UpdateUserInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "user",
3 | "id": "12345",
4 | "name": "New User Name",
5 | "login": "new@test.com",
6 | "created_at": "2018-04-25T15:55:05-07:00",
7 | "modified_at": "2018-04-25T15:55:05-07:00",
8 | "language": "en",
9 | "timezone": "America/Los_Angeles",
10 | "space_amount": 10737418240,
11 | "space_used": 0,
12 | "max_upload_size": 16106127360,
13 | "status": "active",
14 | "job_title": "Example Job",
15 | "phone": "650-123-4567",
16 | "address": "Test Address",
17 | "avatar_url": "https://test.app.box.com/api/avatar/large/12345"
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxUser/small_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/Fixtures/BoxUser/small_avatar.png
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWatermark/CreateWatermarkOnFile200.json:
--------------------------------------------------------------------------------
1 | {
2 | "watermark": {
3 | "created_at": "2018-04-24T17:01:11-07:00",
4 | "modified_at": "2018-04-24T17:01:11-07:00"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWatermark/CreateWatermarkOnFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "watermark": {
3 | "created_at": "2018-04-24T16:30:07-07:00",
4 | "modified_at": "2018-04-24T16:30:07-07:00"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWebLink/CreateWebLinkOnFolder201.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "web_link",
3 | "id": "12345",
4 | "sequence_id": "0",
5 | "etag": "0",
6 | "name": "example.com",
7 | "url": "https://example.com",
8 | "created_by": {
9 | "type": "user",
10 | "id": "1111",
11 | "name": "Test User",
12 | "login": "test@user.com"
13 | },
14 | "created_at": "2018-04-24T17:33:40-07:00",
15 | "modified_at": "2018-04-24T17:33:40-07:00",
16 | "parent": {
17 | "type": "folder",
18 | "id": "2222",
19 | "sequence_id": "0",
20 | "etag": "0",
21 | "name": "Test Folder"
22 | },
23 | "description": "This goes to an example page",
24 | "item_status": "active",
25 | "trashed_at": null,
26 | "purged_at": null,
27 | "shared_link": null,
28 | "path_collection": {
29 | "total_count": 2,
30 | "entries": [
31 | {
32 | "type": "folder",
33 | "id": "0",
34 | "sequence_id": null,
35 | "etag": null,
36 | "name": "All Files"
37 | },
38 | {
39 | "type": "folder",
40 | "id": "2222",
41 | "sequence_id": "0",
42 | "etag": "0",
43 | "name": "Test Folder"
44 | }
45 | ]
46 | },
47 | "modified_by": {
48 | "type": "user",
49 | "id": "1111",
50 | "name": "Test User",
51 | "login": "test@user.com"
52 | },
53 | "owned_by": {
54 | "type": "user",
55 | "id": "1111",
56 | "name": "Test User",
57 | "login": "test@user.com"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWebLink/GetWebLinkOnFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "web_link",
3 | "id": "12345",
4 | "sequence_id": "0",
5 | "etag": "0",
6 | "name": "google.com",
7 | "url": "https://example.com",
8 | "created_by": {
9 | "type": "user",
10 | "id": "1111",
11 | "name": "Test User",
12 | "login": "test@user.com"
13 | },
14 | "created_at": "2018-04-24T17:33:40-07:00",
15 | "modified_at": "2018-04-24T17:33:40-07:00",
16 | "parent": {
17 | "type": "folder",
18 | "id": "2222",
19 | "sequence_id": "0",
20 | "etag": "0",
21 | "name": "Example Folder"
22 | },
23 | "description": "",
24 | "item_status": "active",
25 | "trashed_at": null,
26 | "purged_at": null,
27 | "shared_link": null,
28 | "path_collection": {
29 | "total_count": 2,
30 | "entries": [
31 | {
32 | "type": "folder",
33 | "id": "0",
34 | "sequence_id": null,
35 | "etag": null,
36 | "name": "All Files"
37 | },
38 | {
39 | "type": "folder",
40 | "id": "2222",
41 | "sequence_id": "0",
42 | "etag": "0",
43 | "name": "Example Folder"
44 | }
45 | ]
46 | },
47 | "modified_by": {
48 | "type": "user",
49 | "id": "1111",
50 | "name": "Test User",
51 | "login": "test@user.com"
52 | },
53 | "owned_by": {
54 | "type": "user",
55 | "id": "1111",
56 | "name": "Test User",
57 | "login": "test@user.com"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWebLink/UpdateWebLinkOnFolder200.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "web_link",
3 | "id": "12345",
4 | "sequence_id": "1",
5 | "etag": "1",
6 | "name": "example.com",
7 | "url": "https://example.com",
8 | "created_by": {
9 | "type": "user",
10 | "id": "1111",
11 | "name": "Test User",
12 | "login": "test@user.com"
13 | },
14 | "created_at": "2018-04-24T17:33:40-07:00",
15 | "modified_at": "2018-04-27T13:23:04-07:00",
16 | "parent": {
17 | "type": "folder",
18 | "id": "2222",
19 | "sequence_id": "0",
20 | "etag": "0",
21 | "name": "Example Folder"
22 | },
23 | "description": "",
24 | "item_status": "active",
25 | "trashed_at": null,
26 | "purged_at": null,
27 | "shared_link": null,
28 | "path_collection": {
29 | "total_count": 2,
30 | "entries": [
31 | {
32 | "type": "folder",
33 | "id": "0",
34 | "sequence_id": null,
35 | "etag": null,
36 | "name": "All Files"
37 | },
38 | {
39 | "type": "folder",
40 | "id": "2222",
41 | "sequence_id": "0",
42 | "etag": "0",
43 | "name": "Example Folder"
44 | }
45 | ]
46 | },
47 | "modified_by": {
48 | "type": "user",
49 | "id": "1111",
50 | "name": "Test User",
51 | "login": "test@user.com"
52 | },
53 | "owned_by": {
54 | "type": "user",
55 | "id": "1111",
56 | "name": "Test User",
57 | "login": "test@user.com"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWebhook/CreateWebhook201.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "12345",
3 | "type": "webhook",
4 | "target": {
5 | "id": "1111",
6 | "type": "folder"
7 | },
8 | "created_by": {
9 | "type": "user",
10 | "id": "2222",
11 | "name": "Test User",
12 | "login": "test@user.com"
13 | },
14 | "created_at": "2018-04-27T13:52:47-07:00",
15 | "address": "https://example.com",
16 | "triggers": [
17 | "FILE.LOCKED"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWebhook/GetAllWebhooks200.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": [
3 | {
4 | "id": "12345",
5 | "type": "webhook",
6 | "target": {
7 | "id": "1111",
8 | "type": "folder"
9 | }
10 | }
11 | ],
12 | "limit": 100
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWebhook/GetWebhook200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "12345",
3 | "type": "webhook",
4 | "target": {
5 | "id": "1111",
6 | "type": "folder"
7 | },
8 | "created_by": {
9 | "type": "user",
10 | "id": "2222",
11 | "name": "Test User",
12 | "login": "test@user.com"
13 | },
14 | "created_at": "2018-04-27T13:52:47-07:00",
15 | "address": "https://example.com",
16 | "triggers": [
17 | "FILE.LOCKED"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxWebhook/UpdateWebhookInfo200.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "12345",
3 | "type": "webhook",
4 | "target": {
5 | "id": "1111",
6 | "type": "folder"
7 | },
8 | "created_by": {
9 | "type": "user",
10 | "id": "2222",
11 | "name": "Test User",
12 | "login": "test@user.com"
13 | },
14 | "created_at": "2018-04-27T14:42:28-07:00",
15 | "address": "https://newexample.com",
16 | "triggers": [
17 | "FILE.UPLOADED"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/Fixtures/BoxZip/CreateZipFile202.json:
--------------------------------------------------------------------------------
1 | {
2 | "download_url": "https://api.box.com/zip_downloads/124hfiowk3fa8kmrwh/content",
3 | "status_url": "https://api.box.com/zip_downloads/124hfiowk3fa8kmrwh/status",
4 | "expires_at": "2018-04-25T11:00:18-07:00",
5 | "name_conflicts": [
6 | [
7 | {
8 | "id": "100",
9 | "type": "file",
10 | "original_name": "salary.pdf",
11 | "download_name": "aqc823.pdf"
12 | },
13 | {
14 | "id": "200",
15 | "type": "file",
16 | "original_name": "salary.pdf",
17 | "download_name": "aci23s.pdf"
18 | }
19 | ],
20 | [
21 | {
22 | "id": "1000",
23 | "type": "folder",
24 | "original_name": "employees",
25 | "download_name": "3d366a_employees"
26 | },
27 | {
28 | "id": "2000",
29 | "type": "folder",
30 | "original_name": "employees",
31 | "download_name": "3aa6a7_employees"
32 | }
33 | ]
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/config/config.json.template:
--------------------------------------------------------------------------------
1 | {
2 | "boxAppSettings": {
3 | "clientID": "",
4 | "clientSecret": "",
5 | "appAuth": {
6 | "publicKeyID": "",
7 | "privateKey": "",
8 | "passphrase": ""
9 | }
10 | },
11 | "enterpriseID": ""
12 | }
--------------------------------------------------------------------------------
/src/test/config/config.properties.template:
--------------------------------------------------------------------------------
1 | # Remove the .template extension to this file to configure tests. The config.properties file should never be added to
2 | # source control since it may contain sensitive information.
3 |
4 | # Set an auth token for a test account here in order to run integration tests.
5 | accessToken =
6 | refreshToken =
7 | clientID =
8 | clientSecret =
9 | collaborator =
10 | collaboratorID =
11 | enterpriseID =
12 |
13 | # Transactional auth credentials
14 | transactionalAccessToken =
15 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/AcceptAllHostsVerifier.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import javax.net.ssl.HostnameVerifier;
4 | import javax.net.ssl.SSLSession;
5 |
6 | class AcceptAllHostsVerifier implements HostnameVerifier {
7 | @Override
8 | public boolean verify(String hostname, SSLSession session) {
9 | return true;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/BoxAPIConnectionForTests.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import static okhttp3.ConnectionSpec.CLEARTEXT;
4 | import static okhttp3.ConnectionSpec.MODERN_TLS;
5 |
6 | import java.util.Arrays;
7 | import okhttp3.OkHttpClient;
8 |
9 | class BoxAPIConnectionForTests extends BoxAPIConnection {
10 | BoxAPIConnectionForTests(String accessToken) {
11 | super(accessToken);
12 | configureSslCertificatesValidation(new TrustAllTrustManager(), new AcceptAllHostsVerifier());
13 | }
14 |
15 | BoxAPIConnectionForTests(String clientID, String clientSecret, String accessToken, String refreshToken) {
16 | super(clientID, clientSecret, accessToken, refreshToken);
17 | configureSslCertificatesValidation(new TrustAllTrustManager(), new AcceptAllHostsVerifier());
18 | }
19 |
20 | BoxAPIConnectionForTests(String clientID, String clientSecret, String authCode) {
21 | super(clientID, clientSecret, authCode);
22 | configureSslCertificatesValidation(new TrustAllTrustManager(), new AcceptAllHostsVerifier());
23 | }
24 |
25 | BoxAPIConnectionForTests(String clientID, String clientSecret) {
26 | super(clientID, clientSecret);
27 | configureSslCertificatesValidation(new TrustAllTrustManager(), new AcceptAllHostsVerifier());
28 | }
29 |
30 | BoxAPIConnectionForTests(BoxConfig boxConfig) {
31 | super(boxConfig);
32 | configureSslCertificatesValidation(new TrustAllTrustManager(), new AcceptAllHostsVerifier());
33 | }
34 |
35 | @Override
36 | protected OkHttpClient.Builder modifyHttpClientBuilder(OkHttpClient.Builder httpClientBuilder) {
37 | return httpClientBuilder.connectionSpecs(Arrays.asList(MODERN_TLS, CLEARTEXT));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/BoxLoggerTest.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import static org.hamcrest.CoreMatchers.is;
4 | import static org.hamcrest.MatcherAssert.assertThat;
5 | import static org.hamcrest.Matchers.empty;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 | import java.util.logging.Handler;
10 | import java.util.logging.LogRecord;
11 | import org.junit.Test;
12 |
13 | public class BoxLoggerTest {
14 | @Test
15 | public void canAddHandler() {
16 | HandlerForTests handler = new HandlerForTests();
17 | BoxLogger boxLogger = BoxLogger.defaultLogger();
18 |
19 | boxLogger.addHandler(handler);
20 | boxLogger.info("Test");
21 |
22 | LogRecord logRecord = handler.logEntries.get(0);
23 | assertThat(logRecord.getMessage(), is("Test"));
24 | }
25 |
26 | @Test
27 | public void canRemoveHandler() {
28 | HandlerForTests handler = new HandlerForTests();
29 | BoxLogger boxLogger = BoxLogger.defaultLogger();
30 |
31 | boxLogger.addHandler(handler);
32 | boxLogger.removeHandler(handler);
33 | boxLogger.info("Test");
34 |
35 | assertThat(handler.logEntries, empty());
36 | }
37 |
38 | private static final class HandlerForTests extends Handler {
39 | List logEntries = new ArrayList<>();
40 |
41 | @Override
42 | public void publish(LogRecord record) {
43 | logEntries.add(record);
44 | }
45 |
46 | @Override
47 | public void flush() {
48 | }
49 |
50 | @Override
51 | public void close() throws SecurityException {
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/BoxTransactionalAPIConnectionTest.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import org.junit.Test;
4 |
5 | public class BoxTransactionalAPIConnectionTest {
6 | @Test(expected = UnsupportedOperationException.class)
7 | public void attemptingToAuthenticateATransactionalConnectionThrowsError() {
8 | BoxTransactionalAPIConnection transactionalConnection = new BoxTransactionalAPIConnection("accessToken");
9 | transactionalConnection.authenticate("authCode");
10 | }
11 |
12 | @Test(expected = UnsupportedOperationException.class)
13 | public void attemptingToRefreshATransactionalConnectionThrowsError() {
14 | BoxTransactionalAPIConnection transactionalConnection = new BoxTransactionalAPIConnection("accessToken");
15 | transactionalConnection.refresh();
16 | }
17 |
18 | @Test(expected = UnsupportedOperationException.class)
19 | public void attemptingToSetAutoRefreshOnTransactionalConnectionThrowsError() {
20 | BoxTransactionalAPIConnection transactionalConnection = new BoxTransactionalAPIConnection("accessToken");
21 | transactionalConnection.setAutoRefresh(true);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/IntegrationTestJWT.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | /**
4 | * Created by dmaynard on 2/9/17.
5 | */
6 | public interface IntegrationTestJWT {
7 | }
8 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/JSONRequestInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import static org.junit.Assert.fail;
4 |
5 | import com.eclipsesource.json.Json;
6 | import com.eclipsesource.json.JsonObject;
7 | import java.io.BufferedReader;
8 | import java.io.IOException;
9 | import java.io.InputStreamReader;
10 |
11 | public abstract class JSONRequestInterceptor implements RequestInterceptor {
12 | public static RequestInterceptor respondWith(final JsonObject json) {
13 | return new RequestInterceptor() {
14 | @Override
15 | public BoxAPIResponse onRequest(BoxAPIRequest request) {
16 | return new BoxJSONResponse() {
17 | @Override
18 | public String getJSON() {
19 | return json.toString();
20 | }
21 | };
22 | }
23 | };
24 | }
25 |
26 | @Override
27 | public BoxAPIResponse onRequest(BoxAPIRequest request) {
28 | BufferedReader bodyReader = new BufferedReader(new InputStreamReader(request.getBody(),
29 | StandardCharsets.UTF_8));
30 |
31 | JsonObject json = null;
32 | try {
33 | json = Json.parse(bodyReader).asObject();
34 | bodyReader.close();
35 | } catch (IOException e) {
36 | fail(e.getMessage());
37 | }
38 |
39 | return this.onJSONRequest((BoxJSONRequest) request, json);
40 | }
41 |
42 | protected abstract BoxAPIResponse onJSONRequest(BoxJSONRequest request, JsonObject json);
43 | }
44 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/LRUCacheTest.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import static org.hamcrest.MatcherAssert.assertThat;
4 | import static org.hamcrest.Matchers.is;
5 |
6 | import org.junit.Test;
7 |
8 | public class LRUCacheTest {
9 | @Test
10 | public void addReturnsTrueForNewItem() {
11 | LRUCache lru = new LRUCache<>();
12 | boolean added = lru.add(1);
13 |
14 | assertThat(added, is(true));
15 | }
16 |
17 | @Test
18 | public void addReturnsFalseForExistingItem() {
19 | LRUCache lru = new LRUCache<>();
20 | lru.add(1);
21 | boolean added = lru.add(1);
22 |
23 | assertThat(added, is(false));
24 | }
25 |
26 | @Test
27 | public void addRemovesOldestItemWhenMaxSizeIsReached() {
28 | LRUCache lru = new LRUCache<>();
29 |
30 | for (int i = 0; i < LRUCache.MAX_SIZE + 1; i++) {
31 | lru.add(i);
32 | }
33 |
34 | boolean added = lru.add(0);
35 | assertThat(added, is(true));
36 | }
37 |
38 | @Test
39 | public void addMakesExistingItemNewer() {
40 | LRUCache lru = new LRUCache<>();
41 |
42 | for (int i = 0; i < LRUCache.MAX_SIZE; i++) {
43 | lru.add(i);
44 | }
45 |
46 | lru.add(0);
47 | lru.add(LRUCache.MAX_SIZE + 1);
48 | boolean added = lru.add(1);
49 | assertThat(added, is(true));
50 | }
51 |
52 | @Test
53 | public void addReturnsFalseForExistingItemMultipleTimes() {
54 | LRUCache lru = new LRUCache<>();
55 | lru.add(1);
56 | lru.add(1);
57 | boolean added = lru.add(1);
58 |
59 | assertThat(added, is(false));
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/SortParametersTest.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 |
4 | import static org.hamcrest.MatcherAssert.assertThat;
5 | import static org.hamcrest.Matchers.is;
6 |
7 | import org.junit.Test;
8 |
9 | public class SortParametersTest {
10 | @Test
11 | public void returnsAsQueryStringBuilderForAscendingSorting() {
12 | SortParameters sortParameters = SortParameters.ascending("field_123");
13 |
14 | QueryStringBuilder queryStringBuilder = sortParameters.asQueryStringBuilder();
15 | assertThat(queryStringBuilder.toString(), is("?sort=field_123&direction=ASC"));
16 | }
17 |
18 | @Test
19 | public void returnsAsQueryStringBuilderForDescendingSorting() {
20 | SortParameters sortParameters = SortParameters.descending("field_123");
21 |
22 | QueryStringBuilder queryStringBuilder = sortParameters.asQueryStringBuilder();
23 | assertThat(queryStringBuilder.toString(), is("?sort=field_123&direction=DESC"));
24 | }
25 |
26 | @Test
27 | public void returnEmptySortParameters() {
28 | SortParameters sortParameters = SortParameters.none();
29 |
30 | QueryStringBuilder queryStringBuilder = sortParameters.asQueryStringBuilder();
31 | assertThat(queryStringBuilder.toString(), is(""));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/TestUtils.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.FileReader;
5 | import java.io.IOException;
6 |
7 |
8 | final class TestUtils {
9 |
10 | private TestUtils() {
11 | }
12 |
13 | public static BoxAPIConnection getAPIConnection() {
14 | return new BoxAPIConnectionForTests("");
15 | }
16 |
17 | /**
18 | * Util function to help get JSON fixtures for tests.
19 | */
20 | public static String getFixture(String fixtureName) {
21 | String fixtureFullPath = "./src/test/Fixtures/" + fixtureName + ".json";
22 | try (BufferedReader reader = new BufferedReader(new FileReader(fixtureFullPath))) {
23 | StringBuilder builder = new StringBuilder();
24 | String line = reader.readLine();
25 |
26 | while (line != null) {
27 | builder.append(line);
28 | builder.append("\n");
29 | line = reader.readLine();
30 | }
31 | return builder.toString();
32 | } catch (IOException e) {
33 | throw new RuntimeException(e);
34 | }
35 | }
36 |
37 | /**
38 | * Util function to help get JSON fixtures for tests.
39 | */
40 | public static String getFixture(String fixtureName, int portNumber) {
41 | String fixture = getFixture(fixtureName);
42 | return fixture.replaceAll(":53621", ":" + portNumber);
43 | }
44 |
45 | public static BoxAPIConnection createConnectionWith(String baseUrl) {
46 | BoxAPIConnection connection = TestUtils.getAPIConnection();
47 | connection.setBaseURL(baseUrl);
48 | return connection;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/TrustAllTrustManager.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk;
2 |
3 | import javax.net.ssl.X509TrustManager;
4 |
5 | class TrustAllTrustManager implements X509TrustManager {
6 | @Override
7 | public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
8 | }
9 |
10 | @Override
11 | public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {
12 | }
13 |
14 | @Override
15 | public java.security.cert.X509Certificate[] getAcceptedIssuers() {
16 | return new java.security.cert.X509Certificate[]{};
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/java/com/box/sdk/internal/utils/CollectionUtilsTest.java:
--------------------------------------------------------------------------------
1 | package com.box.sdk.internal.utils;
2 |
3 | import java.util.Arrays;
4 | import org.junit.Assert;
5 | import org.junit.Test;
6 |
7 |
8 | /**
9 | * Unit tests for {@link CollectionUtils}.
10 | */
11 | public class CollectionUtilsTest {
12 |
13 | /**
14 | * Unit tests for {@link CollectionUtils#map(java.util.Collection, com.box.sdk.utils.CollectionUtils.Mapper)}.
15 | */
16 | @Test
17 | public void testMap() {
18 | Integer[] expected = new Integer[]{1, 2};
19 | Integer[] actual = CollectionUtils.map(Arrays.asList(expected), new CollectionUtils.Mapper() {
20 |
21 | @Override
22 | public Integer map(Integer input) {
23 | return input + 1;
24 | }
25 |
26 | }).toArray(new Integer[2]);
27 |
28 | Assert.assertEquals(2, actual.length);
29 | Assert.assertEquals((Integer) (expected[0] + 1), actual[0]);
30 | Assert.assertEquals((Integer) (expected[1] + 1), actual[1]);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/sample-files/empty_file:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/resources/sample-files/empty_file
--------------------------------------------------------------------------------
/src/test/resources/sample-files/file_to_sign.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/resources/sample-files/file_to_sign.pdf
--------------------------------------------------------------------------------
/src/test/resources/sample-files/file_to_sign2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/resources/sample-files/file_to_sign2.pdf
--------------------------------------------------------------------------------
/src/test/resources/sample-files/red_100x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/resources/sample-files/red_100x100.png
--------------------------------------------------------------------------------
/src/test/resources/sample-files/rep_content.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/resources/sample-files/rep_content.pdf
--------------------------------------------------------------------------------
/src/test/resources/sample-files/small_file.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3 | {\colortbl;\red255\green255\blue255;}
4 | {\*\expandedcolortbl;;}
5 | \margl1440\margr1440\vieww10800\viewh8400\viewkind0
6 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
7 |
8 | \f0\fs24 \cf0 Small test file}
--------------------------------------------------------------------------------
/src/test/resources/sample-files/text.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/resources/sample-files/text.pdf
--------------------------------------------------------------------------------
/src/test/resources/sample-files/zip_test.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/box/box-java-sdk/5fee0c3e2db5f077fccb0a5b9cfd17e99b9df925/src/test/resources/sample-files/zip_test.zip
--------------------------------------------------------------------------------