Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Eng 4024 java sdk re #29

Merged
merged 15 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from 11 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
170 changes: 168 additions & 2 deletions docs/api/applications/applications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,35 @@ var application = await client.CreateAsync(new Application {
Type = "private",
Permissions = new List<string> { "token:create", "token:read" }
});
```

</TabItem>
<TabItem value="java" label="Java">

```java showLineNumbers
import com.basistheory.ApiClient;
import com.basistheory.ApiException;
import com.basistheory.Configuration;
import com.basistheory.auth.*;
import com.basistheory.models.*;
import com.basistheory.ApplicationsApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

ApplicationsApi apiInstance = new ApplicationsApi(defaultClient);
CreateApplicationRequest createApplicationRequest = new CreateApplicationRequest();
var application = apiInstance.create(createApplicationRequest
.name("ApplicationName123123")
.type("private")
.permissions(Arrays.asList("token:create", "token:read")));
}
}
```

</TabItem>
Expand Down Expand Up @@ -120,7 +149,6 @@ func main() {
application, httpResponse, err := apiClient.ApplicationsApi.Create(contextWithAPIKey).CreateApplicationRequest(createApplicationRequest).Execute()
}
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -186,7 +214,6 @@ const bt = await new BasisTheory().init("key_N88mVGsp3sCXkykyN2EFED");

const applications = await bt.applications.list();
```

</TabItem>
<TabItem value="csharp" label="C#">

Expand All @@ -198,6 +225,33 @@ var client = new ApplicationClient("key_N88mVGsp3sCXkykyN2EFED");
var applications = await client.GetAsync();
```

</TabItem>
<TabItem value="java" label="Java">

```java
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

ApplicationsApi apiInstance = new ApplicationsApi(defaultClient);
List<UUID> id = Arrays.asList();
List<String> type = Arrays.asList();
Integer page = 1;
Integer size = 38;
ApplicationPaginatedList result = apiInstance.get(id, type, page, size);
}
```

</TabItem>
<TabItem value="python" label="Python">

Expand Down Expand Up @@ -315,6 +369,27 @@ using BasisTheory.net.Applications;
var client = new ApplicationClient("key_N88mVGsp3sCXkykyN2EFED");

var application = await client.GetByIdAsync("fe1f9ba4-474e-44b9-b949-110cdba9d662");
```

</TabItem>
<TabItem value="java" label="Java">

```java showLineNumbers
import com.basistheory.*;
import com.basistheory.auth.*;

public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

ApplicationsApi apiInstance = new ApplicationsApi(defaultClient);
Application result = apiInstance.getById("9b806250-d507-46e7-9dc0-de0f89a91a92");
}
}
```

</TabItem>
Expand Down Expand Up @@ -422,6 +497,27 @@ using BasisTheory.net.Applications;
var client = new ApplicationClient("key_N88mVGsp3sCXkykyN2EFED");

var application = await client.GetByKeyAsync();
```

</TabItem>
<TabItem value="java" label="Java">

```java showLineNumbers
import com.basistheory.*;
import com.basistheory.auth.*;

public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

ApplicationsApi apiInstance = new ApplicationsApi(defaultClient);
Application result = apiInstance.getByKey();
}
}
```

</TabItem>
Expand Down Expand Up @@ -543,6 +639,32 @@ var application = await client.UpdateAsync("fb124bba-f90d-45f0-9a59-5edca27b3b4a
Permissions = new List<string> { "application:create", "application:read" }
}
);
```

</TabItem>
<TabItem value="java" label="Java">

```java showLineNumbers
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.Arrays;
import java.util.UUID;

public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

ApplicationsApi apiInstance = new ApplicationsApi(defaultClient);
UpdateApplicationRequest updateApplicationRequest = new UpdateApplicationRequest();
Application application = apiInstance.update("f7c90548-ea08-4757-bb2d-a5cfe3fb4782", updateApplicationRequest
.name("ApplicationName")
.permissions(Arrays.asList("token:create")));
}
}
```

</TabItem>
Expand Down Expand Up @@ -675,6 +797,27 @@ using BasisTheory.net.Applications;
var client = new ApplicationClient("key_N88mVGsp3sCXkykyN2EFED");

var application = await client.RegenerateKeyAsync("fb124bba-f90d-45f0-9a59-5edca27b3b4a");
```

</TabItem>
<TabItem value="java" label="Java">

```java showLineNumbers
import com.basistheory.*;
import com.basistheory.auth.*;

public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

ApplicationsApi apiInstance = new ApplicationsApi(defaultClient);
Application result = apiInstance.regenerateKey("f7c90548-ea08-4757-bb2d-a5cfe3fb4782");
}
}
```

</TabItem>
Expand Down Expand Up @@ -784,6 +927,29 @@ using BasisTheory.net.Applications;
var client = new ApplicationClient("key_N88mVGsp3sCXkykyN2EFED");

await client.DeleteAsync("fb124bba-f90d-45f0-9a59-5edca27b3b4a");
```

</TabItem>
<TabItem value="java" label="Java">


```java showLineNumbers
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.UUID;

public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

ApplicationsApi apiInstance = new ApplicationsApi(defaultClient);
apiInstance.delete("f7c90548-ea08-4757-bb2d-a5cfe3fb4782");
}
}
```

</TabItem>
Expand Down
24 changes: 24 additions & 0 deletions docs/api/applications/permissions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,30 @@ using BasisTheory.net.Permissions;
var client = new PermissionClient("key_N88mVGsp3sCXkykyN2EFED");

var permissions = await client.GetAsync();
```

</TabItem>
<TabItem value="java" label="Java">

```java showLineNumbers
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.List;

public class App {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

PermissionsApi apiInstance = new PermissionsApi(defaultClient);
String applicationType = null;
Integer version = null;
List<Permission> result = apiInstance.get(applicationType, version);
}
}
```

</TabItem>
Expand Down
32 changes: 31 additions & 1 deletion docs/api/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,36 @@ using BasisTheory.net.Logs;
var client = new LogClient("key_N88mVGsp3sCXkykyN2EFED");

var logs = await client.GetAsync();
```

</TabItem>
<TabItem value="java" label="Java">

```java showLineNumbers
import com.basistheory.*;
import com.basistheory.auth.*;
import java.time.OffsetDateTime;
import java.util.UUID;

public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");

ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("key_N88mVGsp3sCXkykyN2EFED");

LogsApi apiInstance = new LogsApi(defaultClient);
String entityType = null;
String entityId = null;
OffsetDateTime startDate = OffsetDateTime.now().minusDays(7);
OffsetDateTime endDate = OffsetDateTime.now();
Integer page = 1;
Integer size = 56;
LogPaginatedList result = apiInstance.get(entityType, entityId, startDate, endDate, page, size);
System.out.println(result);
}
}
```

</TabItem>
Expand Down Expand Up @@ -193,4 +223,4 @@ Returns a non-paginated array of [entity types](#entity-type-object).
| Attribute | Type | Description |
| -------------- | -------- | ------------------------------------------------------------------ |
| `display_name` | _string_ | A readable string name for the entity type |
| `value` | _string_ | The system name of the entity. Referenced by a log's `entity_type` |
| `value` | _string_ | The system name of the entity. Referenced by a log's `entity_type` |
Loading