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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "4de40e1", "specHash": "e0ffc4a", "version": "10.12.0" }
{ "engineHash": "8196e61", "specHash": "8b85e74", "version": "10.12.0" }
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ the SDK are available by topic:
* [Collaborationallowlistexempttargets](collaborationallowlistexempttargets.md)
* [Collections](collections.md)
* [Comments](comments.md)
* [Convertmarkdowntoboxnote](convertmarkdowntoboxnote.md)
* [Devicepinners](devicepinners.md)
* [Docgen](docgen.md)
* [Docgentemplate](docgentemplate.md)
Expand Down
31 changes: 31 additions & 0 deletions docs/convertmarkdowntoboxnote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ConvertMarkdownToBoxNoteManager


- [Convert content to Box Note](#convert-content-to-box-note)

## Convert content to Box Note

Creates a Box Note (`.boxnote` file) from supported source content. See the `content_format` field for supported formats.

This operation is performed by calling function `createNoteConvertV2026R0`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2026.0/post-notes-convert/).

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

### Arguments

- requestBody `NotesConvertRequestBodyV2026R0`
- Request body of createNoteConvertV2026R0 method
- headers `CreateNoteConvertV2026R0Headers`
- Headers of createNoteConvertV2026R0 method


### Returns

This function returns a value of type `NotesConvertResponseV2026R0`.

The note was created successfully.


