Skip to content

Commit

Permalink
Add initial support for reports
Browse files Browse the repository at this point in the history
  • Loading branch information
booxter committed Nov 20, 2024
1 parent 48e39a9 commit 8ca1938
Show file tree
Hide file tree
Showing 44 changed files with 3,439 additions and 10 deletions.
9 changes: 9 additions & 0 deletions js/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
README.md
docs/ArrayOfDirectors.md
docs/ArrayOfFilms.md
docs/ArrayOfReports.md
docs/DefaultApi.md
docs/Director.md
docs/DirectorFilmsInner.md
docs/DirectorFilmsInnerCountriesInner.md
docs/DirectorFilmsInnerOffersInner.md
docs/DirectorInfo.md
docs/Film.md
docs/Report.md
docs/ReportSectionsInner.md
git_push.sh
mocha.opts
package.json
Expand All @@ -20,18 +23,24 @@ src/api/DefaultApi.js
src/index.js
src/model/ArrayOfDirectors.js
src/model/ArrayOfFilms.js
src/model/ArrayOfReports.js
src/model/Director.js
src/model/DirectorFilmsInner.js
src/model/DirectorFilmsInnerCountriesInner.js
src/model/DirectorFilmsInnerOffersInner.js
src/model/DirectorInfo.js
src/model/Film.js
src/model/Report.js
src/model/ReportSectionsInner.js
test/api/DefaultApi.spec.js
test/model/ArrayOfDirectors.spec.js
test/model/ArrayOfFilms.spec.js
test/model/ArrayOfReports.spec.js
test/model/Director.spec.js
test/model/DirectorFilmsInner.spec.js
test/model/DirectorFilmsInnerCountriesInner.spec.js
test/model/DirectorFilmsInnerOffersInner.spec.js
test/model/DirectorInfo.spec.js
test/model/Film.spec.js
test/model/Report.spec.js
test/model/ReportSectionsInner.spec.js
5 changes: 5 additions & 0 deletions js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,23 @@ Class | Method | HTTP request | Description
*LetsrolldApi.DefaultApi* | [**directorsIdGet**](docs/DefaultApi.md#directorsIdGet) | **GET** /directors/{id} | Get Director
*LetsrolldApi.DefaultApi* | [**filmsGet**](docs/DefaultApi.md#filmsGet) | **GET** /films | Get Films
*LetsrolldApi.DefaultApi* | [**filmsIdGet**](docs/DefaultApi.md#filmsIdGet) | **GET** /films/{id} | Get Film
*LetsrolldApi.DefaultApi* | [**reportsGet**](docs/DefaultApi.md#reportsGet) | **GET** /reports | List Reports
*LetsrolldApi.DefaultApi* | [**reportsIdGet**](docs/DefaultApi.md#reportsIdGet) | **GET** /reports/{id} | Execute Report


## Documentation for Models

- [LetsrolldApi.ArrayOfDirectors](docs/ArrayOfDirectors.md)
- [LetsrolldApi.ArrayOfFilms](docs/ArrayOfFilms.md)
- [LetsrolldApi.ArrayOfReports](docs/ArrayOfReports.md)
- [LetsrolldApi.Director](docs/Director.md)
- [LetsrolldApi.DirectorFilmsInner](docs/DirectorFilmsInner.md)
- [LetsrolldApi.DirectorFilmsInnerCountriesInner](docs/DirectorFilmsInnerCountriesInner.md)
- [LetsrolldApi.DirectorFilmsInnerOffersInner](docs/DirectorFilmsInnerOffersInner.md)
- [LetsrolldApi.DirectorInfo](docs/DirectorInfo.md)
- [LetsrolldApi.Film](docs/Film.md)
- [LetsrolldApi.Report](docs/Report.md)
- [LetsrolldApi.ReportSectionsInner](docs/ReportSectionsInner.md)


## Documentation for Authorization
Expand Down
8 changes: 8 additions & 0 deletions js/docs/ArrayOfReports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# LetsrolldApi.ArrayOfReports

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------


84 changes: 84 additions & 0 deletions js/docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Method | HTTP request | Description
[**directorsIdGet**](DefaultApi.md#directorsIdGet) | **GET** /directors/{id} | Get Director
[**filmsGet**](DefaultApi.md#filmsGet) | **GET** /films | Get Films
[**filmsIdGet**](DefaultApi.md#filmsIdGet) | **GET** /films/{id} | Get Film
[**reportsGet**](DefaultApi.md#reportsGet) | **GET** /reports | List Reports
[**reportsIdGet**](DefaultApi.md#reportsIdGet) | **GET** /reports/{id} | Execute Report



Expand Down Expand Up @@ -192,3 +194,85 @@ No authorization required
- **Content-Type**: Not defined
- **Accept**: application/json


## reportsGet

> [Object] reportsGet()
List Reports

### Example

```javascript
import LetsrolldApi from 'letsrolld_api';

let apiInstance = new LetsrolldApi.DefaultApi();
apiInstance.reportsGet((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```

### Parameters

This endpoint does not need any parameter.

### Return type

**[Object]**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## reportsIdGet

> Report reportsIdGet(id)
Execute Report

### Example

```javascript
import LetsrolldApi from 'letsrolld_api';

let apiInstance = new LetsrolldApi.DefaultApi();
let id = 56; // Number | id
apiInstance.reportsIdGet(id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **Number**| id |

### Return type

[**Report**](Report.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

11 changes: 11 additions & 0 deletions js/docs/Report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# LetsrolldApi.Report

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Number** | |
**name** | **String** | |
**sections** | [**[ReportSectionsInner]**](ReportSectionsInner.md) | | [optional]


10 changes: 10 additions & 0 deletions js/docs/ReportSectionsInner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LetsrolldApi.ReportSectionsInner

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | |
**films** | [**[DirectorFilmsInner]**](DirectorFilmsInner.md) | |


79 changes: 79 additions & 0 deletions js/src/api/DefaultApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import ApiClient from "../ApiClient";
import Director from '../model/Director';
import Film from '../model/Film';
import Report from '../model/Report';

/**
* Default service.
Expand Down Expand Up @@ -205,5 +206,83 @@ export default class DefaultApi {
);
}

/**
* Callback function to receive the result of the reportsGet operation.
* @callback module:api/DefaultApi~reportsGetCallback
* @param {String} error Error message, if any.
* @param {Array.<Object>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/

/**
* List Reports
* @param {module:api/DefaultApi~reportsGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<Object>}
*/
reportsGet(callback) {
let postBody = null;

let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};

let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = [Object];
return this.apiClient.callApi(
'/reports', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}

/**
* Callback function to receive the result of the reportsIdGet operation.
* @callback module:api/DefaultApi~reportsIdGetCallback
* @param {String} error Error message, if any.
* @param {module:model/Report} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/

/**
* Execute Report
* @param {Number} id id
* @param {module:api/DefaultApi~reportsIdGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Report}
*/
reportsIdGet(id, callback) {
let postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling reportsIdGet");
}

let pathParams = {
'id': id
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};

let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = Report;
return this.apiClient.callApi(
'/reports/{id}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}


}
21 changes: 21 additions & 0 deletions js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
import ApiClient from './ApiClient';
import ArrayOfDirectors from './model/ArrayOfDirectors';
import ArrayOfFilms from './model/ArrayOfFilms';
import ArrayOfReports from './model/ArrayOfReports';
import Director from './model/Director';
import DirectorFilmsInner from './model/DirectorFilmsInner';
import DirectorFilmsInnerCountriesInner from './model/DirectorFilmsInnerCountriesInner';
import DirectorFilmsInnerOffersInner from './model/DirectorFilmsInnerOffersInner';
import DirectorInfo from './model/DirectorInfo';
import Film from './model/Film';
import Report from './model/Report';
import ReportSectionsInner from './model/ReportSectionsInner';
import DefaultApi from './api/DefaultApi';


Expand Down Expand Up @@ -74,6 +77,12 @@ export {
*/
ArrayOfFilms,

/**
* The ArrayOfReports model constructor.
* @property {module:model/ArrayOfReports}
*/
ArrayOfReports,

/**
* The Director model constructor.
* @property {module:model/Director}
Expand Down Expand Up @@ -110,6 +119,18 @@ export {
*/
Film,

/**
* The Report model constructor.
* @property {module:model/Report}
*/
Report,

/**
* The ReportSectionsInner model constructor.
* @property {module:model/ReportSectionsInner}
*/
ReportSectionsInner,

/**
* The DefaultApi service constructor.
* @property {module:api/DefaultApi}
Expand Down
Loading

0 comments on commit 8ca1938

Please sign in to comment.