/* tslint:disable */
/* eslint-disable */
/**
* Squad API
* API for managing Squad resources
*
* The version of the OpenAPI document: 0.14.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { V1DataIngressPost201Response } from "../models/index.js";
import { V1DataIngressPost201ResponseFromJSON } from "../models/index.js";
import * as runtime from "../runtime.js";
export interface OrganisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePostRequest {
orgId: string;
workspaceId: string;
feedbackSource: string;
body: string;
}
export interface OrganisationsOrgIdWorkspacesWorkspaceIdDataIngressPostRequest {
orgId: string;
workspaceId: string;
body: string;
}
export interface V1DataIngressFeedbackSourcePostRequest {
feedbackSource: string;
body: string;
}
export interface V1DataIngressPostRequest {
body: string;
}
/**
*
*/
export class DataIngressApi extends runtime.BaseAPI {
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async organisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePostRaw(
requestParameters: OrganisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<V1DataIngressPost201Response>> {
if (requestParameters["orgId"] == null) {
throw new runtime.RequiredError(
"orgId",
'Required parameter "orgId" was null or undefined when calling organisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePost().',
);
}
if (requestParameters["workspaceId"] == null) {
throw new runtime.RequiredError(
"workspaceId",
'Required parameter "workspaceId" was null or undefined when calling organisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePost().',
);
}
if (requestParameters["feedbackSource"] == null) {
throw new runtime.RequiredError(
"feedbackSource",
'Required parameter "feedbackSource" was null or undefined when calling organisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePost().',
);
}
if (requestParameters["body"] == null) {
throw new runtime.RequiredError(
"body",
'Required parameter "body" was null or undefined when calling organisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePost().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "text/plain";
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearerAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request(
{
path: `/organisations/{orgId}/workspaces/{workspaceId}/data-ingress/{feedbackSource}`
.replace(
`{${"orgId"}}`,
encodeURIComponent(String(requestParameters["orgId"])),
)
.replace(
`{${"workspaceId"}}`,
encodeURIComponent(String(requestParameters["workspaceId"])),
)
.replace(
`{${"feedbackSource"}}`,
encodeURIComponent(String(requestParameters["feedbackSource"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, jsonValue =>
V1DataIngressPost201ResponseFromJSON(jsonValue),
);
}
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async organisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePost(
requestParameters: OrganisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<V1DataIngressPost201Response> {
const response =
await this.organisationsOrgIdWorkspacesWorkspaceIdDataIngressFeedbackSourcePostRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async organisationsOrgIdWorkspacesWorkspaceIdDataIngressPostRaw(
requestParameters: OrganisationsOrgIdWorkspacesWorkspaceIdDataIngressPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<V1DataIngressPost201Response>> {
if (requestParameters["orgId"] == null) {
throw new runtime.RequiredError(
"orgId",
'Required parameter "orgId" was null or undefined when calling organisationsOrgIdWorkspacesWorkspaceIdDataIngressPost().',
);
}
if (requestParameters["workspaceId"] == null) {
throw new runtime.RequiredError(
"workspaceId",
'Required parameter "workspaceId" was null or undefined when calling organisationsOrgIdWorkspacesWorkspaceIdDataIngressPost().',
);
}
if (requestParameters["body"] == null) {
throw new runtime.RequiredError(
"body",
'Required parameter "body" was null or undefined when calling organisationsOrgIdWorkspacesWorkspaceIdDataIngressPost().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "text/plain";
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearerAuth", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request(
{
path: `/organisations/{orgId}/workspaces/{workspaceId}/data-ingress`
.replace(
`{${"orgId"}}`,
encodeURIComponent(String(requestParameters["orgId"])),
)
.replace(
`{${"workspaceId"}}`,
encodeURIComponent(String(requestParameters["workspaceId"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, jsonValue =>
V1DataIngressPost201ResponseFromJSON(jsonValue),
);
}
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async organisationsOrgIdWorkspacesWorkspaceIdDataIngressPost(
requestParameters: OrganisationsOrgIdWorkspacesWorkspaceIdDataIngressPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<V1DataIngressPost201Response> {
const response =
await this.organisationsOrgIdWorkspacesWorkspaceIdDataIngressPostRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async v1DataIngressFeedbackSourcePostRaw(
requestParameters: V1DataIngressFeedbackSourcePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<V1DataIngressPost201Response>> {
if (requestParameters["feedbackSource"] == null) {
throw new runtime.RequiredError(
"feedbackSource",
'Required parameter "feedbackSource" was null or undefined when calling v1DataIngressFeedbackSourcePost().',
);
}
if (requestParameters["body"] == null) {
throw new runtime.RequiredError(
"body",
'Required parameter "body" was null or undefined when calling v1DataIngressFeedbackSourcePost().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "text/plain";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // apiKeyAuth authentication
}
const response = await this.request(
{
path: `/v1/data-ingress/{feedbackSource}`.replace(
`{${"feedbackSource"}}`,
encodeURIComponent(String(requestParameters["feedbackSource"])),
),
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, jsonValue =>
V1DataIngressPost201ResponseFromJSON(jsonValue),
);
}
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async v1DataIngressFeedbackSourcePost(
requestParameters: V1DataIngressFeedbackSourcePostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<V1DataIngressPost201Response> {
const response = await this.v1DataIngressFeedbackSourcePostRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async v1DataIngressPostRaw(
requestParameters: V1DataIngressPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<V1DataIngressPost201Response>> {
if (requestParameters["body"] == null) {
throw new runtime.RequiredError(
"body",
'Required parameter "body" was null or undefined when calling v1DataIngressPost().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "text/plain";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // apiKeyAuth authentication
}
const response = await this.request(
{
path: `/v1/data-ingress`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, jsonValue =>
V1DataIngressPost201ResponseFromJSON(jsonValue),
);
}
/**
* Receives feedback data and processes it for a specific workspace and organization
* Process feedback for a workspace
*/
async v1DataIngressPost(
requestParameters: V1DataIngressPostRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<V1DataIngressPost201Response> {
const response = await this.v1DataIngressPostRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}