17 changes: 17 additions & 0 deletions src/main/java/com/box/sdkgen/client/BoxClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.box.sdkgen.managers.collaborationallowlistexempttargets.CollaborationAllowlistExemptTargetsManager;
import com.box.sdkgen.managers.collections.CollectionsManager;
import com.box.sdkgen.managers.comments.CommentsManager;
import com.box.sdkgen.managers.convertmarkdowntoboxnote.ConvertMarkdownToBoxNoteManager;
import com.box.sdkgen.managers.devicepinners.DevicePinnersManager;
import com.box.sdkgen.managers.docgen.DocgenManager;
import com.box.sdkgen.managers.docgentemplate.DocgenTemplateManager;
Expand Down Expand Up @@ -273,6 +274,8 @@ public class BoxClient {

public final AutomateWorkflowsManager automateWorkflows;

public final ConvertMarkdownToBoxNoteManager convertMarkdownToBoxNote;

public BoxClient(Authentication auth) {
this.auth = auth;
this.networkSession = new NetworkSession.Builder().baseUrls(new BaseUrls()).build();
Expand Down Expand Up @@ -626,6 +629,11 @@ public BoxClient(Authentication auth) {
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.convertMarkdownToBoxNote =
new ConvertMarkdownToBoxNoteManager.Builder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
}

protected BoxClient(Builder builder) {
Expand Down Expand Up @@ -981,6 +989,11 @@ protected BoxClient(Builder builder) {
.auth(this.auth)
.networkSession(this.networkSession)
.build();
this.convertMarkdownToBoxNote =
new ConvertMarkdownToBoxNoteManager.Builder()
.auth(this.auth)
.networkSession(this.networkSession)
.build();
}

/**
Expand Down Expand Up @@ -1440,6 +1453,10 @@ public AutomateWorkflowsManager getAutomateWorkflows() {
return automateWorkflows;
}

public ConvertMarkdownToBoxNoteManager getConvertMarkdownToBoxNote() {
return convertMarkdownToBoxNote;
}

public static class Builder {

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

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

import com.box.sdkgen.networking.auth.Authentication;
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
import com.box.sdkgen.networking.network.NetworkSession;
import com.box.sdkgen.schemas.v2026r0.notesconvertrequestbodyv2026r0.NotesConvertRequestBodyV2026R0;
import com.box.sdkgen.schemas.v2026r0.notesconvertresponsev2026r0.NotesConvertResponseV2026R0;
import com.box.sdkgen.serialization.json.JsonManager;
import java.util.Map;

public class ConvertMarkdownToBoxNoteManager {

public Authentication auth;

public NetworkSession networkSession;

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

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

/**
* Creates a Box Note (`.boxnote` file) from supported source content. See the `content_format`
* field for supported formats.
*
* @param requestBody Request body of createNoteConvertV2026R0 method
*/
public NotesConvertResponseV2026R0 createNoteConvertV2026R0(
NotesConvertRequestBodyV2026R0 requestBody) {
return createNoteConvertV2026R0(requestBody, new CreateNoteConvertV2026R0Headers());
}

/**
* Creates a Box Note (`.boxnote` file) from supported source content. See the `content_format`
* field for supported formats.
*
* @param requestBody Request body of createNoteConvertV2026R0 method
* @param headers Headers of createNoteConvertV2026R0 method
*/
public NotesConvertResponseV2026R0 createNoteConvertV2026R0(
NotesConvertRequestBodyV2026R0 requestBody, CreateNoteConvertV2026R0Headers headers) {
Map<String, String> headersMap =
prepareParams(
mergeMaps(
mapOf(entryOf("box-version", convertToString(headers.getBoxVersion()))),
headers.getExtraHeaders()));
FetchResponse response =
this.networkSession
.getNetworkClient()
.fetch(
new FetchOptions.Builder(
String.join(
"",
this.networkSession.getBaseUrls().getBaseUrl(),
"/2.0/notes/convert"),
"POST")
.headers(headersMap)
.data(JsonManager.serialize(requestBody))
.contentType("application/json")
.responseFormat(ResponseFormat.JSON)
.auth(this.auth)
.networkSession(this.networkSession)
.build());
return JsonManager.deserialize(response.getData(), NotesConvertResponseV2026R0.class);
}

public Authentication getAuth() {
return auth;
}

public NetworkSession getNetworkSession() {
return networkSession;
}

public static class Builder {

protected Authentication auth;

protected NetworkSession networkSession;

public Builder() {}

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

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

public ConvertMarkdownToBoxNoteManager build() {
if (this.networkSession == null) {
this.networkSession = new NetworkSession();
}
return new ConvertMarkdownToBoxNoteManager(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.box.sdkgen.managers.convertmarkdowntoboxnote;

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

import com.box.sdkgen.parameters.v2026r0.boxversionheaderv2026r0.BoxVersionHeaderV2026R0;
import com.box.sdkgen.serialization.json.EnumWrapper;
import java.util.Map;

public class CreateNoteConvertV2026R0Headers {

/** Version header. */
public EnumWrapper<BoxVersionHeaderV2026R0> boxVersion;

/** Extra headers that will be included in the HTTP request. */
public Map<String, String> extraHeaders;

public CreateNoteConvertV2026R0Headers() {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2026R0>(BoxVersionHeaderV2026R0._2026_0);
this.extraHeaders = mapOf();
}

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

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

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

public static class Builder {

protected EnumWrapper<BoxVersionHeaderV2026R0> boxVersion;

protected Map<String, String> extraHeaders;

public Builder() {}

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

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

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

public CreateNoteConvertV2026R0Headers build() {
if (this.boxVersion == null) {
this.boxVersion = new EnumWrapper<BoxVersionHeaderV2026R0>(BoxVersionHeaderV2026R0._2026_0);
}
if (this.extraHeaders == null) {
this.extraHeaders = mapOf();
}
return new CreateNoteConvertV2026R0Headers(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package com.box.sdkgen.schemas.v2026r0.folderreferencev2026r0;

import com.box.sdkgen.internal.NullableFieldTracker;
import com.box.sdkgen.internal.SerializableObject;
import com.box.sdkgen.serialization.json.EnumWrapper;
import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Objects;

/** Folder reference. */
@JsonFilter("nullablePropertyFilter")
public class FolderReferenceV2026R0 extends SerializableObject {

/** The value will always be `folder`. */
@JsonDeserialize(
using = FolderReferenceV2026R0TypeField.FolderReferenceV2026R0TypeFieldDeserializer.class)
@JsonSerialize(
using = FolderReferenceV2026R0TypeField.FolderReferenceV2026R0TypeFieldSerializer.class)
protected EnumWrapper<FolderReferenceV2026R0TypeField> type;

/** ID of the folder. */
protected final String id;

public FolderReferenceV2026R0(@JsonProperty("id") String id) {
super();
this.id = id;
this.type =
new EnumWrapper<FolderReferenceV2026R0TypeField>(FolderReferenceV2026R0TypeField.FOLDER);
}

protected FolderReferenceV2026R0(Builder builder) {
super();
this.type = builder.type;
this.id = builder.id;
markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
}

public EnumWrapper<FolderReferenceV2026R0TypeField> getType() {
return type;
}

public String getId() {
return id;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
FolderReferenceV2026R0 casted = (FolderReferenceV2026R0) o;
return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
}

@Override
public int hashCode() {
return Objects.hash(type, id);
}

@Override
public String toString() {
return "FolderReferenceV2026R0{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}";
}

public static class Builder extends NullableFieldTracker {

protected EnumWrapper<FolderReferenceV2026R0TypeField> type;

protected final String id;

public Builder(String id) {
super();
this.id = id;
}

public Builder type(FolderReferenceV2026R0TypeField type) {
this.type = new EnumWrapper<FolderReferenceV2026R0TypeField>(type);
return this;
}

public Builder type(EnumWrapper<FolderReferenceV2026R0TypeField> type) {
this.type = type;
return this;
}

public FolderReferenceV2026R0 build() {
if (this.type == null) {
this.type =
new EnumWrapper<FolderReferenceV2026R0TypeField>(
FolderReferenceV2026R0TypeField.FOLDER);
}
return new FolderReferenceV2026R0(this);
}
}
}
Loading
Loading