// tslint:disable /** * Copyright 2022 Splunk, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"): you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * * Provisioner * With the Provisioner service in Splunk Cloud Services, you can provision and manage tenants. * * OpenAPI spec version: v1beta1.4 (recommended default) * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { InviteBody, InviteInfo, Invites, TenantInfo, Tenants, UpdateInviteBody, } from '../models'; import BaseApiService from "../../../../baseapiservice"; import { ProvisionerServiceExtensions } from "../../../../service_extensions/provisioner"; import { SplunkError, RequestStatus } from '../../../../client'; export const PROVISIONER_SERVICE_PREFIX: string = '/provisioner/v1beta1'; export const PROVISIONER_SERVICE_CLUSTER: string = 'api'; /** * Provisioner * Version: v1beta1.4 * With the Provisioner service in Splunk Cloud Services, you can provision and manage tenants. */ export class GeneratedProvisionerService extends BaseApiService { getServiceCluster() : string { return PROVISIONER_SERVICE_CLUSTER } getServicePrefix() : string { return PROVISIONER_SERVICE_PREFIX; } /** * Creates an invitation for a person to join the tenant using their email address. * @param inviteBody * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return InviteInfo */ public createInvite = (inviteBody: InviteBody, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/provisioner/v1beta1/invites`; return this.client.post(PROVISIONER_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), inviteBody, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as InviteInfo); } /** * Removes an invitation in the given tenant. * @param inviteId * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteInvite = (inviteId: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { inviteId: inviteId }; const path = this.template`/provisioner/v1beta1/invites/${'inviteId'}`(path_params); return this.client.delete(PROVISIONER_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Returns an invitation in the given tenant. * @param inviteId * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return InviteInfo */ public getInvite = (inviteId: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { inviteId: inviteId }; const path = this.template`/provisioner/v1beta1/invites/${'inviteId'}`(path_params); return this.client.get(PROVISIONER_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as InviteInfo); } /** * Returns a specific tenant. * @param tenantName * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return TenantInfo */ public getTenant = (tenantName: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { tenantName: tenantName }; const path = this.template`/system/provisioner/v1beta1/tenants/${'tenantName'}`(path_params); return this.client.get(PROVISIONER_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as TenantInfo); } /** * Returns a list of invitations in a given tenant. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Invites */ public listInvites = (args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/provisioner/v1beta1/invites`; return this.client.get(PROVISIONER_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Invites); } /** * Returns all tenants that the user can read. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Tenants */ public listTenants = (args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/system/provisioner/v1beta1/tenants`; return this.client.get(PROVISIONER_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Tenants); } /** * Modifies an invitation in the given tenant. * @param inviteId * @param updateInviteBody * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return InviteInfo */ public updateInvite = (inviteId: string, updateInviteBody: UpdateInviteBody, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { inviteId: inviteId }; const path = this.template`/provisioner/v1beta1/invites/${'inviteId'}`(path_params); return this.client.patch(PROVISIONER_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), updateInviteBody, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as InviteInfo); } } export type ProvisionerService = GeneratedProvisionerService & ProvisionerServiceExtensions; export const ProvisionerService = ProvisionerServiceExtensions(GeneratedProvisionerService);