-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added flows and forms intital endpoints
- Loading branch information
1 parent
0c8a4aa
commit 7e2b5f4
Showing
6 changed files
with
2,097 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
import * as runtime from '../../../lib/runtime.js'; | ||
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js'; | ||
import type { | ||
GetFlows200Response, | ||
PatchFlowsByIdRequest, | ||
PostFlows201Response, | ||
PostFlowsRequest, | ||
GetFlows200ResponseOneOf, | ||
GetFlows200ResponseOneOfInner, | ||
GetFlowsRequest, | ||
GetFlowsByIdRequest, | ||
PatchFlowsByIdOperationRequest, | ||
} from '../models/index.js'; | ||
|
||
const { BaseAPI } = runtime; | ||
|
||
/** | ||
* | ||
*/ | ||
export class FlowsManager extends BaseAPI { | ||
/** | ||
* Get flows | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async getFlows( | ||
requestParameters: GetFlowsRequest & { include_totals: true }, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<GetFlows200ResponseOneOf>>; | ||
async getFlows( | ||
requestParameters?: GetFlowsRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<Array<GetFlows200ResponseOneOfInner>>>; | ||
async getFlows( | ||
requestParameters: GetFlowsRequest = {}, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<GetFlows200Response>> { | ||
const queryParameters = runtime.applyQueryParams(requestParameters, [ | ||
{ | ||
key: 'page', | ||
config: {}, | ||
}, | ||
{ | ||
key: 'per_page', | ||
config: {}, | ||
}, | ||
{ | ||
key: 'include_totals', | ||
config: {}, | ||
}, | ||
{ | ||
key: 'hydrate', | ||
config: { | ||
isArray: true, | ||
isCollectionFormatMulti: true, | ||
}, | ||
}, | ||
{ | ||
key: 'synchronous', | ||
config: {}, | ||
}, | ||
]); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/flows`, | ||
method: 'GET', | ||
query: queryParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Get a flow | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async getFlowsById( | ||
requestParameters: GetFlowsByIdRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<PostFlows201Response>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const queryParameters = runtime.applyQueryParams(requestParameters, [ | ||
{ | ||
key: 'hydrate', | ||
config: { | ||
isArray: true, | ||
isCollectionFormatMulti: true, | ||
}, | ||
}, | ||
]); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/flows/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), | ||
method: 'GET', | ||
query: queryParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Update a flow | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async patchFlowsById( | ||
requestParameters: PatchFlowsByIdOperationRequest, | ||
bodyParameters: PatchFlowsByIdRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<PostFlows201Response>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/flows/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), | ||
method: 'PATCH', | ||
headers: headerParameters, | ||
body: bodyParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Create a flow | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async postFlows( | ||
bodyParameters: PostFlowsRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<PostFlows201Response>> { | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/flows`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
body: bodyParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
import * as runtime from '../../../lib/runtime.js'; | ||
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js'; | ||
import type { | ||
GetForms200Response, | ||
PatchFormsByIdRequest, | ||
PostForms201Response, | ||
PostFormsRequest, | ||
GetForms200ResponseOneOf, | ||
GetForms200ResponseOneOfInner, | ||
GetFormsRequest, | ||
GetFormsByIdRequest, | ||
PatchFormsByIdOperationRequest, | ||
} from '../models/index.js'; | ||
|
||
const { BaseAPI } = runtime; | ||
|
||
/** | ||
* | ||
*/ | ||
export class FormsManager extends BaseAPI { | ||
/** | ||
* Get forms | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async getForms( | ||
requestParameters: GetFormsRequest & { include_totals: true }, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<GetForms200ResponseOneOf>>; | ||
async getForms( | ||
requestParameters?: GetFormsRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<Array<GetForms200ResponseOneOfInner>>>; | ||
async getForms( | ||
requestParameters: GetFormsRequest = {}, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<GetForms200Response>> { | ||
const queryParameters = runtime.applyQueryParams(requestParameters, [ | ||
{ | ||
key: 'page', | ||
config: {}, | ||
}, | ||
{ | ||
key: 'per_page', | ||
config: {}, | ||
}, | ||
{ | ||
key: 'include_totals', | ||
config: {}, | ||
}, | ||
{ | ||
key: 'hydrate', | ||
config: { | ||
isArray: true, | ||
isCollectionFormatMulti: true, | ||
}, | ||
}, | ||
]); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/forms`, | ||
method: 'GET', | ||
query: queryParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Get a form | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async getFormsById( | ||
requestParameters: GetFormsByIdRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<PostForms201Response>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const queryParameters = runtime.applyQueryParams(requestParameters, [ | ||
{ | ||
key: 'hydrate', | ||
config: { | ||
isArray: true, | ||
isCollectionFormatMulti: true, | ||
}, | ||
}, | ||
]); | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/forms/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), | ||
method: 'GET', | ||
query: queryParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Update a form | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async patchFormsById( | ||
requestParameters: PatchFormsByIdOperationRequest, | ||
bodyParameters: PatchFormsByIdRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<PostForms201Response>> { | ||
runtime.validateRequiredRequestParams(requestParameters, ['id']); | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/forms/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))), | ||
method: 'PATCH', | ||
headers: headerParameters, | ||
body: bodyParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
|
||
/** | ||
* Create a form | ||
* | ||
* @throws {RequiredError} | ||
*/ | ||
async postForms( | ||
bodyParameters: PostFormsRequest, | ||
initOverrides?: InitOverride | ||
): Promise<ApiResponse<PostForms201Response>> { | ||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/forms`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
body: bodyParameters, | ||
}, | ||
initOverrides | ||
); | ||
|
||
return runtime.JSONApiResponse.fromResponse(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.