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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ java {

group = 'com.schematichq'

version = '1.1.3'
version = '1.1.4'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.schematichq'
artifactId = 'schematic-java'
version = '1.1.3'
version = '1.1.4'
from components.java
pom {
name = 'schematic'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sample-app/src/main/java/sample/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

public final class App {
public static void main(String[] args) {
// import com.schematic.api.BaseSchematic
// import com.schematic.api.AsyncBaseSchematic
}
}
174 changes: 174 additions & 0 deletions src/main/java/com/schematic/api/AsyncBaseSchematic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.schematic.api;

import com.schematic.api.core.ClientOptions;
import com.schematic.api.core.RequestOptions;
import com.schematic.api.core.Suppliers;
import com.schematic.api.resources.accesstokens.AsyncAccesstokensClient;
import com.schematic.api.resources.accounts.AsyncAccountsClient;
import com.schematic.api.resources.billing.AsyncBillingClient;
import com.schematic.api.resources.checkout.AsyncCheckoutClient;
import com.schematic.api.resources.companies.AsyncCompaniesClient;
import com.schematic.api.resources.components.AsyncComponentsClient;
import com.schematic.api.resources.credits.AsyncCreditsClient;
import com.schematic.api.resources.crm.AsyncCrmClient;
import com.schematic.api.resources.dataexports.AsyncDataexportsClient;
import com.schematic.api.resources.entitlements.AsyncEntitlementsClient;
import com.schematic.api.resources.events.AsyncEventsClient;
import com.schematic.api.resources.features.AsyncFeaturesClient;
import com.schematic.api.resources.plangroups.AsyncPlangroupsClient;
import com.schematic.api.resources.plans.AsyncPlansClient;
import com.schematic.api.resources.webhooks.AsyncWebhooksClient;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;

public class AsyncBaseSchematic {
protected final ClientOptions clientOptions;

private final AsyncRawBaseSchematic rawClient;

protected final Supplier<AsyncAccountsClient> accountsClient;

protected final Supplier<AsyncBillingClient> billingClient;

protected final Supplier<AsyncCreditsClient> creditsClient;

protected final Supplier<AsyncCheckoutClient> checkoutClient;

protected final Supplier<AsyncCompaniesClient> companiesClient;

protected final Supplier<AsyncEntitlementsClient> entitlementsClient;

protected final Supplier<AsyncPlansClient> plansClient;

protected final Supplier<AsyncComponentsClient> componentsClient;

protected final Supplier<AsyncCrmClient> crmClient;

protected final Supplier<AsyncDataexportsClient> dataexportsClient;

protected final Supplier<AsyncEventsClient> eventsClient;

protected final Supplier<AsyncFeaturesClient> featuresClient;

protected final Supplier<AsyncPlangroupsClient> plangroupsClient;

protected final Supplier<AsyncAccesstokensClient> accesstokensClient;

protected final Supplier<AsyncWebhooksClient> webhooksClient;

public AsyncBaseSchematic(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.rawClient = new AsyncRawBaseSchematic(clientOptions);
this.accountsClient = Suppliers.memoize(() -> new AsyncAccountsClient(clientOptions));
this.billingClient = Suppliers.memoize(() -> new AsyncBillingClient(clientOptions));
this.creditsClient = Suppliers.memoize(() -> new AsyncCreditsClient(clientOptions));
this.checkoutClient = Suppliers.memoize(() -> new AsyncCheckoutClient(clientOptions));
this.companiesClient = Suppliers.memoize(() -> new AsyncCompaniesClient(clientOptions));
this.entitlementsClient = Suppliers.memoize(() -> new AsyncEntitlementsClient(clientOptions));
this.plansClient = Suppliers.memoize(() -> new AsyncPlansClient(clientOptions));
this.componentsClient = Suppliers.memoize(() -> new AsyncComponentsClient(clientOptions));
this.crmClient = Suppliers.memoize(() -> new AsyncCrmClient(clientOptions));
this.dataexportsClient = Suppliers.memoize(() -> new AsyncDataexportsClient(clientOptions));
this.eventsClient = Suppliers.memoize(() -> new AsyncEventsClient(clientOptions));
this.featuresClient = Suppliers.memoize(() -> new AsyncFeaturesClient(clientOptions));
this.plangroupsClient = Suppliers.memoize(() -> new AsyncPlangroupsClient(clientOptions));
this.accesstokensClient = Suppliers.memoize(() -> new AsyncAccesstokensClient(clientOptions));
this.webhooksClient = Suppliers.memoize(() -> new AsyncWebhooksClient(clientOptions));
}

/**
* Get responses with HTTP metadata like headers
*/
public AsyncRawBaseSchematic withRawResponse() {
return this.rawClient;
}

public CompletableFuture<Void> putPlanAudiencesPlanAudienceId(String planAudienceId) {
return this.rawClient.putPlanAudiencesPlanAudienceId(planAudienceId).thenApply(response -> response.body());
}

public CompletableFuture<Void> putPlanAudiencesPlanAudienceId(
String planAudienceId, RequestOptions requestOptions) {
return this.rawClient
.putPlanAudiencesPlanAudienceId(planAudienceId, requestOptions)
.thenApply(response -> response.body());
}

public CompletableFuture<Void> deletePlanAudiencesPlanAudienceId(String planAudienceId) {
return this.rawClient.deletePlanAudiencesPlanAudienceId(planAudienceId).thenApply(response -> response.body());
}

public CompletableFuture<Void> deletePlanAudiencesPlanAudienceId(
String planAudienceId, RequestOptions requestOptions) {
return this.rawClient
.deletePlanAudiencesPlanAudienceId(planAudienceId, requestOptions)
.thenApply(response -> response.body());
}

public AsyncAccountsClient accounts() {
return this.accountsClient.get();
}

public AsyncBillingClient billing() {
return this.billingClient.get();
}

public AsyncCreditsClient credits() {
return this.creditsClient.get();
}

public AsyncCheckoutClient checkout() {
return this.checkoutClient.get();
}

public AsyncCompaniesClient companies() {
return this.companiesClient.get();
}

public AsyncEntitlementsClient entitlements() {
return this.entitlementsClient.get();
}

public AsyncPlansClient plans() {
return this.plansClient.get();
}

public AsyncComponentsClient components() {
return this.componentsClient.get();
}

public AsyncCrmClient crm() {
return this.crmClient.get();
}

public AsyncDataexportsClient dataexports() {
return this.dataexportsClient.get();
}

public AsyncEventsClient events() {
return this.eventsClient.get();
}

public AsyncFeaturesClient features() {
return this.featuresClient.get();
}

public AsyncPlangroupsClient plangroups() {
return this.plangroupsClient.get();
}

public AsyncAccesstokensClient accesstokens() {
return this.accesstokensClient.get();
}

public AsyncWebhooksClient webhooks() {
return this.webhooksClient.get();
}

public static AsyncBaseSchematicBuilder builder() {
return new AsyncBaseSchematicBuilder();
}
}
67 changes: 67 additions & 0 deletions src/main/java/com/schematic/api/AsyncBaseSchematicBuilder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.schematic.api;

import com.schematic.api.core.ClientOptions;
import com.schematic.api.core.Environment;
import okhttp3.OkHttpClient;

public final class AsyncBaseSchematicBuilder {
private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder();

private String apiKey = null;

private Environment environment = Environment.DEFAULT;

/**
* Sets apiKey
*/
public AsyncBaseSchematicBuilder apiKey(String apiKey) {
this.apiKey = apiKey;
return this;
}

public AsyncBaseSchematicBuilder environment(Environment environment) {
this.environment = environment;
return this;
}

public AsyncBaseSchematicBuilder url(String url) {
this.environment = Environment.custom(url);
return this;
}

/**
* Sets the timeout (in seconds) for the client. Defaults to 60 seconds.
*/
public AsyncBaseSchematicBuilder timeout(int timeout) {
this.clientOptionsBuilder.timeout(timeout);
return this;
}

/**
* Sets the maximum number of retries for the client. Defaults to 2 retries.
*/
public AsyncBaseSchematicBuilder maxRetries(int maxRetries) {
this.clientOptionsBuilder.maxRetries(maxRetries);
return this;
}

/**
* Sets the underlying OkHttp client
*/
public AsyncBaseSchematicBuilder httpClient(OkHttpClient httpClient) {
this.clientOptionsBuilder.httpClient(httpClient);
return this;
}

public AsyncBaseSchematic build() {
if (apiKey == null) {
throw new RuntimeException("Please provide apiKey");
}
this.clientOptionsBuilder.addHeader("X-Schematic-Api-Key", this.apiKey);
clientOptionsBuilder.environment(this.environment);
return new AsyncBaseSchematic(clientOptionsBuilder.build());
}
}
Loading
Loading