Files
2024-06-13 13:51:50 -04:00

377 lines
18 KiB
Markdown

# SamlConnections
(*samlConnections()*)
### Available Operations
* [list](#list) - Get a list of SAML Connections for an instance
* [create](#create) - Create a SAML Connection
* [get](#get) - Retrieve a SAML Connection by ID
* [update](#update) - Update a SAML Connection
* [delete](#delete) - Delete a SAML Connection
## list
Returns the list of SAML Connections for an instance.
Results can be paginated using the optional `limit` and `offset` query parameters.
The SAML Connections are ordered by descending creation date and the most recent will be returned first.
### Example Usage
```java
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.components.Security;
import com.clerk.backend_api.models.operations.*;
import com.clerk.backend_api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
ListSAMLConnectionsResponse res = sdk.samlConnections().list()
.limit(10L)
.offset(0L)
.call();
while (true) {
if (res.samlConnections().isPresent()) {
// handle response
Optional<ListSAMLConnectionsResponse> nextRes = res.next();
if (nextRes.isPresent()) {
res = nextRes.get();
} else {
break;
}
}
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (com.clerk.backend_api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `limit` | *Optional<? extends Long>* | :heavy_minus_sign: | Applies a limit to the number of results returned.<br/>Can be used for paginating the results together with `offset`. |
| `offset` | *Optional<? extends Long>* | :heavy_minus_sign: | Skip the first `offset` results when paginating.<br/>Needs to be an integer greater or equal to zero.<br/>To be used in conjunction with `limit`. |
### Response
**[Optional<? extends com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse>](../../models/operations/ListSAMLConnectionsResponse.md)**
### Errors
| Error Object | Status Code | Content Type |
| ------------------------- | ------------------------- | ------------------------- |
| models/errors/ClerkErrors | 402,403,422 | application/json |
| models/errors/SDKError | 4xx-5xx | */* |
## create
Create a new SAML Connection.
### Example Usage
```java
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.components.Security;
import com.clerk.backend_api.models.operations.*;
import com.clerk.backend_api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
CreateSAMLConnectionRequestBody req = CreateSAMLConnectionRequestBody.builder()
.name("<value>")
.domain("<value>")
.provider(Provider.SAML_OKTA)
.build();
CreateSAMLConnectionResponse res = sdk.samlConnections().create()
.request(req)
.call();
if (res.samlConnection().isPresent()) {
// handle response
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (com.clerk.backend_api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `request` | [com.clerk.backend_api.models.operations.CreateSAMLConnectionRequestBody](../../models/operations/CreateSAMLConnectionRequestBody.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[Optional<? extends com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse>](../../models/operations/CreateSAMLConnectionResponse.md)**
### Errors
| Error Object | Status Code | Content Type |
| ------------------------- | ------------------------- | ------------------------- |
| models/errors/ClerkErrors | 402,403,422 | application/json |
| models/errors/SDKError | 4xx-5xx | */* |
## get
Fetches the SAML Connection whose ID matches the provided `saml_connection_id` in the path.
### Example Usage
```java
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.components.Security;
import com.clerk.backend_api.models.operations.*;
import com.clerk.backend_api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetSAMLConnectionResponse res = sdk.samlConnections().get()
.samlConnectionId("<value>")
.call();
if (res.samlConnection().isPresent()) {
// handle response
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (com.clerk.backend_api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- |
| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection |
### Response
**[Optional<? extends com.clerk.backend_api.models.operations.GetSAMLConnectionResponse>](../../models/operations/GetSAMLConnectionResponse.md)**
### Errors
| Error Object | Status Code | Content Type |
| ------------------------- | ------------------------- | ------------------------- |
| models/errors/ClerkErrors | 402,403,404 | application/json |
| models/errors/SDKError | 4xx-5xx | */* |
## update
Updates the SAML Connection whose ID matches the provided `id` in the path.
### Example Usage
```java
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.components.Security;
import com.clerk.backend_api.models.operations.*;
import com.clerk.backend_api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
UpdateSAMLConnectionResponse res = sdk.samlConnections().update()
.samlConnectionId("<value>")
.requestBody(UpdateSAMLConnectionRequestBody.builder()
.build())
.call();
if (res.samlConnection().isPresent()) {
// handle response
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (com.clerk.backend_api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection to update |
| `requestBody` | [com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBody](../../models/operations/UpdateSAMLConnectionRequestBody.md) | :heavy_check_mark: | N/A |
### Response
**[Optional<? extends com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse>](../../models/operations/UpdateSAMLConnectionResponse.md)**
### Errors
| Error Object | Status Code | Content Type |
| ------------------------- | ------------------------- | ------------------------- |
| models/errors/ClerkErrors | 402,403,404,422 | application/json |
| models/errors/SDKError | 4xx-5xx | */* |
## delete
Deletes the SAML Connection whose ID matches the provided `id` in the path.
### Example Usage
```java
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.components.Security;
import com.clerk.backend_api.models.operations.*;
import com.clerk.backend_api.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
DeleteSAMLConnectionResponse res = sdk.samlConnections().delete()
.samlConnectionId("<value>")
.call();
if (res.deletedObject().isPresent()) {
// handle response
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (com.clerk.backend_api.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
```
### Parameters
| Parameter | Type | Required | Description |
| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- |
| `samlConnectionId` | *String* | :heavy_check_mark: | The ID of the SAML Connection to delete |
### Response
**[Optional<? extends com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse>](../../models/operations/DeleteSAMLConnectionResponse.md)**
### Errors
| Error Object | Status Code | Content Type |
| ------------------------- | ------------------------- | ------------------------- |
| models/errors/ClerkErrors | 402,403,404 | application/json |
| models/errors/SDKError | 4xx-5xx | */* |