
com.okta.sdk.resource.api.LogStreamApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of okta-sdk-api Show documentation
Show all versions of okta-sdk-api Show documentation
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.
/*
* 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.Error;
import com.okta.sdk.resource.model.LogStream;
import com.okta.sdk.resource.model.LogStreamPutSchema;
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 LogStreamApi {
private ApiClient apiClient;
public LogStreamApi() {
this(Configuration.getDefaultApiClient());
}
public LogStreamApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Activate a Log Stream Activates a log stream by `logStreamId`
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream activateLogStream(String logStreamId) throws ApiException {
return this.activateLogStream(logStreamId, Collections.emptyMap());
}
/**
* Activate a Log Stream Activates a log stream by `logStreamId`
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
* @param additionalHeaders
* additionalHeaders for this call
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream activateLogStream(String logStreamId, Map additionalHeaders) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'logStreamId' is set
if (logStreamId == null) {
throw new ApiException(400, "Missing the required parameter 'logStreamId' when calling activateLogStream");
}
// create path and map variables
String localVarPath = "/api/v1/logStreams/{logStreamId}/lifecycle/activate"
.replaceAll("\\{" + "logStreamId" + "\\}", apiClient.escapeString(logStreamId.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, "POST", localVarQueryParams, localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams,
localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Create a Log Stream Creates a new Log Stream object
*
* @param instance
* (required)
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream createLogStream(LogStream instance) throws ApiException {
return this.createLogStream(instance, Collections.emptyMap());
}
/**
* Create a Log Stream Creates a new Log Stream object
*
* @param instance
* (required)
* @param additionalHeaders
* additionalHeaders for this call
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream createLogStream(LogStream 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 createLogStream");
}
// create path and map variables
String localVarPath = "/api/v1/logStreams";
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);
}
/**
* Deactivate a Log Stream Deactivates a log stream by `logStreamId`
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream deactivateLogStream(String logStreamId) throws ApiException {
return this.deactivateLogStream(logStreamId, Collections.emptyMap());
}
/**
* Deactivate a Log Stream Deactivates a log stream by `logStreamId`
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
* @param additionalHeaders
* additionalHeaders for this call
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream deactivateLogStream(String logStreamId, Map additionalHeaders)
throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'logStreamId' is set
if (logStreamId == null) {
throw new ApiException(400,
"Missing the required parameter 'logStreamId' when calling deactivateLogStream");
}
// create path and map variables
String localVarPath = "/api/v1/logStreams/{logStreamId}/lifecycle/deactivate"
.replaceAll("\\{" + "logStreamId" + "\\}", apiClient.escapeString(logStreamId.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, "POST", localVarQueryParams, localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(), localVarPostBody, localVarHeaderParams, localVarCookieParams,
localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Delete a Log Stream Deletes a Log Stream object from your org by ID
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
*
* @throws ApiException
* if fails to make API call
*/
public void deleteLogStream(String logStreamId) throws ApiException {
this.deleteLogStream(logStreamId, Collections.emptyMap());
}
/**
* Delete a Log Stream Deletes a Log Stream object from your org by ID
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
* @param additionalHeaders
* additionalHeaders for this call
*
* @throws ApiException
* if fails to make API call
*/
public void deleteLogStream(String logStreamId, Map additionalHeaders) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'logStreamId' is set
if (logStreamId == null) {
throw new ApiException(400, "Missing the required parameter 'logStreamId' when calling deleteLogStream");
}
// create path and map variables
String localVarPath = "/api/v1/logStreams/{logStreamId}".replaceAll("\\{" + "logStreamId" + "\\}",
apiClient.escapeString(logStreamId.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 Log Stream Retrieves a Log Stream object by ID
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream getLogStream(String logStreamId) throws ApiException {
return this.getLogStream(logStreamId, Collections.emptyMap());
}
/**
* Retrieve a Log Stream Retrieves a Log Stream object by ID
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
* @param additionalHeaders
* additionalHeaders for this call
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream getLogStream(String logStreamId, Map additionalHeaders) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'logStreamId' is set
if (logStreamId == null) {
throw new ApiException(400, "Missing the required parameter 'logStreamId' when calling getLogStream");
}
// create path and map variables
String localVarPath = "/api/v1/logStreams/{logStreamId}".replaceAll("\\{" + "logStreamId" + "\\}",
apiClient.escapeString(logStreamId.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 Log Streams Lists all Log Stream objects in your org. You can request a paginated list or a subset of
* Log Streams that match a supported filter expression.
*
* @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 limit
* A limit on the number of objects to return (optional, default to 20)
* @param filter
* An expression that [filters](/#filter) the returned objects. You can only use the `eq`
* operator on either the `status` or `type` properties in the filter expression.
* (optional)
*
* @return List<LogStream>
*
* @throws ApiException
* if fails to make API call
*/
public List listLogStreams(String after, Integer limit, String filter) throws ApiException {
return this.listLogStreams(after, limit, filter, Collections.emptyMap());
}
/**
* List all Log Streams Lists all Log Stream objects in your org. You can request a paginated list or a subset of
* Log Streams that match a supported filter expression.
*
* @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 limit
* A limit on the number of objects to return (optional, default to 20)
* @param filter
* An expression that [filters](/#filter) the returned objects. You can only use the `eq`
* operator on either the `status` or `type` properties in the filter expression.
* (optional)
* @param additionalHeaders
* additionalHeaders for this call
*
* @return List<LogStream>
*
* @throws ApiException
* if fails to make API call
*/
public List listLogStreams(String after, Integer limit, String filter,
Map additionalHeaders) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/logStreams";
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));
localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPair("filter", filter));
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 Log Stream Replaces the Log Stream object properties for a given ID. This operation is typically used
* to update the configuration of a Log Stream. Depending on the type of Log Stream you want to update, certain
* properties can't be modified after the Log Stream is initially created. Use the [Retrieve the Log Stream
* Schema for the schema
* type](/openapi/okta-management/management/tag/Schema/#tag/Schema/operation/getLogStreamSchema) request to
* determine which properties you can update for the specific Log Stream type. Log Stream properties with the
* `\"writeOnce\" : true` attribute can't be updated after creation. You must still specify
* these `writeOnce` properties in the request body with the original values in the PUT request. >
* **Note:** You don't have to specify properties that have both the `\"writeOnce\": true`
* and the `\"writeOnly\": true` attributes in the PUT request body. These property values are
* ignored even if you add them in the PUT request body.
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
* @param instance
* (required)
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream replaceLogStream(String logStreamId, LogStreamPutSchema instance) throws ApiException {
return this.replaceLogStream(logStreamId, instance, Collections.emptyMap());
}
/**
* Replace a Log Stream Replaces the Log Stream object properties for a given ID. This operation is typically used
* to update the configuration of a Log Stream. Depending on the type of Log Stream you want to update, certain
* properties can't be modified after the Log Stream is initially created. Use the [Retrieve the Log Stream
* Schema for the schema
* type](/openapi/okta-management/management/tag/Schema/#tag/Schema/operation/getLogStreamSchema) request to
* determine which properties you can update for the specific Log Stream type. Log Stream properties with the
* `\"writeOnce\" : true` attribute can't be updated after creation. You must still specify
* these `writeOnce` properties in the request body with the original values in the PUT request. >
* **Note:** You don't have to specify properties that have both the `\"writeOnce\": true`
* and the `\"writeOnly\": true` attributes in the PUT request body. These property values are
* ignored even if you add them in the PUT request body.
*
* @param logStreamId
* Unique identifier for the Log Stream (required)
* @param instance
* (required)
* @param additionalHeaders
* additionalHeaders for this call
*
* @return LogStream
*
* @throws ApiException
* if fails to make API call
*/
public LogStream replaceLogStream(String logStreamId, LogStreamPutSchema instance,
Map additionalHeaders) throws ApiException {
Object localVarPostBody = instance;
// verify the required parameter 'logStreamId' is set
if (logStreamId == null) {
throw new ApiException(400, "Missing the required parameter 'logStreamId' when calling replaceLogStream");
}
// verify the required parameter 'instance' is set
if (instance == null) {
throw new ApiException(400, "Missing the required parameter 'instance' when calling replaceLogStream");
}
// create path and map variables
String localVarPath = "/api/v1/logStreams/{logStreamId}".replaceAll("\\{" + "logStreamId" + "\\}",
apiClient.escapeString(logStreamId.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