aboutsummaryrefslogtreecommitdiff
path: root/src/api/apis/report-api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/apis/report-api.ts')
-rw-r--r--src/api/apis/report-api.ts144
1 files changed, 144 insertions, 0 deletions
diff --git a/src/api/apis/report-api.ts b/src/api/apis/report-api.ts
new file mode 100644
index 0000000..d3f74b8
--- /dev/null
+++ b/src/api/apis/report-api.ts
@@ -0,0 +1,144 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * General Research Full Service Brokerage API
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
+ *
+ * OpenAPI spec version: 1.1.0
+ *
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
+import { Configuration } from '../configuration';
+// Some imports not used depending on template conditions
+// @ts-ignore
+import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
+import { HTTPValidationError } from '../models';
+import { ReportTask } from '../models';
+import { StatusResponse } from '../models';
+/**
+ * ReportApi - axios parameter creator
+ * @export
+ */
+export const ReportApiAxiosParamCreator = function (configuration?: Configuration) {
+ return {
+ /**
+ * Send a \"Task Report\" for a respondent's latest started survey, regardless of the survey's outcome. Task Reports cannot be provided for task attempts by tsid, or through any other method, they must be given immediately after the respondent's task attempt. If a latest attempt can't be found, a ReportTaskResponse is still returned. If multiple reasons want to be provided, they should be done at the same time. If multiple reports are given for the same latest started task, the note attribute will be overwritten, while the new unique reasons will be appended to the task attempt. Task Report system contributions by client applications are immediately leveraged to aid yield management strategies. For those reasons, it's important that the respondent submits a Task Report as soon as possible and applications doesn't offload this request for a later time. Task Report timestamps are a critical component of understanding a Task experience for a respondent. For the BP to tell us about a bad survey they want to report The POSTed data looks like: { 'bpuid': '1234', 'reasons': [2], 'notes': \"This survey was the worst!\" } Returns {'status': 'success', 'msg': error_msg}
+ * @summary Report Task
+ * @param {ReportTask} body
+ * @param {any} productId The Brokerage Product ID provided by GRL.
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ reportTaskProductIdReportPost: async (body: ReportTask, productId: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+ // verify required parameter 'body' is not null or undefined
+ if (body === null || body === undefined) {
+ throw new RequiredError('body','Required parameter body was null or undefined when calling reportTaskProductIdReportPost.');
+ }
+ // verify required parameter 'productId' is not null or undefined
+ if (productId === null || productId === undefined) {
+ throw new RequiredError('productId','Required parameter productId was null or undefined when calling reportTaskProductIdReportPost.');
+ }
+ const localVarPath = `/{product_id}/report/`
+ .replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
+ let baseOptions;
+ if (configuration) {
+ baseOptions = configuration.baseOptions;
+ }
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
+ const localVarHeaderParameter = {} as any;
+ const localVarQueryParameter = {} as any;
+
+ localVarHeaderParameter['Content-Type'] = 'application/json';
+
+ const query = new URLSearchParams(localVarUrlObj.search);
+ for (const key in localVarQueryParameter) {
+ query.set(key, localVarQueryParameter[key]);
+ }
+ for (const key in options.params) {
+ query.set(key, options.params[key]);
+ }
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+ const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
+
+ return {
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
+ options: localVarRequestOptions,
+ };
+ },
+ }
+};
+
+/**
+ * ReportApi - functional programming interface
+ * @export
+ */
+export const ReportApiFp = function(configuration?: Configuration) {
+ return {
+ /**
+ * Send a \"Task Report\" for a respondent's latest started survey, regardless of the survey's outcome. Task Reports cannot be provided for task attempts by tsid, or through any other method, they must be given immediately after the respondent's task attempt. If a latest attempt can't be found, a ReportTaskResponse is still returned. If multiple reasons want to be provided, they should be done at the same time. If multiple reports are given for the same latest started task, the note attribute will be overwritten, while the new unique reasons will be appended to the task attempt. Task Report system contributions by client applications are immediately leveraged to aid yield management strategies. For those reasons, it's important that the respondent submits a Task Report as soon as possible and applications doesn't offload this request for a later time. Task Report timestamps are a critical component of understanding a Task experience for a respondent. For the BP to tell us about a bad survey they want to report The POSTed data looks like: { 'bpuid': '1234', 'reasons': [2], 'notes': \"This survey was the worst!\" } Returns {'status': 'success', 'msg': error_msg}
+ * @summary Report Task
+ * @param {ReportTask} body
+ * @param {any} productId The Brokerage Product ID provided by GRL.
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ async reportTaskProductIdReportPost(body: ReportTask, productId: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<StatusResponse>>> {
+ const localVarAxiosArgs = await ReportApiAxiosParamCreator(configuration).reportTaskProductIdReportPost(body, productId, options);
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
+ return axios.request(axiosRequestArgs);
+ };
+ },
+ }
+};
+
+/**
+ * ReportApi - factory interface
+ * @export
+ */
+export const ReportApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
+ return {
+ /**
+ * Send a \"Task Report\" for a respondent's latest started survey, regardless of the survey's outcome. Task Reports cannot be provided for task attempts by tsid, or through any other method, they must be given immediately after the respondent's task attempt. If a latest attempt can't be found, a ReportTaskResponse is still returned. If multiple reasons want to be provided, they should be done at the same time. If multiple reports are given for the same latest started task, the note attribute will be overwritten, while the new unique reasons will be appended to the task attempt. Task Report system contributions by client applications are immediately leveraged to aid yield management strategies. For those reasons, it's important that the respondent submits a Task Report as soon as possible and applications doesn't offload this request for a later time. Task Report timestamps are a critical component of understanding a Task experience for a respondent. For the BP to tell us about a bad survey they want to report The POSTed data looks like: { 'bpuid': '1234', 'reasons': [2], 'notes': \"This survey was the worst!\" } Returns {'status': 'success', 'msg': error_msg}
+ * @summary Report Task
+ * @param {ReportTask} body
+ * @param {any} productId The Brokerage Product ID provided by GRL.
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ async reportTaskProductIdReportPost(body: ReportTask, productId: any, options?: AxiosRequestConfig): Promise<AxiosResponse<StatusResponse>> {
+ return ReportApiFp(configuration).reportTaskProductIdReportPost(body, productId, options).then((request) => request(axios, basePath));
+ },
+ };
+};
+
+/**
+ * ReportApi - object-oriented interface
+ * @export
+ * @class ReportApi
+ * @extends {BaseAPI}
+ */
+export class ReportApi extends BaseAPI {
+ /**
+ * Send a \"Task Report\" for a respondent's latest started survey, regardless of the survey's outcome. Task Reports cannot be provided for task attempts by tsid, or through any other method, they must be given immediately after the respondent's task attempt. If a latest attempt can't be found, a ReportTaskResponse is still returned. If multiple reasons want to be provided, they should be done at the same time. If multiple reports are given for the same latest started task, the note attribute will be overwritten, while the new unique reasons will be appended to the task attempt. Task Report system contributions by client applications are immediately leveraged to aid yield management strategies. For those reasons, it's important that the respondent submits a Task Report as soon as possible and applications doesn't offload this request for a later time. Task Report timestamps are a critical component of understanding a Task experience for a respondent. For the BP to tell us about a bad survey they want to report The POSTed data looks like: { 'bpuid': '1234', 'reasons': [2], 'notes': \"This survey was the worst!\" } Returns {'status': 'success', 'msg': error_msg}
+ * @summary Report Task
+ * @param {ReportTask} body
+ * @param {any} productId The Brokerage Product ID provided by GRL.
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ * @memberof ReportApi
+ */
+ public async reportTaskProductIdReportPost(body: ReportTask, productId: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<StatusResponse>> {
+ return ReportApiFp(this.configuration).reportTaskProductIdReportPost(body, productId, options).then((request) => request(this.axios, this.basePath));
+ }
+}