Skip to content

Latest commit

 

History

History
329 lines (239 loc) · 15 KB

File metadata and controls

329 lines (239 loc) · 15 KB

SamlConnections

Warning

This SDK is DEPRECATED

Overview

Available Operations

  • list - Get a list of SAML Connections for an instance ⚠️ Deprecated
  • create - Create a SAML Connection ⚠️ Deprecated
  • get - Retrieve a SAML Connection by ID ⚠️ Deprecated
  • update - Update a SAML Connection ⚠️ Deprecated
  • delete - Delete a SAML Connection ⚠️ Deprecated

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. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.ListSAMLConnectionsRequest;
import com.clerk.backend_api.models.operations.ListSAMLConnectionsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ClerkErrors, Exception {

        Clerk sdk = Clerk.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        ListSAMLConnectionsRequest req = ListSAMLConnectionsRequest.builder()
                .build();

        ListSAMLConnectionsResponse res = sdk.samlConnections().list()
                .request(req)
                .call();

        if (res.samlConnections().isPresent()) {
            System.out.println(res.samlConnections().get());
        }
    }
}

Parameters

Parameter Type Required Description
request ListSAMLConnectionsRequest ✔️ The request object to use for the request.

Response

ListSAMLConnectionsResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 402, 403, 422 application/json
models/errors/SDKError 4XX, 5XX */*

create

Create a new SAML Connection. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.CreateSAMLConnectionResponse;
import java.lang.Exception;
import java.lang.Object;

public class Application {

    public static void main(String[] args) throws ClerkErrors, Exception {

        Clerk sdk = Clerk.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        CreateSAMLConnectionResponse res = sdk.samlConnections().create()
                .call();

        if (res.samlConnection().isPresent()) {
            SAMLConnection unionValue = res.samlConnection().get();
            Object raw = unionValue.value();
            if (raw instanceof One) {
                One oneValue = (One) raw;
                // Handle one variant
            } else if (raw instanceof Two) {
                Two twoValue = (Two) raw;
                // Handle two variant
            } else {
                // Unknown or unsupported variant
            }
        }
    }
}

Parameters

Parameter Type Required Description
request CreateSAMLConnectionRequestBody ✔️ The request object to use for the request.

Response

CreateSAMLConnectionResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 402, 403, 404, 422 application/json
models/errors/SDKError 4XX, 5XX */*

get

Fetches the SAML Connection whose ID matches the provided saml_connection_id in the path. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.GetSAMLConnectionResponse;
import java.lang.Exception;
import java.lang.Object;

public class Application {

    public static void main(String[] args) throws ClerkErrors, Exception {

        Clerk sdk = Clerk.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        GetSAMLConnectionResponse res = sdk.samlConnections().get()
                .samlConnectionId("<id>")
                .call();

        if (res.samlConnection().isPresent()) {
            SAMLConnection unionValue = res.samlConnection().get();
            Object raw = unionValue.value();
            if (raw instanceof One) {
                One oneValue = (One) raw;
                // Handle one variant
            } else if (raw instanceof Two) {
                Two twoValue = (Two) raw;
                // Handle two variant
            } else {
                // Unknown or unsupported variant
            }
        }
    }
}

Parameters

Parameter Type Required Description
samlConnectionId String ✔️ The ID of the SAML Connection

Response

GetSAMLConnectionResponse

Errors

Error Type 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. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.components.*;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpdateSAMLConnectionRequestBody;
import com.clerk.backend_api.models.operations.UpdateSAMLConnectionResponse;
import java.lang.Exception;
import java.lang.Object;

public class Application {

    public static void main(String[] args) throws ClerkErrors, Exception {

        Clerk sdk = Clerk.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        UpdateSAMLConnectionResponse res = sdk.samlConnections().update()
                .samlConnectionId("<id>")
                .requestBody(UpdateSAMLConnectionRequestBody.builder()
                    .build())
                .call();

        if (res.samlConnection().isPresent()) {
            SAMLConnection unionValue = res.samlConnection().get();
            Object raw = unionValue.value();
            if (raw instanceof One) {
                One oneValue = (One) raw;
                // Handle one variant
            } else if (raw instanceof Two) {
                Two twoValue = (Two) raw;
                // Handle two variant
            } else {
                // Unknown or unsupported variant
            }
        }
    }
}

Parameters

Parameter Type Required Description
samlConnectionId String ✔️ The ID of the SAML Connection to update
requestBody UpdateSAMLConnectionRequestBody ✔️ N/A

Response

UpdateSAMLConnectionResponse

Errors

Error Type 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. Deprecated: Use the Enterprise Connections API instead. This endpoint will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.DeleteSAMLConnectionResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ClerkErrors, Exception {

        Clerk sdk = Clerk.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        DeleteSAMLConnectionResponse res = sdk.samlConnections().delete()
                .samlConnectionId("<id>")
                .call();

        if (res.deletedObject().isPresent()) {
            System.out.println(res.deletedObject().get());
        }
    }
}

Parameters

Parameter Type Required Description
samlConnectionId String ✔️ The ID of the SAML Connection to delete

Response

DeleteSAMLConnectionResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 402, 403, 404 application/json
models/errors/SDKError 4XX, 5XX */*