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

com.okta.sdk.resource.api.BrandsApi 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.Brand;
import com.okta.sdk.resource.model.BrandRequest;
import com.okta.sdk.resource.model.BrandWithEmbedded;
import com.okta.sdk.resource.model.CreateBrandRequest;
import com.okta.sdk.resource.model.DomainResponse;
import com.okta.sdk.resource.model.Error;

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 BrandsApi {

    private ApiClient apiClient;

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Create a Brand Creates a new brand in your org
     *
     * @param createBrandRequest
     *            (optional)
     *
     * @return Brand
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public Brand createBrand(CreateBrandRequest createBrandRequest) throws ApiException {
        return this.createBrand(createBrandRequest, Collections.emptyMap());
    }

    /**
     * Create a Brand Creates a new brand in your org
     *
     * @param createBrandRequest
     *            (optional)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return Brand
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public Brand createBrand(CreateBrandRequest createBrandRequest, Map additionalHeaders)
            throws ApiException {
        Object localVarPostBody = createBrandRequest;

        // create path and map variables
        String localVarPath = "/api/v1/brands";

        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 brand Deletes a brand by `brandId`
     *
     * @param brandId
     *            The ID of the brand (required)
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public void deleteBrand(String brandId) throws ApiException {
        this.deleteBrand(brandId, Collections.emptyMap());
    }

    /**
     * Delete a brand Deletes a brand by `brandId`
     *
     * @param brandId
     *            The ID of the brand (required)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public void deleteBrand(String brandId, Map additionalHeaders) throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/api/v1/brands/{brandId}".replaceAll("\\{" + "brandId" + "\\}",
                apiClient.escapeString(brandId.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 Brand Retrieves a brand by `brandId`
     *
     * @param brandId
     *            The ID of the brand (required)
     * @param expand
     *            Specifies additional metadata to be included in the response (optional
     *
     * @return BrandWithEmbedded
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public BrandWithEmbedded getBrand(String brandId, List expand) throws ApiException {
        return this.getBrand(brandId, expand, Collections.emptyMap());
    }

    /**
     * Retrieve a Brand Retrieves a brand by `brandId`
     *
     * @param brandId
     *            The ID of the brand (required)
     * @param expand
     *            Specifies additional metadata to be included in the response (optional
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return BrandWithEmbedded
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public BrandWithEmbedded getBrand(String brandId, List expand, Map additionalHeaders)
            throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/api/v1/brands/{brandId}".replaceAll("\\{" + "brandId" + "\\}",
                apiClient.escapeString(brandId.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();

        localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "expand", expand));

        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 Domains associated with a Brand Lists all domains associated with a brand by `brandId`
     *
     * @param brandId
     *            The ID of the brand (required)
     *
     * @return List<DomainResponse>
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public List listBrandDomains(String brandId) throws ApiException {
        return this.listBrandDomains(brandId, Collections.emptyMap());
    }

    /**
     * List all Domains associated with a Brand Lists all domains associated with a brand by `brandId`
     *
     * @param brandId
     *            The ID of the brand (required)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return List<DomainResponse>
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public List listBrandDomains(String brandId, Map additionalHeaders)
            throws ApiException {
        Object localVarPostBody = null;

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

        // create path and map variables
        String localVarPath = "/api/v1/brands/{brandId}/domains".replaceAll("\\{" + "brandId" + "\\}",
                apiClient.escapeString(brandId.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 Brands Lists all the brands in your org
     *
     * @param expand
     *            Specifies additional metadata to be included in the response (optional
     * @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 q
     *            Searches the records for matching value (optional)
     *
     * @return List<BrandWithEmbedded>
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public List listBrands(List expand, String after, Integer limit, String q)
            throws ApiException {
        return this.listBrands(expand, after, limit, q, Collections.emptyMap());
    }

    /**
     * List all Brands Lists all the brands in your org
     *
     * @param expand
     *            Specifies additional metadata to be included in the response (optional
     * @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 q
     *            Searches the records for matching value (optional)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return List<BrandWithEmbedded>
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public List listBrands(List expand, String after, Integer limit, String q,
            Map additionalHeaders) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/brands";

        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();

        localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "expand", expand));
        localVarQueryParams.addAll(apiClient.parameterToPair("after", after));
        localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit));
        localVarQueryParams.addAll(apiClient.parameterToPair("q", q));

        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 Brand Replaces a brand by `brandId` Passing an invalid `brandId` returns a
     * `404 Not Found` status code with the error code `E0000007`. Not providing
     * `agreeToCustomPrivacyPolicy` with `customPrivacyPolicyUrl` returns a `400 Bad
     * Request` status code with the error code `E0000001`.
     *
     * @param brandId
     *            The ID of the brand (required)
     * @param brand
     *            (required)
     *
     * @return Brand
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public Brand replaceBrand(String brandId, BrandRequest brand) throws ApiException {
        return this.replaceBrand(brandId, brand, Collections.emptyMap());
    }

    /**
     * Replace a Brand Replaces a brand by `brandId` Passing an invalid `brandId` returns a
     * `404 Not Found` status code with the error code `E0000007`. Not providing
     * `agreeToCustomPrivacyPolicy` with `customPrivacyPolicyUrl` returns a `400 Bad
     * Request` status code with the error code `E0000001`.
     *
     * @param brandId
     *            The ID of the brand (required)
     * @param brand
     *            (required)
     * @param additionalHeaders
     *            additionalHeaders for this call
     *
     * @return Brand
     *
     * @throws ApiException
     *             if fails to make API call
     */
    public Brand replaceBrand(String brandId, BrandRequest brand, Map additionalHeaders)
            throws ApiException {
        Object localVarPostBody = brand;

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

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

        // create path and map variables
        String localVarPath = "/api/v1/brands/{brandId}".replaceAll("\\{" + "brandId" + "\\}",
                apiClient.escapeString(brandId.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