All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.okta.sdk.resource.api.RoleCResourceSetApi Maven / Gradle / Ivy

Go to download

The Okta Java SDK API .jar provides a Java API that your code can use to make calls to the Okta API. This .jar is the only compile-time dependency within the Okta SDK project that your code should depend on. Implementations of this API (implementation .jars) should be runtime dependencies only.

There is a newer version: 21.0.0
Show newest version
/*
 * Okta Admin Management
 * Allows customers to easily access the Okta Management APIs
 *
 * The version of the OpenAPI document: 2024.08.3
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.okta.sdk.resource.api;

import com.fasterxml.jackson.core.type.TypeReference;

import com.okta.sdk.resource.client.ApiException;
import com.okta.sdk.resource.client.ApiClient;
import com.okta.sdk.resource.client.Configuration;
import com.okta.sdk.resource.model.*;
import com.okta.sdk.resource.client.Pair;

import com.okta.sdk.resource.model.CreateResourceSetRequest;
import com.okta.sdk.resource.model.Error;
import com.okta.sdk.resource.model.ResourceSet;
import com.okta.sdk.resource.model.ResourceSets;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;

import org.openapitools.jackson.nullable.JsonNullableModule;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-11-15T08:48:47.130589-06:00[America/Chicago]", comments = "Generator version: 7.8.0")
public class RoleCResourceSetApi {

    private ApiClient apiClient;

    public RoleCResourceSetApi() {
        this(Configuration.getDefaultApiClient());
    }

    public RoleCResourceSetApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Create a Resource Set Creates a new Resource Set. See [Supported
     * Resources](/openapi/okta-management/guides/roles/#supported-resources). > **Note:** The maximum number of
     * `resources` allowed in a Resource Set object is 1000. Resources are identified by either an Okta
     * Resource Name (ORN) or by a REST URL format. See [Okta Resource
     * Name](/openapi/okta-management/guides/roles/#okta-resource-name-orn).
     *
     * @param instance
     *            (required)
     *
     * @return ResourceSet
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSet createResourceSet(CreateResourceSetRequest instance) throws ApiException {
        return this.createResourceSet(instance, Collections.emptyMap());
    }

    /**
     * Create a Resource Set Creates a new Resource Set. See [Supported
     * Resources](/openapi/okta-management/guides/roles/#supported-resources). > **Note:** The maximum number of
     * `resources` allowed in a Resource Set object is 1000. Resources are identified by either an Okta
     * Resource Name (ORN) or by a REST URL format. See [Okta Resource
     * Name](/openapi/okta-management/guides/roles/#okta-resource-name-orn).
     *
     * @param instance
     *            (required)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return ResourceSet
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSet createResourceSet(CreateResourceSetRequest instance, Map additionalHeaders)
            throws ApiException {
        Object localVarPostBody = instance;

        // verify the required parameter 'instance' is set
        if (instance == null) {
            throw new ApiException(400, "Missing the required parameter 'instance' when calling createResourceSet");
        }

        // create path and map variables
        String localVarPath = "/api/v1/iam/resource-sets";

        StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
        String localVarQueryParameterBaseName;
        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        localVarHeaderParams.putAll(additionalHeaders);

        final String[] localVarAccepts = { "application/json" };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = { "application/json" };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "apiToken", "oauth2" };

        TypeReference localVarReturnType = new TypeReference() {
        };
        return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams,
                localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams,
                localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }

    /**
     * Delete a Resource Set Deletes a Resource Set by `resourceSetIdOrLabel`
     *
     * @param resourceSetIdOrLabel
     *            `id` or `label` the Resource Set (required)
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public void deleteResourceSet(String resourceSetIdOrLabel) throws ApiException {
        this.deleteResourceSet(resourceSetIdOrLabel, Collections.emptyMap());
    }

    /**
     * Delete a Resource Set Deletes a Resource Set by `resourceSetIdOrLabel`
     *
     * @param resourceSetIdOrLabel
     *            `id` or `label` the Resource Set (required)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public void deleteResourceSet(String resourceSetIdOrLabel, Map additionalHeaders)
            throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'resourceSetIdOrLabel' is set
        if (resourceSetIdOrLabel == null) {
            throw new ApiException(400,
                    "Missing the required parameter 'resourceSetIdOrLabel' when calling deleteResourceSet");
        }

        // create path and map variables
        String localVarPath = "/api/v1/iam/resource-sets/{resourceSetIdOrLabel}".replaceAll(
                "\\{" + "resourceSetIdOrLabel" + "\\}", apiClient.escapeString(resourceSetIdOrLabel.toString()));

        StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
        String localVarQueryParameterBaseName;
        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        localVarHeaderParams.putAll(additionalHeaders);

        final String[] localVarAccepts = { "application/json" };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = {

        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "apiToken", "oauth2" };

        apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams,
                localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams,
                localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
    }

    /**
     * Retrieve a Resource Set Retrieves a Resource Set by `resourceSetIdOrLabel`
     *
     * @param resourceSetIdOrLabel
     *            `id` or `label` the Resource Set (required)
     *
     * @return ResourceSet
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSet getResourceSet(String resourceSetIdOrLabel) throws ApiException {
        return this.getResourceSet(resourceSetIdOrLabel, Collections.emptyMap());
    }

    /**
     * Retrieve a Resource Set Retrieves a Resource Set by `resourceSetIdOrLabel`
     *
     * @param resourceSetIdOrLabel
     *            `id` or `label` the Resource Set (required)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return ResourceSet
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSet getResourceSet(String resourceSetIdOrLabel, Map additionalHeaders)
            throws ApiException {
        Object localVarPostBody = null;

        // verify the required parameter 'resourceSetIdOrLabel' is set
        if (resourceSetIdOrLabel == null) {
            throw new ApiException(400,
                    "Missing the required parameter 'resourceSetIdOrLabel' when calling getResourceSet");
        }

        // create path and map variables
        String localVarPath = "/api/v1/iam/resource-sets/{resourceSetIdOrLabel}".replaceAll(
                "\\{" + "resourceSetIdOrLabel" + "\\}", apiClient.escapeString(resourceSetIdOrLabel.toString()));

        StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
        String localVarQueryParameterBaseName;
        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        localVarHeaderParams.putAll(additionalHeaders);

        final String[] localVarAccepts = { "application/json" };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = {

        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "apiToken", "oauth2" };

        TypeReference localVarReturnType = new TypeReference() {
        };
        return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams,
                localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams,
                localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }

    /**
     * List all Resource Sets Lists all Resource Sets with pagination support
     *
     * @param after
     *            The cursor to use for pagination. It is an opaque string that specifies your current location in the
     *            list and is obtained from the `Link` response header. See
     *            [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
     *
     * @return ResourceSets
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSets listResourceSets(String after) throws ApiException {
        return this.listResourceSets(after, Collections.emptyMap());
    }

    /**
     * List all Resource Sets Lists all Resource Sets with pagination support
     *
     * @param after
     *            The cursor to use for pagination. It is an opaque string that specifies your current location in the
     *            list and is obtained from the `Link` response header. See
     *            [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return ResourceSets
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSets listResourceSets(String after, Map additionalHeaders) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/iam/resource-sets";

        StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
        String localVarQueryParameterBaseName;
        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        localVarQueryParams.addAll(apiClient.parameterToPair("after", after));

        localVarHeaderParams.putAll(additionalHeaders);

        final String[] localVarAccepts = { "application/json" };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = {

        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "apiToken", "oauth2" };

        TypeReference localVarReturnType = new TypeReference() {
        };
        return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams,
                localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams,
                localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }

    /**
     * Replace a Resource Set Replaces the label and description of a Resource Set
     *
     * @param resourceSetIdOrLabel
     *            `id` or `label` the Resource Set (required)
     * @param instance
     *            (required)
     *
     * @return ResourceSet
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSet replaceResourceSet(String resourceSetIdOrLabel, ResourceSet instance) throws ApiException {
        return this.replaceResourceSet(resourceSetIdOrLabel, instance, Collections.emptyMap());
    }

    /**
     * Replace a Resource Set Replaces the label and description of a Resource Set
     *
     * @param resourceSetIdOrLabel
     *            `id` or `label` the Resource Set (required)
     * @param instance
     *            (required)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return ResourceSet
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public ResourceSet replaceResourceSet(String resourceSetIdOrLabel, ResourceSet instance,
            Map additionalHeaders) throws ApiException {
        Object localVarPostBody = instance;

        // verify the required parameter 'resourceSetIdOrLabel' is set
        if (resourceSetIdOrLabel == null) {
            throw new ApiException(400,
                    "Missing the required parameter 'resourceSetIdOrLabel' when calling replaceResourceSet");
        }

        // verify the required parameter 'instance' is set
        if (instance == null) {
            throw new ApiException(400, "Missing the required parameter 'instance' when calling replaceResourceSet");
        }

        // create path and map variables
        String localVarPath = "/api/v1/iam/resource-sets/{resourceSetIdOrLabel}".replaceAll(
                "\\{" + "resourceSetIdOrLabel" + "\\}", apiClient.escapeString(resourceSetIdOrLabel.toString()));

        StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
        String localVarQueryParameterBaseName;
        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        localVarHeaderParams.putAll(additionalHeaders);

        final String[] localVarAccepts = { "application/json" };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

        final String[] localVarContentTypes = { "application/json" };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

        String[] localVarAuthNames = new String[] { "apiToken", "oauth2" };

        TypeReference localVarReturnType = new TypeReference() {
        };
        return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams,
                localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams,
                localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }

    protected static ObjectMapper getObjectMapper() {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.registerModule(new JavaTimeModule());
        objectMapper.registerModule(new JsonNullableModule());
        objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        objectMapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true);
        return objectMapper;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy