From 849f2a7c4162fe89f941f3c7b2e87b5395b74d28 Mon Sep 17 00:00:00 2001 From: generalpy Date: Thu, 20 Jun 2024 13:20:32 +0530 Subject: [PATCH 1/2] Added get API spec for report exports --- .../paths/spender@reports@exports.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/spender/paths/spender@reports@exports.yaml b/src/spender/paths/spender@reports@exports.yaml index 3e20696fc..0e1d077b3 100644 --- a/src/spender/paths/spender@reports@exports.yaml +++ b/src/spender/paths/spender@reports@exports.yaml @@ -1,3 +1,56 @@ +get: + tags: + - Reports + summary: Get report export requests. + operationId: report_exports_get + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + parameters: + - $ref: ../../components/parameters/q.yaml + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + count: + description: | + The total number of objects that can be requested. + type: integer + example: 10000 + offset: + description: > + offset is used to skip that many number of objects before + counting.
+ + For example, if there are 2000 objects,
+ + The first request will have offset as 0 and limit as 1000 to + return first 1000 objects.
+ + The second request will have offset as 1000 and limit as 1000 + to return next 1000 objects.
+ type: integer + example: 10 + data: + type: array + items: + $ref: '../../components/schemas/reports_exports.yaml#/reports_exports_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: ../../components/schemas/400.yaml + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + post: tags: - Reports From d7c9c7585ccff85e0a83bf56bfd65400d457aba1 Mon Sep 17 00:00:00 2001 From: Siva Date: Thu, 20 Jun 2024 07:53:22 +0000 Subject: [PATCH 2/2] Auto generate API docs --- reference/spender.yaml | 96 +++++++++++++++++++++++++++++++----------- 1 file changed, 71 insertions(+), 25 deletions(-) diff --git a/reference/spender.yaml b/reference/spender.yaml index 2035879f8..62facd2dc 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -3481,31 +3481,6 @@ components: Formula to transform the data in the column. description: | Configure the columns to show in the export file. - reports_exports_in: - type: object - additionalProperties: false - required: - - query_params - - notify_emails - - config - properties: - query_params: - allOf: - - $ref: '#/components/schemas/query_params' - nullable: false - notify_emails: - type: array - nullable: false - items: - $ref: '#/components/schemas/email' - description: | - List of emails to notify when the export is ready. - config: - allOf: - - $ref: '#/components/schemas/reports_export_config' - nullable: false - description: | - Configuration for the export. reports_exports_out: type: object additionalProperties: false @@ -3552,6 +3527,31 @@ components: description: | Status of the export. example: PENDING + reports_exports_in: + type: object + additionalProperties: false + required: + - query_params + - notify_emails + - config + properties: + query_params: + allOf: + - $ref: '#/components/schemas/query_params' + nullable: false + notify_emails: + type: array + nullable: false + items: + $ref: '#/components/schemas/email' + description: | + List of emails to notify when the export is ready. + config: + allOf: + - $ref: '#/components/schemas/reports_export_config' + nullable: false + description: | + Configuration for the export. advance_out_embed: type: object nullable: true @@ -9949,6 +9949,52 @@ paths: schema: $ref: '#/components/schemas/404' /spender/reports/exports: + get: + tags: + - Reports + summary: Get report export requests. + operationId: report_exports_get + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + parameters: + - $ref: '#/components/parameters/q' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + count: + description: | + The total number of objects that can be requested. + type: integer + example: 10000 + offset: + description: | + offset is used to skip that many number of objects before counting.
+ For example, if there are 2000 objects,
+ The first request will have offset as 0 and limit as 1000 to return first 1000 objects.
+ The second request will have offset as 1000 and limit as 1000 to return next 1000 objects.
+ type: integer + example: 10 + data: + type: array + items: + $ref: '#/components/schemas/reports_exports_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' post: tags: - Reports