Skip to content

Commit

Permalink
Updating route for responding to delivery alert
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Mar 18, 2024
1 parent 86715de commit c1124b2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 45 deletions.
55 changes: 18 additions & 37 deletions packages/api-client/lib/openapi/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5829,7 +5829,7 @@ export const DeliveryAlertsApiAxiosParamCreator = function (configuration?: Conf
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost: async (
respondToDeliveryAlertDeliveryAlertsResponsePost: async (
deliveryAlertId: string,
category: ApiServerModelsDeliveryAlertsDeliveryAlertCategory,
tier: ApiServerModelsDeliveryAlertsDeliveryAlertTier,
Expand All @@ -5840,44 +5840,21 @@ export const DeliveryAlertsApiAxiosParamCreator = function (configuration?: Conf
): Promise<RequestArgs> => {
// verify required parameter 'deliveryAlertId' is not null or undefined
assertParamExists(
'respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost',
'respondToDeliveryAlertDeliveryAlertsResponsePost',
'deliveryAlertId',
deliveryAlertId,
);
// verify required parameter 'category' is not null or undefined
assertParamExists(
'respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost',
'category',
category,
);
assertParamExists('respondToDeliveryAlertDeliveryAlertsResponsePost', 'category', category);
// verify required parameter 'tier' is not null or undefined
assertParamExists(
'respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost',
'tier',
tier,
);
assertParamExists('respondToDeliveryAlertDeliveryAlertsResponsePost', 'tier', tier);
// verify required parameter 'taskId' is not null or undefined
assertParamExists(
'respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost',
'taskId',
taskId,
);
assertParamExists('respondToDeliveryAlertDeliveryAlertsResponsePost', 'taskId', taskId);
// verify required parameter 'action' is not null or undefined
assertParamExists(
'respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost',
'action',
action,
);
assertParamExists('respondToDeliveryAlertDeliveryAlertsResponsePost', 'action', action);
// verify required parameter 'message' is not null or undefined
assertParamExists(
'respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost',
'message',
message,
);
const localVarPath = `/delivery_alerts/{delivery_alert_id}/response`.replace(
`{${'delivery_alert_id'}}`,
encodeURIComponent(String(deliveryAlertId)),
);
assertParamExists('respondToDeliveryAlertDeliveryAlertsResponsePost', 'message', message);
const localVarPath = `/delivery_alerts/response`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
Expand All @@ -5889,6 +5866,10 @@ export const DeliveryAlertsApiAxiosParamCreator = function (configuration?: Conf
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

if (deliveryAlertId !== undefined) {
localVarQueryParameter['delivery_alert_id'] = deliveryAlertId;
}

if (category !== undefined) {
localVarQueryParameter['category'] = category;
}
Expand Down Expand Up @@ -5944,7 +5925,7 @@ export const DeliveryAlertsApiFp = function (configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
async respondToDeliveryAlertDeliveryAlertsResponsePost(
deliveryAlertId: string,
category: ApiServerModelsDeliveryAlertsDeliveryAlertCategory,
tier: ApiServerModelsDeliveryAlertsDeliveryAlertTier,
Expand All @@ -5954,7 +5935,7 @@ export const DeliveryAlertsApiFp = function (configuration?: Configuration) {
options?: AxiosRequestConfig,
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeliveryAlert>> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
await localVarAxiosParamCreator.respondToDeliveryAlertDeliveryAlertsResponsePost(
deliveryAlertId,
category,
tier,
Expand Down Expand Up @@ -5991,7 +5972,7 @@ export const DeliveryAlertsApiFactory = function (
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
respondToDeliveryAlertDeliveryAlertsResponsePost(
deliveryAlertId: string,
category: ApiServerModelsDeliveryAlertsDeliveryAlertCategory,
tier: ApiServerModelsDeliveryAlertsDeliveryAlertTier,
Expand All @@ -6001,7 +5982,7 @@ export const DeliveryAlertsApiFactory = function (
options?: any,
): AxiosPromise<DeliveryAlert> {
return localVarFp
.respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
.respondToDeliveryAlertDeliveryAlertsResponsePost(
deliveryAlertId,
category,
tier,
Expand Down Expand Up @@ -6035,7 +6016,7 @@ export class DeliveryAlertsApi extends BaseAPI {
* @throws {RequiredError}
* @memberof DeliveryAlertsApi
*/
public respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
public respondToDeliveryAlertDeliveryAlertsResponsePost(
deliveryAlertId: string,
category: ApiServerModelsDeliveryAlertsDeliveryAlertCategory,
tier: ApiServerModelsDeliveryAlertsDeliveryAlertTier,
Expand All @@ -6045,7 +6026,7 @@ export class DeliveryAlertsApi extends BaseAPI {
options?: AxiosRequestConfig,
) {
return DeliveryAlertsApiFp(this.configuration)
.respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
.respondToDeliveryAlertDeliveryAlertsResponsePost(
deliveryAlertId,
category,
tier,
Expand Down
2 changes: 1 addition & 1 deletion packages/api-client/lib/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { version as rmfModelVer } from 'rmf-models';

export const version = {
rmfModels: rmfModelVer,
rmfServer: '1403b63032764b781ef1ba349e50a9d895204bbb',
rmfServer: '86715def238ed33950e68fdc2414317be9de8e7d',
openapiGenerator: '6.2.1',
};
6 changes: 3 additions & 3 deletions packages/api-client/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,17 @@ export default {
},
},
},
'/delivery_alerts/{delivery_alert_id}/response': {
'/delivery_alerts/response': {
post: {
tags: ['DeliveryAlerts'],
summary: 'Respond To Delivery Alert',
operationId: 'respond_to_delivery_alert_delivery_alerts__delivery_alert_id__response_post',
operationId: 'respond_to_delivery_alert_delivery_alerts_response_post',
parameters: [
{
required: true,
schema: { title: 'Delivery Alert Id', type: 'string' },
name: 'delivery_alert_id',
in: 'path',
in: 'query',
},
{
required: true,
Expand Down
3 changes: 2 additions & 1 deletion packages/api-server/api_server/routes/delivery_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async def sub_delivery_alerts(_req: SubscriptionRequest):
return rmf_events.delivery_alerts.pipe(rxops.filter(lambda x: x is not None))


@router.post("/{delivery_alert_id}/response", response_model=DeliveryAlert)
@router.post("/response", response_model=DeliveryAlert)
async def respond_to_delivery_alert(
delivery_alert_id: str,
category: DeliveryAlert.Category,
Expand Down Expand Up @@ -51,3 +51,4 @@ async def respond_to_delivery_alert(
message=delivery_alert.message,
)
rmf_events.delivery_alerts.on_next(delivery_alert)
return DeliveryAlert
6 changes: 3 additions & 3 deletions packages/dashboard/src/components/delivery-alert-store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const DeliveryWarningDialog = React.memo((props: DeliveryWarningDialogProps) =>
) {
(async () => {
try {
await rmf.deliveryAlertsApi.respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
await rmf.deliveryAlertsApi.respondToDeliveryAlertDeliveryAlertsResponsePost(
deliveryAlert.id,
deliveryAlert.category,
deliveryAlert.tier,
Expand Down Expand Up @@ -500,7 +500,7 @@ export const DeliveryAlertStore = React.memo(() => {
if (!rmf) {
throw new Error('delivery alert api not available');
}
await rmf.deliveryAlertsApi.respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
await rmf.deliveryAlertsApi.respondToDeliveryAlertDeliveryAlertsResponsePost(
delivery_alert.id,
delivery_alert.category,
delivery_alert.tier,
Expand Down Expand Up @@ -536,7 +536,7 @@ export const DeliveryAlertStore = React.memo(() => {
if (!rmf) {
throw new Error('delivery alert api not available');
}
await rmf.deliveryAlertsApi.respondToDeliveryAlertDeliveryAlertsDeliveryAlertIdResponsePost(
await rmf.deliveryAlertsApi.respondToDeliveryAlertDeliveryAlertsResponsePost(
delivery_alert.id,
delivery_alert.category,
delivery_alert.tier,
Expand Down

0 comments on commit c1124b2

Please sign in to comment.