diff --git a/.github/workflows/swagger-validate.yml b/.github/workflows/swagger-validate.yml
deleted file mode 100644
index e1ec83b..0000000
--- a/.github/workflows/swagger-validate.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: Swagger Validate
-on: [pull_request]
-jobs:
- swagger-validate:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Install nodejs
- uses: actions/setup-node@v4
- with:
- node-version: '22'
- - name: Install java
- uses: actions/setup-java@v4
- with:
- java-version: '11'
- distribution: 'temurin'
- - name: Install openapi-generator-cli
- run: |
- npm install @openapitools/openapi-generator-cli -g
- - name: Validate swagger.json
- run: |
- openapi-generator-cli validate -i swagger.json
diff --git a/.github/workflows/swagger.yml b/.github/workflows/swagger.yml
index cbab95b..44ccb2c 100644
--- a/.github/workflows/swagger.yml
+++ b/.github/workflows/swagger.yml
@@ -5,14 +5,49 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.x'
- - name: Install dependencies
+
+ - name: Install nodejs
+ uses: actions/setup-node@v4
+ with:
+ node-version: '22'
+
+ - name: Install java
+ uses: actions/setup-java@v4
+ with:
+ java-version: '11'
+ distribution: 'temurin'
+
+ - name: Install make
+ run: |
+ sudo apt-get update
+ sudo apt-get install make
+
+ - name: Install pdm
run: |
python -m pip install --upgrade pip
- pip install .
+ pip install pdm
+
+ - name: Install the package
+ run: |
+ pdm install
+
- name: Re-generate swagger.json
run: |
- diff -u swagger.json <(swagger)
+ diff -u swagger.json <(pdm run swagger)
+
+ - name: Install openapi-generator-cli
+ run: |
+ npm install @openapitools/openapi-generator-cli -g
+
+ - name: Validate swagger.json
+ run: |
+ openapi-generator-cli validate -i swagger.json
+
+ - name: Re-generate client bindings
+ run: |
+ make swagger-all
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 36d931d..6151c5d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -17,4 +17,8 @@ repos:
args: [ --fix ]
# Run the formatter.
- id: ruff-format
-exclude: 'letsrolld-api-client/.*'
+exclude: |
+ (?x)^(
+ letsrolld-api-client/.*|
+ js/.*
+ )$
diff --git a/Makefile b/Makefile
index e199d28..f0ab2d7 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ DIRECTORS_FILE?=directors.csv
RUN_LOG?=run.log
RUN_LOG_CMD?=ts | tee -a $(RUN_LOG)
-.PHONY: install lint mypy test populate run-update-directors run-update-films run-update-offers run-cleanup run-all run-db-upgrade webapp ui swagger swagger_py get-dirs get-films
+.PHONY: install lint mypy test populate run-update-directors run-update-films run-update-offers run-cleanup run-all run-db-upgrade webapp ui swagger swagger-py swagger-js swagger-all get-dirs get-films
install:
pdm install -vd
@@ -44,12 +44,20 @@ webapp:
swagger:
#curl http://localhost:8000/api/doc/swagger.json -o swagger.json
- pdm run swagger > swagger.json
+ pdm run swagger > swagger.json.tmp
+ mv swagger.json.tmp swagger.json
openapi-generator-cli validate -i swagger.json
-swagger_py: swagger
+swagger-py: swagger
+ rm -rf letsrolld-api-client
pdm run openapi-python-client generate --path swagger.json
+swagger-js: swagger
+ rm -rf js
+ openapi-generator-cli generate -i swagger.json -g javascript -o js
+
+swagger-all: swagger-py swagger-js
+
ui:
cd ui && http-server --port 8081 -c-1 -o
diff --git a/js/.babelrc b/js/.babelrc
new file mode 100644
index 0000000..c73df9d
--- /dev/null
+++ b/js/.babelrc
@@ -0,0 +1,33 @@
+{
+ "presets": [
+ "@babel/preset-env"
+ ],
+ "plugins": [
+ "@babel/plugin-syntax-dynamic-import",
+ "@babel/plugin-syntax-import-meta",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-json-strings",
+ [
+ "@babel/plugin-proposal-decorators",
+ {
+ "legacy": true
+ }
+ ],
+ "@babel/plugin-proposal-function-sent",
+ "@babel/plugin-proposal-export-namespace-from",
+ "@babel/plugin-proposal-numeric-separator",
+ "@babel/plugin-proposal-throw-expressions",
+ "@babel/plugin-proposal-export-default-from",
+ "@babel/plugin-proposal-logical-assignment-operators",
+ "@babel/plugin-proposal-optional-chaining",
+ [
+ "@babel/plugin-proposal-pipeline-operator",
+ {
+ "proposal": "minimal"
+ }
+ ],
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "@babel/plugin-proposal-do-expressions",
+ "@babel/plugin-proposal-function-bind"
+ ]
+}
diff --git a/js/.gitignore b/js/.gitignore
new file mode 100644
index 0000000..6a7d6d8
--- /dev/null
+++ b/js/.gitignore
@@ -0,0 +1,130 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+lerna-debug.log*
+.pnpm-debug.log*
+
+# Diagnostic reports (https://nodejs.org/api/report.html)
+report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+*.lcov
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# Snowpack dependency directory (https://snowpack.dev/)
+web_modules/
+
+# TypeScript cache
+*.tsbuildinfo
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional stylelint cache
+.stylelintcache
+
+# Microbundle cache
+.rpt2_cache/
+.rts2_cache_cjs/
+.rts2_cache_es/
+.rts2_cache_umd/
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variable files
+.env
+.env.development.local
+.env.test.local
+.env.production.local
+.env.local
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+.parcel-cache
+
+# Next.js build output
+.next
+out
+
+# Nuxt.js build / generate output
+.nuxt
+dist
+
+# Gatsby files
+.cache/
+# Comment in the public line in if your project uses Gatsby and not Next.js
+# https://nextjs.org/blog/next-9-1#public-directory-support
+# public
+
+# vuepress build output
+.vuepress/dist
+
+# vuepress v2.x temp and cache directory
+.temp
+.cache
+
+# Docusaurus cache and generated files
+.docusaurus
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
+
+# TernJS port file
+.tern-port
+
+# Stores VSCode versions used for testing VSCode extensions
+.vscode-test
+
+# yarn v2
+.yarn/cache
+.yarn/unplugged
+.yarn/build-state.yml
+.yarn/install-state.gz
+.pnp.*
\ No newline at end of file
diff --git a/js/.openapi-generator-ignore b/js/.openapi-generator-ignore
new file mode 100644
index 0000000..7484ee5
--- /dev/null
+++ b/js/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/js/.openapi-generator/FILES b/js/.openapi-generator/FILES
new file mode 100644
index 0000000..e89eb3e
--- /dev/null
+++ b/js/.openapi-generator/FILES
@@ -0,0 +1,37 @@
+.babelrc
+.gitignore
+.openapi-generator-ignore
+.travis.yml
+README.md
+docs/ArrayOfDirectors.md
+docs/ArrayOfFilms.md
+docs/DefaultApi.md
+docs/Director.md
+docs/DirectorFilmsInner.md
+docs/DirectorFilmsInnerCountriesInner.md
+docs/DirectorFilmsInnerOffersInner.md
+docs/DirectorInfo.md
+docs/Film.md
+git_push.sh
+mocha.opts
+package.json
+src/ApiClient.js
+src/api/DefaultApi.js
+src/index.js
+src/model/ArrayOfDirectors.js
+src/model/ArrayOfFilms.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
+test/api/DefaultApi.spec.js
+test/model/ArrayOfDirectors.spec.js
+test/model/ArrayOfFilms.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
diff --git a/js/.openapi-generator/VERSION b/js/.openapi-generator/VERSION
new file mode 100644
index 0000000..73a86b1
--- /dev/null
+++ b/js/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.0.1
\ No newline at end of file
diff --git a/js/.travis.yml b/js/.travis.yml
new file mode 100644
index 0000000..0968f7a
--- /dev/null
+++ b/js/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+cache: npm
+node_js:
+ - "6"
+ - "6.1"
diff --git a/js/README.md b/js/README.md
new file mode 100644
index 0000000..c311d64
--- /dev/null
+++ b/js/README.md
@@ -0,0 +1,146 @@
+# letsrolld_api
+
+LetsrolldApi - JavaScript client for letsrolld_api
+No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 0.1
+- Package version: 0.1
+- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
+
+## Installation
+
+### For [Node.js](https://nodejs.org/)
+
+#### npm
+
+To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
+
+Then install it via:
+
+```shell
+npm install letsrolld_api --save
+```
+
+Finally, you need to build the module:
+
+```shell
+npm run build
+```
+
+##### Local development
+
+To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
+
+```shell
+npm install
+```
+
+Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
+
+```shell
+npm link
+```
+
+To use the link you just defined in your project, switch to the directory you want to use your letsrolld_api from, and run:
+
+```shell
+npm link /path/to/param
.
+ */
+ paramToString(param) {
+ if (param == undefined || param == null) {
+ return '';
+ }
+ if (param instanceof Date) {
+ return param.toJSON();
+ }
+ if (ApiClient.canBeJsonified(param)) {
+ return JSON.stringify(param);
+ }
+
+ return param.toString();
+ }
+
+ /**
+ * Returns a boolean indicating if the parameter could be JSON.stringified
+ * @param param The actual parameter
+ * @returns {Boolean} Flag indicating if param
can be JSON.stringified
+ */
+ static canBeJsonified(str) {
+ if (typeof str !== 'string' && typeof str !== 'object') return false;
+ try {
+ const type = str.toString();
+ return type === '[object Object]'
+ || type === '[object Array]';
+ } catch (err) {
+ return false;
+ }
+ };
+
+ /**
+ * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
+ * NOTE: query parameters are not handled here.
+ * @param {String} path The path to append to the base URL.
+ * @param {Object} pathParams The parameter values to append.
+ * @param {String} apiBasePath Base path defined in the path, operation level to override the default one
+ * @returns {String} The encoded path with parameter values substituted.
+ */
+ buildUrl(path, pathParams, apiBasePath) {
+ if (!path.match(/^\//)) {
+ path = '/' + path;
+ }
+
+ var url = this.basePath + path;
+
+ // use API (operation, path) base path if defined
+ if (apiBasePath !== null && apiBasePath !== undefined) {
+ url = apiBasePath + path;
+ }
+
+ url = url.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => {
+ var value;
+ if (pathParams.hasOwnProperty(key)) {
+ value = this.paramToString(pathParams[key]);
+ } else {
+ value = fullMatch;
+ }
+
+ return encodeURIComponent(value);
+ });
+
+ return url;
+ }
+
+ /**
+ * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
+ *
+ * @param {String} contentType The MIME content type to check.
+ * @returns {Boolean} true
if contentType
represents JSON, otherwise false
.
+ */
+ isJsonMime(contentType) {
+ return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
+ }
+
+ /**
+ * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
+ * @param {Array.true
if param
represents a file.
+ */
+ isFileParam(param) {
+ // fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
+ if (typeof require === 'function') {
+ let fs;
+ try {
+ fs = require('fs');
+ } catch (err) {}
+ if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
+ return true;
+ }
+ }
+
+ // Buffer in Node.js
+ if (typeof Buffer === 'function' && param instanceof Buffer) {
+ return true;
+ }
+
+ // Blob in browser
+ if (typeof Blob === 'function' && param instanceof Blob) {
+ return true;
+ }
+
+ // File in browser (it seems File object is also instance of Blob, but keep this for safe)
+ if (typeof File === 'function' && param instanceof File) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Normalizes parameter values:
+ *
+ *
+ * @param {Object.param
as is if collectionFormat
is multi
.
+ */
+ buildCollectionParam(param, collectionFormat) {
+ if (param == null) {
+ return null;
+ }
+ switch (collectionFormat) {
+ case 'csv':
+ return param.map(this.paramToString, this).join(',');
+ case 'ssv':
+ return param.map(this.paramToString, this).join(' ');
+ case 'tsv':
+ return param.map(this.paramToString, this).join('\t');
+ case 'pipes':
+ return param.map(this.paramToString, this).join('|');
+ case 'multi':
+ //return the array directly as SuperAgent will handle it as expected
+ return param.map(this.paramToString, this);
+ case 'passthrough':
+ return param;
+ default:
+ throw new Error('Unknown collection format: ' + collectionFormat);
+ }
+ }
+
+ /**
+ * Applies authentication headers to the request.
+ * @param {Object} request The request object created by a superagent()
call.
+ * @param {Array.data
will be converted to this type.
+ * @returns A value of the specified type.
+ */
+ deserialize(response, returnType) {
+ if (response == null || returnType == null || response.status == 204) {
+ return null;
+ }
+
+ // Rely on SuperAgent for parsing response body.
+ // See http://visionmedia.github.io/superagent/#parsing-response-bodies
+ var data = response.body;
+ if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) {
+ // SuperAgent does not always produce a body; use the unparsed response as a fallback
+ data = response.text;
+ }
+
+ return ApiClient.convertToType(data, returnType);
+ }
+
+ /**
+ * Callback function to receive the result of the operation.
+ * @callback module:ApiClient~callApiCallback
+ * @param {String} error Error message, if any.
+ * @param data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Invokes the REST service using the supplied settings and parameters.
+ * @param {String} path The base URL to invoke.
+ * @param {String} httpMethod The HTTP method to use.
+ * @param {Object.
data
will be converted to this type.
+ * @returns An instance of the specified type or null or undefined if data is null or undefined.
+ */
+ static convertToType(data, type) {
+ if (data === null || data === undefined)
+ return data
+
+ switch (type) {
+ case 'Boolean':
+ return Boolean(data);
+ case 'Integer':
+ return parseInt(data, 10);
+ case 'Number':
+ return parseFloat(data);
+ case 'String':
+ return String(data);
+ case 'Date':
+ return ApiClient.parseDate(String(data));
+ case 'Blob':
+ return data;
+ default:
+ if (type === Object) {
+ // generic object, return directly
+ return data;
+ } else if (typeof type.constructFromObject === 'function') {
+ // for model type like User and enum class
+ return type.constructFromObject(data);
+ } else if (Array.isArray(type)) {
+ // for array type like: ['String']
+ var itemType = type[0];
+
+ return data.map((item) => {
+ return ApiClient.convertToType(item, itemType);
+ });
+ } else if (typeof type === 'object') {
+ // for plain object type like: {'String': 'Integer'}
+ var keyType, valueType;
+ for (var k in type) {
+ if (type.hasOwnProperty(k)) {
+ keyType = k;
+ valueType = type[k];
+ break;
+ }
+ }
+
+ var result = {};
+ for (var k in data) {
+ if (data.hasOwnProperty(k)) {
+ var key = ApiClient.convertToType(k, keyType);
+ var value = ApiClient.convertToType(data[k], valueType);
+ result[key] = value;
+ }
+ }
+
+ return result;
+ } else {
+ // for unknown type, return the data directly
+ return data;
+ }
+ }
+ }
+
+ /**
+ * Gets an array of host settings
+ * @returns An array of host settings
+ */
+ hostSettings() {
+ return [
+ {
+ 'url': "",
+ 'description': "No description provided",
+ }
+ ];
+ }
+
+ getBasePathFromSettings(index, variables={}) {
+ var servers = this.hostSettings();
+
+ // check array index out of bound
+ if (index < 0 || index >= servers.length) {
+ throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
+ }
+
+ var server = servers[index];
+ var url = server['url'];
+
+ // go through variable and assign a value
+ for (var variable_name in server['variables']) {
+ if (variable_name in variables) {
+ let variable = server['variables'][variable_name];
+ if ( !('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name]) ) {
+ url = url.replace("{" + variable_name + "}", variables[variable_name]);
+ } else {
+ throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
+ }
+ } else {
+ // use default value
+ url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
+ }
+ }
+ return url;
+ }
+
+ /**
+ * Constructs a new map or array model from REST data.
+ * @param data {Object|Array} The REST data.
+ * @param obj {Object|Array} The target object or array.
+ */
+ static constructFromObject(data, obj, itemType) {
+ if (Array.isArray(data)) {
+ for (var i = 0; i < data.length; i++) {
+ if (data.hasOwnProperty(i))
+ obj[i] = ApiClient.convertToType(data[i], itemType);
+ }
+ } else {
+ for (var k in data) {
+ if (data.hasOwnProperty(k))
+ obj[k] = ApiClient.convertToType(data[k], itemType);
+ }
+ }
+ };
+}
+
+/**
+ * Enumeration of collection format separator strategies.
+ * @enum {String}
+ * @readonly
+ */
+ApiClient.CollectionFormatEnum = {
+ /**
+ * Comma-separated values. Value:
csv
+ * @const
+ */
+ CSV: ',',
+
+ /**
+ * Space-separated values. Value: ssv
+ * @const
+ */
+ SSV: ' ',
+
+ /**
+ * Tab-separated values. Value: tsv
+ * @const
+ */
+ TSV: '\t',
+
+ /**
+ * Pipe(|)-separated values. Value: pipes
+ * @const
+ */
+ PIPES: '|',
+
+ /**
+ * Native array. Value: multi
+ * @const
+ */
+ MULTI: 'multi'
+};
+
+/**
+* The default API client implementation.
+* @type {module:ApiClient}
+*/
+ApiClient.instance = new ApiClient();
+export default ApiClient;
diff --git a/js/src/api/DefaultApi.js b/js/src/api/DefaultApi.js
new file mode 100644
index 0000000..2706e79
--- /dev/null
+++ b/js/src/api/DefaultApi.js
@@ -0,0 +1,209 @@
+/**
+ * letsrolld API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+
+import ApiClient from "../ApiClient";
+import Director from '../model/Director';
+import Film from '../model/Film';
+
+/**
+* Default service.
+* @module api/DefaultApi
+* @version 0.1
+*/
+export default class DefaultApi {
+
+ /**
+ * Constructs a new DefaultApi.
+ * @alias module:api/DefaultApi
+ * @class
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
+ * default to {@link module:ApiClient#instance} if unspecified.
+ */
+ constructor(apiClient) {
+ this.apiClient = apiClient || ApiClient.instance;
+ }
+
+
+ /**
+ * Callback function to receive the result of the directorsGet operation.
+ * @callback module:api/DefaultApi~directorsGetCallback
+ * @param {String} error Error message, if any.
+ * @param {Array.
+* A non-AMD browser application (discouraged) might do something like this: +*
+* var xxxSvc = new LetsrolldApi.XxxApi(); // Allocate the API class we're going to use. +* var yyy = new LetsrolldApi.Yyy(); // Construct a model instance. +* yyyModel.someProperty = 'someValue'; +* ... +* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service. +* ... +*+* +* @module index +* @version 0.1 +*/ +export { + /** + * The ApiClient constructor. + * @property {module:ApiClient} + */ + ApiClient, + + /** + * The ArrayOfDirectors model constructor. + * @property {module:model/ArrayOfDirectors} + */ + ArrayOfDirectors, + + /** + * The ArrayOfFilms model constructor. + * @property {module:model/ArrayOfFilms} + */ + ArrayOfFilms, + + /** + * The Director model constructor. + * @property {module:model/Director} + */ + Director, + + /** + * The DirectorFilmsInner model constructor. + * @property {module:model/DirectorFilmsInner} + */ + DirectorFilmsInner, + + /** + * The DirectorFilmsInnerCountriesInner model constructor. + * @property {module:model/DirectorFilmsInnerCountriesInner} + */ + DirectorFilmsInnerCountriesInner, + + /** + * The DirectorFilmsInnerOffersInner model constructor. + * @property {module:model/DirectorFilmsInnerOffersInner} + */ + DirectorFilmsInnerOffersInner, + + /** + * The DirectorInfo model constructor. + * @property {module:model/DirectorInfo} + */ + DirectorInfo, + + /** + * The Film model constructor. + * @property {module:model/Film} + */ + Film, + + /** + * The DefaultApi service constructor. + * @property {module:api/DefaultApi} + */ + DefaultApi +}; diff --git a/js/src/model/ArrayOfDirectors.js b/js/src/model/ArrayOfDirectors.js new file mode 100644 index 0000000..cb1c85b --- /dev/null +++ b/js/src/model/ArrayOfDirectors.js @@ -0,0 +1,81 @@ +/** + * letsrolld API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The ArrayOfDirectors model module. + * @module model/ArrayOfDirectors + * @version 0.1 + */ +class ArrayOfDirectors extends Array { + /** + * Constructs a new
ArrayOfDirectors
.
+ * @alias module:model/ArrayOfDirectors
+ * @extends Array
+ */
+ constructor() {
+ super();
+
+
+ ArrayOfDirectors.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a ArrayOfDirectors
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/ArrayOfDirectors} obj Optional instance to populate.
+ * @return {module:model/ArrayOfDirectors} The populated ArrayOfDirectors
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new ArrayOfDirectors();
+
+ ApiClient.constructFromObject(data, obj, 'Object');
+
+
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to ArrayOfDirectors
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to ArrayOfDirectors
.
+ */
+ static validateJSON(data) {
+
+ return true;
+ }
+
+
+}
+
+
+
+
+
+
+
+
+export default ArrayOfDirectors;
+
diff --git a/js/src/model/ArrayOfFilms.js b/js/src/model/ArrayOfFilms.js
new file mode 100644
index 0000000..4003f85
--- /dev/null
+++ b/js/src/model/ArrayOfFilms.js
@@ -0,0 +1,81 @@
+/**
+ * letsrolld API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+
+/**
+ * The ArrayOfFilms model module.
+ * @module model/ArrayOfFilms
+ * @version 0.1
+ */
+class ArrayOfFilms extends Array {
+ /**
+ * Constructs a new ArrayOfFilms
.
+ * @alias module:model/ArrayOfFilms
+ * @extends Array
+ */
+ constructor() {
+ super();
+
+
+ ArrayOfFilms.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a ArrayOfFilms
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/ArrayOfFilms} obj Optional instance to populate.
+ * @return {module:model/ArrayOfFilms} The populated ArrayOfFilms
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new ArrayOfFilms();
+
+ ApiClient.constructFromObject(data, obj, 'Object');
+
+
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to ArrayOfFilms
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to ArrayOfFilms
.
+ */
+ static validateJSON(data) {
+
+ return true;
+ }
+
+
+}
+
+
+
+
+
+
+
+
+export default ArrayOfFilms;
+
diff --git a/js/src/model/Director.js b/js/src/model/Director.js
new file mode 100644
index 0000000..c7857a7
--- /dev/null
+++ b/js/src/model/Director.js
@@ -0,0 +1,115 @@
+/**
+ * letsrolld API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import DirectorFilmsInner from './DirectorFilmsInner';
+import DirectorInfo from './DirectorInfo';
+
+/**
+ * The Director model module.
+ * @module model/Director
+ * @version 0.1
+ */
+class Director {
+ /**
+ * Constructs a new Director
.
+ * @alias module:model/Director
+ * @param info {module:model/DirectorInfo}
+ */
+ constructor(info) {
+
+ Director.initialize(this, info);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj, info) {
+ obj['info'] = info;
+ }
+
+ /**
+ * Constructs a Director
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/Director} obj Optional instance to populate.
+ * @return {module:model/Director} The populated Director
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new Director();
+
+ if (data.hasOwnProperty('info')) {
+ obj['info'] = DirectorInfo.constructFromObject(data['info']);
+ }
+ if (data.hasOwnProperty('films')) {
+ obj['films'] = ApiClient.convertToType(data['films'], [DirectorFilmsInner]);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to Director
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to Director
.
+ */
+ static validateJSON(data) {
+ // check to make sure all required properties are present in the JSON string
+ for (const property of Director.RequiredProperties) {
+ if (!data[property]) {
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
+ }
+ }
+ // validate the optional field `info`
+ if (data['info']) { // data not null
+ DirectorInfo.validateJSON(data['info']);
+ }
+ if (data['films']) { // data not null
+ // ensure the json data is an array
+ if (!Array.isArray(data['films'])) {
+ throw new Error("Expected the field `films` to be an array in the JSON data but got " + data['films']);
+ }
+ // validate the optional field `films` (array)
+ for (const item of data['films']) {
+ DirectorFilmsInner.validateJSON(item);
+ };
+ }
+
+ return true;
+ }
+
+
+}
+
+Director.RequiredProperties = ["info"];
+
+/**
+ * @member {module:model/DirectorInfo} info
+ */
+Director.prototype['info'] = undefined;
+
+/**
+ * @member {Array.DirectorFilmsInner
.
+ * @alias module:model/DirectorFilmsInner
+ * @param title {String}
+ */
+ constructor(title) {
+
+ DirectorFilmsInner.initialize(this, title);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj, title) {
+ obj['title'] = title;
+ }
+
+ /**
+ * Constructs a DirectorFilmsInner
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/DirectorFilmsInner} obj Optional instance to populate.
+ * @return {module:model/DirectorFilmsInner} The populated DirectorFilmsInner
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new DirectorFilmsInner();
+
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'Number');
+ }
+ if (data.hasOwnProperty('title')) {
+ obj['title'] = ApiClient.convertToType(data['title'], 'String');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('year')) {
+ obj['year'] = ApiClient.convertToType(data['year'], 'Number');
+ }
+ if (data.hasOwnProperty('rating')) {
+ obj['rating'] = ApiClient.convertToType(data['rating'], 'String');
+ }
+ if (data.hasOwnProperty('runtime')) {
+ obj['runtime'] = ApiClient.convertToType(data['runtime'], 'Number');
+ }
+ if (data.hasOwnProperty('lb_url')) {
+ obj['lb_url'] = ApiClient.convertToType(data['lb_url'], 'String');
+ }
+ if (data.hasOwnProperty('jw_url')) {
+ obj['jw_url'] = ApiClient.convertToType(data['jw_url'], 'String');
+ }
+ if (data.hasOwnProperty('trailer_url')) {
+ obj['trailer_url'] = ApiClient.convertToType(data['trailer_url'], 'String');
+ }
+ if (data.hasOwnProperty('genres')) {
+ obj['genres'] = ApiClient.convertToType(data['genres'], ['String']);
+ }
+ if (data.hasOwnProperty('countries')) {
+ obj['countries'] = ApiClient.convertToType(data['countries'], [DirectorFilmsInnerCountriesInner]);
+ }
+ if (data.hasOwnProperty('offers')) {
+ obj['offers'] = ApiClient.convertToType(data['offers'], [DirectorFilmsInnerOffersInner]);
+ }
+ if (data.hasOwnProperty('directors')) {
+ obj['directors'] = ApiClient.convertToType(data['directors'], [DirectorInfo]);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to DirectorFilmsInner
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to DirectorFilmsInner
.
+ */
+ static validateJSON(data) {
+ // check to make sure all required properties are present in the JSON string
+ for (const property of DirectorFilmsInner.RequiredProperties) {
+ if (!data[property]) {
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
+ }
+ }
+ // ensure the json data is a string
+ if (data['title'] && !(typeof data['title'] === 'string' || data['title'] instanceof String)) {
+ throw new Error("Expected the field `title` to be a primitive type in the JSON string but got " + data['title']);
+ }
+ // ensure the json data is a string
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
+ }
+ // ensure the json data is a string
+ if (data['rating'] && !(typeof data['rating'] === 'string' || data['rating'] instanceof String)) {
+ throw new Error("Expected the field `rating` to be a primitive type in the JSON string but got " + data['rating']);
+ }
+ // ensure the json data is a string
+ if (data['lb_url'] && !(typeof data['lb_url'] === 'string' || data['lb_url'] instanceof String)) {
+ throw new Error("Expected the field `lb_url` to be a primitive type in the JSON string but got " + data['lb_url']);
+ }
+ // ensure the json data is a string
+ if (data['jw_url'] && !(typeof data['jw_url'] === 'string' || data['jw_url'] instanceof String)) {
+ throw new Error("Expected the field `jw_url` to be a primitive type in the JSON string but got " + data['jw_url']);
+ }
+ // ensure the json data is a string
+ if (data['trailer_url'] && !(typeof data['trailer_url'] === 'string' || data['trailer_url'] instanceof String)) {
+ throw new Error("Expected the field `trailer_url` to be a primitive type in the JSON string but got " + data['trailer_url']);
+ }
+ // ensure the json data is an array
+ if (!Array.isArray(data['genres'])) {
+ throw new Error("Expected the field `genres` to be an array in the JSON data but got " + data['genres']);
+ }
+ if (data['countries']) { // data not null
+ // ensure the json data is an array
+ if (!Array.isArray(data['countries'])) {
+ throw new Error("Expected the field `countries` to be an array in the JSON data but got " + data['countries']);
+ }
+ // validate the optional field `countries` (array)
+ for (const item of data['countries']) {
+ DirectorFilmsInnerCountriesInner.validateJSON(item);
+ };
+ }
+ if (data['offers']) { // data not null
+ // ensure the json data is an array
+ if (!Array.isArray(data['offers'])) {
+ throw new Error("Expected the field `offers` to be an array in the JSON data but got " + data['offers']);
+ }
+ // validate the optional field `offers` (array)
+ for (const item of data['offers']) {
+ DirectorFilmsInnerOffersInner.validateJSON(item);
+ };
+ }
+ if (data['directors']) { // data not null
+ // ensure the json data is an array
+ if (!Array.isArray(data['directors'])) {
+ throw new Error("Expected the field `directors` to be an array in the JSON data but got " + data['directors']);
+ }
+ // validate the optional field `directors` (array)
+ for (const item of data['directors']) {
+ DirectorInfo.validateJSON(item);
+ };
+ }
+
+ return true;
+ }
+
+
+}
+
+DirectorFilmsInner.RequiredProperties = ["title"];
+
+/**
+ * @member {Number} id
+ */
+DirectorFilmsInner.prototype['id'] = undefined;
+
+/**
+ * @member {String} title
+ */
+DirectorFilmsInner.prototype['title'] = undefined;
+
+/**
+ * @member {String} description
+ */
+DirectorFilmsInner.prototype['description'] = undefined;
+
+/**
+ * @member {Number} year
+ */
+DirectorFilmsInner.prototype['year'] = undefined;
+
+/**
+ * @member {String} rating
+ */
+DirectorFilmsInner.prototype['rating'] = undefined;
+
+/**
+ * @member {Number} runtime
+ */
+DirectorFilmsInner.prototype['runtime'] = undefined;
+
+/**
+ * @member {String} lb_url
+ */
+DirectorFilmsInner.prototype['lb_url'] = undefined;
+
+/**
+ * @member {String} jw_url
+ */
+DirectorFilmsInner.prototype['jw_url'] = undefined;
+
+/**
+ * @member {String} trailer_url
+ */
+DirectorFilmsInner.prototype['trailer_url'] = undefined;
+
+/**
+ * @member {Array.DirectorFilmsInnerCountriesInner
.
+ * @alias module:model/DirectorFilmsInnerCountriesInner
+ * @param name {String}
+ */
+ constructor(name) {
+
+ DirectorFilmsInnerCountriesInner.initialize(this, name);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj, name) {
+ obj['name'] = name;
+ }
+
+ /**
+ * Constructs a DirectorFilmsInnerCountriesInner
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/DirectorFilmsInnerCountriesInner} obj Optional instance to populate.
+ * @return {module:model/DirectorFilmsInnerCountriesInner} The populated DirectorFilmsInnerCountriesInner
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new DirectorFilmsInnerCountriesInner();
+
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('flag')) {
+ obj['flag'] = ApiClient.convertToType(data['flag'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to DirectorFilmsInnerCountriesInner
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to DirectorFilmsInnerCountriesInner
.
+ */
+ static validateJSON(data) {
+ // check to make sure all required properties are present in the JSON string
+ for (const property of DirectorFilmsInnerCountriesInner.RequiredProperties) {
+ if (!data[property]) {
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
+ }
+ }
+ // ensure the json data is a string
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
+ }
+ // ensure the json data is a string
+ if (data['flag'] && !(typeof data['flag'] === 'string' || data['flag'] instanceof String)) {
+ throw new Error("Expected the field `flag` to be a primitive type in the JSON string but got " + data['flag']);
+ }
+
+ return true;
+ }
+
+
+}
+
+DirectorFilmsInnerCountriesInner.RequiredProperties = ["name"];
+
+/**
+ * @member {String} name
+ */
+DirectorFilmsInnerCountriesInner.prototype['name'] = undefined;
+
+/**
+ * @member {String} flag
+ */
+DirectorFilmsInnerCountriesInner.prototype['flag'] = undefined;
+
+
+
+
+
+
+export default DirectorFilmsInnerCountriesInner;
+
diff --git a/js/src/model/DirectorFilmsInnerOffersInner.js b/js/src/model/DirectorFilmsInnerOffersInner.js
new file mode 100644
index 0000000..d53741f
--- /dev/null
+++ b/js/src/model/DirectorFilmsInnerOffersInner.js
@@ -0,0 +1,109 @@
+/**
+ * letsrolld API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+
+/**
+ * The DirectorFilmsInnerOffersInner model module.
+ * @module model/DirectorFilmsInnerOffersInner
+ * @version 0.1
+ */
+class DirectorFilmsInnerOffersInner {
+ /**
+ * Constructs a new DirectorFilmsInnerOffersInner
.
+ * @alias module:model/DirectorFilmsInnerOffersInner
+ * @param name {String}
+ * @param url {String}
+ */
+ constructor(name, url) {
+
+ DirectorFilmsInnerOffersInner.initialize(this, name, url);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj, name, url) {
+ obj['name'] = name;
+ obj['url'] = url;
+ }
+
+ /**
+ * Constructs a DirectorFilmsInnerOffersInner
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/DirectorFilmsInnerOffersInner} obj Optional instance to populate.
+ * @return {module:model/DirectorFilmsInnerOffersInner} The populated DirectorFilmsInnerOffersInner
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new DirectorFilmsInnerOffersInner();
+
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('url')) {
+ obj['url'] = ApiClient.convertToType(data['url'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to DirectorFilmsInnerOffersInner
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to DirectorFilmsInnerOffersInner
.
+ */
+ static validateJSON(data) {
+ // check to make sure all required properties are present in the JSON string
+ for (const property of DirectorFilmsInnerOffersInner.RequiredProperties) {
+ if (!data[property]) {
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
+ }
+ }
+ // ensure the json data is a string
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
+ }
+ // ensure the json data is a string
+ if (data['url'] && !(typeof data['url'] === 'string' || data['url'] instanceof String)) {
+ throw new Error("Expected the field `url` to be a primitive type in the JSON string but got " + data['url']);
+ }
+
+ return true;
+ }
+
+
+}
+
+DirectorFilmsInnerOffersInner.RequiredProperties = ["name", "url"];
+
+/**
+ * @member {String} name
+ */
+DirectorFilmsInnerOffersInner.prototype['name'] = undefined;
+
+/**
+ * @member {String} url
+ */
+DirectorFilmsInnerOffersInner.prototype['url'] = undefined;
+
+
+
+
+
+
+export default DirectorFilmsInnerOffersInner;
+
diff --git a/js/src/model/DirectorInfo.js b/js/src/model/DirectorInfo.js
new file mode 100644
index 0000000..d907fbc
--- /dev/null
+++ b/js/src/model/DirectorInfo.js
@@ -0,0 +1,117 @@
+/**
+ * letsrolld API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+
+/**
+ * The DirectorInfo model module.
+ * @module model/DirectorInfo
+ * @version 0.1
+ */
+class DirectorInfo {
+ /**
+ * Constructs a new DirectorInfo
.
+ * @alias module:model/DirectorInfo
+ * @param id {Number}
+ * @param name {String}
+ */
+ constructor(id, name) {
+
+ DirectorInfo.initialize(this, id, name);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj, id, name) {
+ obj['id'] = id;
+ obj['name'] = name;
+ }
+
+ /**
+ * Constructs a DirectorInfo
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/DirectorInfo} obj Optional instance to populate.
+ * @return {module:model/DirectorInfo} The populated DirectorInfo
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new DirectorInfo();
+
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'Number');
+ }
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('lb_url')) {
+ obj['lb_url'] = ApiClient.convertToType(data['lb_url'], 'String');
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to DirectorInfo
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to DirectorInfo
.
+ */
+ static validateJSON(data) {
+ // check to make sure all required properties are present in the JSON string
+ for (const property of DirectorInfo.RequiredProperties) {
+ if (!data[property]) {
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
+ }
+ }
+ // ensure the json data is a string
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
+ }
+ // ensure the json data is a string
+ if (data['lb_url'] && !(typeof data['lb_url'] === 'string' || data['lb_url'] instanceof String)) {
+ throw new Error("Expected the field `lb_url` to be a primitive type in the JSON string but got " + data['lb_url']);
+ }
+
+ return true;
+ }
+
+
+}
+
+DirectorInfo.RequiredProperties = ["id", "name"];
+
+/**
+ * @member {Number} id
+ */
+DirectorInfo.prototype['id'] = undefined;
+
+/**
+ * @member {String} name
+ */
+DirectorInfo.prototype['name'] = undefined;
+
+/**
+ * @member {String} lb_url
+ */
+DirectorInfo.prototype['lb_url'] = undefined;
+
+
+
+
+
+
+export default DirectorInfo;
+
diff --git a/js/src/model/Film.js b/js/src/model/Film.js
new file mode 100644
index 0000000..037b19b
--- /dev/null
+++ b/js/src/model/Film.js
@@ -0,0 +1,248 @@
+/**
+ * letsrolld API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import DirectorFilmsInnerCountriesInner from './DirectorFilmsInnerCountriesInner';
+import DirectorFilmsInnerOffersInner from './DirectorFilmsInnerOffersInner';
+import DirectorInfo from './DirectorInfo';
+
+/**
+ * The Film model module.
+ * @module model/Film
+ * @version 0.1
+ */
+class Film {
+ /**
+ * Constructs a new Film
.
+ * @alias module:model/Film
+ * @param title {String}
+ */
+ constructor(title) {
+
+ Film.initialize(this, title);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj, title) {
+ obj['title'] = title;
+ }
+
+ /**
+ * Constructs a Film
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/Film} obj Optional instance to populate.
+ * @return {module:model/Film} The populated Film
instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new Film();
+
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'Number');
+ }
+ if (data.hasOwnProperty('title')) {
+ obj['title'] = ApiClient.convertToType(data['title'], 'String');
+ }
+ if (data.hasOwnProperty('description')) {
+ obj['description'] = ApiClient.convertToType(data['description'], 'String');
+ }
+ if (data.hasOwnProperty('year')) {
+ obj['year'] = ApiClient.convertToType(data['year'], 'Number');
+ }
+ if (data.hasOwnProperty('rating')) {
+ obj['rating'] = ApiClient.convertToType(data['rating'], 'String');
+ }
+ if (data.hasOwnProperty('runtime')) {
+ obj['runtime'] = ApiClient.convertToType(data['runtime'], 'Number');
+ }
+ if (data.hasOwnProperty('lb_url')) {
+ obj['lb_url'] = ApiClient.convertToType(data['lb_url'], 'String');
+ }
+ if (data.hasOwnProperty('jw_url')) {
+ obj['jw_url'] = ApiClient.convertToType(data['jw_url'], 'String');
+ }
+ if (data.hasOwnProperty('trailer_url')) {
+ obj['trailer_url'] = ApiClient.convertToType(data['trailer_url'], 'String');
+ }
+ if (data.hasOwnProperty('genres')) {
+ obj['genres'] = ApiClient.convertToType(data['genres'], ['String']);
+ }
+ if (data.hasOwnProperty('countries')) {
+ obj['countries'] = ApiClient.convertToType(data['countries'], [DirectorFilmsInnerCountriesInner]);
+ }
+ if (data.hasOwnProperty('offers')) {
+ obj['offers'] = ApiClient.convertToType(data['offers'], [DirectorFilmsInnerOffersInner]);
+ }
+ if (data.hasOwnProperty('directors')) {
+ obj['directors'] = ApiClient.convertToType(data['directors'], [DirectorInfo]);
+ }
+ }
+ return obj;
+ }
+
+ /**
+ * Validates the JSON data with respect to Film
.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @return {boolean} to indicate whether the JSON data is valid with respect to Film
.
+ */
+ static validateJSON(data) {
+ // check to make sure all required properties are present in the JSON string
+ for (const property of Film.RequiredProperties) {
+ if (!data[property]) {
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
+ }
+ }
+ // ensure the json data is a string
+ if (data['title'] && !(typeof data['title'] === 'string' || data['title'] instanceof String)) {
+ throw new Error("Expected the field `title` to be a primitive type in the JSON string but got " + data['title']);
+ }
+ // ensure the json data is a string
+ if (data['description'] && !(typeof data['description'] === 'string' || data['description'] instanceof String)) {
+ throw new Error("Expected the field `description` to be a primitive type in the JSON string but got " + data['description']);
+ }
+ // ensure the json data is a string
+ if (data['rating'] && !(typeof data['rating'] === 'string' || data['rating'] instanceof String)) {
+ throw new Error("Expected the field `rating` to be a primitive type in the JSON string but got " + data['rating']);
+ }
+ // ensure the json data is a string
+ if (data['lb_url'] && !(typeof data['lb_url'] === 'string' || data['lb_url'] instanceof String)) {
+ throw new Error("Expected the field `lb_url` to be a primitive type in the JSON string but got " + data['lb_url']);
+ }
+ // ensure the json data is a string
+ if (data['jw_url'] && !(typeof data['jw_url'] === 'string' || data['jw_url'] instanceof String)) {
+ throw new Error("Expected the field `jw_url` to be a primitive type in the JSON string but got " + data['jw_url']);
+ }
+ // ensure the json data is a string
+ if (data['trailer_url'] && !(typeof data['trailer_url'] === 'string' || data['trailer_url'] instanceof String)) {
+ throw new Error("Expected the field `trailer_url` to be a primitive type in the JSON string but got " + data['trailer_url']);
+ }
+ // ensure the json data is an array
+ if (!Array.isArray(data['genres'])) {
+ throw new Error("Expected the field `genres` to be an array in the JSON data but got " + data['genres']);
+ }
+ if (data['countries']) { // data not null
+ // ensure the json data is an array
+ if (!Array.isArray(data['countries'])) {
+ throw new Error("Expected the field `countries` to be an array in the JSON data but got " + data['countries']);
+ }
+ // validate the optional field `countries` (array)
+ for (const item of data['countries']) {
+ DirectorFilmsInnerCountriesInner.validateJSON(item);
+ };
+ }
+ if (data['offers']) { // data not null
+ // ensure the json data is an array
+ if (!Array.isArray(data['offers'])) {
+ throw new Error("Expected the field `offers` to be an array in the JSON data but got " + data['offers']);
+ }
+ // validate the optional field `offers` (array)
+ for (const item of data['offers']) {
+ DirectorFilmsInnerOffersInner.validateJSON(item);
+ };
+ }
+ if (data['directors']) { // data not null
+ // ensure the json data is an array
+ if (!Array.isArray(data['directors'])) {
+ throw new Error("Expected the field `directors` to be an array in the JSON data but got " + data['directors']);
+ }
+ // validate the optional field `directors` (array)
+ for (const item of data['directors']) {
+ DirectorInfo.validateJSON(item);
+ };
+ }
+
+ return true;
+ }
+
+
+}
+
+Film.RequiredProperties = ["title"];
+
+/**
+ * @member {Number} id
+ */
+Film.prototype['id'] = undefined;
+
+/**
+ * @member {String} title
+ */
+Film.prototype['title'] = undefined;
+
+/**
+ * @member {String} description
+ */
+Film.prototype['description'] = undefined;
+
+/**
+ * @member {Number} year
+ */
+Film.prototype['year'] = undefined;
+
+/**
+ * @member {String} rating
+ */
+Film.prototype['rating'] = undefined;
+
+/**
+ * @member {Number} runtime
+ */
+Film.prototype['runtime'] = undefined;
+
+/**
+ * @member {String} lb_url
+ */
+Film.prototype['lb_url'] = undefined;
+
+/**
+ * @member {String} jw_url
+ */
+Film.prototype['jw_url'] = undefined;
+
+/**
+ * @member {String} trailer_url
+ */
+Film.prototype['trailer_url'] = undefined;
+
+/**
+ * @member {Array.