tw.yukina.notion.sdk.MainTest Maven / Gradle / Ivy
package tw.yukina.notion.sdk;
import tw.yukina.notion.sdk.builder.TextBuilder;
import tw.yukina.notion.sdk.client.api.ApiClient;
import tw.yukina.notion.sdk.client.api.ApiClientFactory;
import tw.yukina.notion.sdk.model.TextColor;
import tw.yukina.notion.sdk.model.block.ParagraphBlock;
public class MainTest {
private static final String token = "secret_8RFtvIcy42L1M0wGRQs1hXpRePfvKbtpdVJMliVzH0j";
public static void main(String[] args) {
ApiClient apiClient = new ApiClientFactory()
.setToken(token)
.applyDefaultSetting().build();
demo1(apiClient);
}
private static void demo1(ApiClient apiClient) {
var text = TextBuilder.of("All things are ").setColor(TextColor.BLUE)
.append(TextBuilder.of("difficult").setBold(true).setUnderline(true).setColor(TextColor.RED))
.append(TextBuilder.of(" before they are easy.").setColor(TextColor.BLUE)).build();
apiClient.appendBlockChildren("73f76d1a1510408dbca93acd5ff2914f", ParagraphBlock.of(text));
}
}