From 1592de5fb2ed43dd2134517973e71033355ab56a Mon Sep 17 00:00:00 2001 From: James Kachel Date: Fri, 20 Dec 2024 06:06:08 -0800 Subject: [PATCH] Update OpenAPI client, add client validity check (#187) --- .github/workflows/ci.yml | 47 + .pre-commit-config.yaml | 27 +- .prettierrc.json | 2 +- .yarnrc.yml | 7 - .../generated/v0/.openapi-generator-ignore | 5 - frontends/api/src/generated/v0/api.ts | 8715 ++++++++++------- frontends/api/src/generated/v0/base.ts | 63 +- frontends/api/src/generated/v0/common.ts | 190 +- .../api/src/generated/v0/configuration.ts | 200 +- frontends/api/src/generated/v0/index.ts | 5 +- package-lock.json | 78 + package.json | 74 +- 12 files changed, 5331 insertions(+), 4082 deletions(-) delete mode 100644 .yarnrc.yml create mode 100644 package-lock.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f4e3543..26d34ee9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,3 +78,50 @@ jobs: uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: file: ./coverage.xml + + openapi-generated-client-check-v0: + # This job checks that the output of openapi-generator-typescript-axios that + # is checked into version control is up-to-date. + env: + OPENAPI_SCHEMA: ./openapi/specs/v0.yaml + GENERATOR_IGNORE_FILE: ./frontends/api/.openapi-generator-ignore + GENERATOR_OUTPUT_DIR_CI: ./frontends/api/tmp/generated/v0 + GENERATOR_OUTPUT_DIR_VC: ./frontends/api/src/generated/v0 + COREPACK_ENABLE_DOWNLOAD_PROMPT: 0 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 + with: + node-version: "^20" + cache: "npm" + cache-dependency-path: "package-lock.json" + + - name: Install dependencies + run: npm i + + - name: Generate Fresh API Client + uses: openapi-generators/openapitools-generator-action@v1 + with: + generator: typescript-axios + openapi-file: $OPENAPI_SCHEMA + generator-tag: v7.2.0 + command-args: | + --output $GENERATOR_OUTPUT_DIR_CI \ + --ignore-file-override $GENERATOR_IGNORE_FILE \ + -c scripts/openapi-configs/typescript-axios-v0.yaml + + - name: Format freshly generated client + run: npx prettier $GENERATOR_OUTPUT_DIR_CI/**/*.ts --no-semi --write + + # Kept getting tripped up on npmignore and the git push script, neither + # of which are really important, so just check the generated TypeScript + # files instead. + - name: Check VC client is up-to-date + run: | + mkdir $GENERATOR_OUTPUT_DIR_VC/ts + mkdir $GENERATOR_OUTPUT_DIR_CI/ts + cp $GENERATOR_OUTPUT_DIR_VC/*.ts $GENERATOR_OUTPUT_DIR_VC/ts + cp $GENERATOR_OUTPUT_DIR_CI/*.ts $GENERATOR_OUTPUT_DIR_CI/ts + diff $GENERATOR_OUTPUT_DIR_CI/ts $GENERATOR_OUTPUT_DIR_VC/ts \ + || { echo "OpenAPI spec is out of date. Please regenerate via ./scripts/generate_openapi.sh"; exit 1; } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 734dd545..fbf85c61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,6 @@ --- # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -# A bunch of frontend related stuff is commented out here - this is because we don't -# have a frontend yet. repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -15,8 +13,29 @@ repos: - id: check-merge-conflict - id: check-toml - id: debug-statements + - repo: local + hooks: + - id: prettier + name: prettier + entry: npx prettier --write + language: node + types_or: + [ + javascript, + jsx, + ts, + tsx, + json, + scss, + sass, + css, + yaml, + markdown, + html, + sh, + ] - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.8.0-1 + rev: v3.10.0-1 hooks: - id: shfmt - repo: https://github.com/adrienverge/yamllint.git @@ -58,3 +77,5 @@ repos: hooks: - id: shellcheck args: ["--severity=warning"] +ci: + skip: [prettier] diff --git a/.prettierrc.json b/.prettierrc.json index bf40511a..ab2eb9db 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,5 @@ { "$schema": "http://json.schemastore.org/prettierrc", "semi": false, - "plugins": ["prettier-plugin-django-alpine"] + "plugins": ["prettier-plugin-sh"] } diff --git a/.yarnrc.yml b/.yarnrc.yml deleted file mode 100644 index 87c10263..00000000 --- a/.yarnrc.yml +++ /dev/null @@ -1,7 +0,0 @@ -nodeLinker: node-modules - -plugins: - - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs - spec: "@yarnpkg/plugin-workspace-tools" - -yarnPath: .yarn/releases/yarn-3.6.4.cjs diff --git a/frontends/api/src/generated/v0/.openapi-generator-ignore b/frontends/api/src/generated/v0/.openapi-generator-ignore index 2ae72dd4..7484ee59 100644 --- a/frontends/api/src/generated/v0/.openapi-generator-ignore +++ b/frontends/api/src/generated/v0/.openapi-generator-ignore @@ -21,8 +21,3 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md - -**/.npmignore -**/.gitignore -**/git_push.sh -**/.openapi-generator-ignore diff --git a/frontends/api/src/generated/v0/api.ts b/frontends/api/src/generated/v0/api.ts index b4b7f41b..2134d9b8 100644 --- a/frontends/api/src/generated/v0/api.ts +++ b/frontends/api/src/generated/v0/api.ts @@ -12,16 +12,32 @@ * Do not edit the class manually. */ - -import type { Configuration } from './configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { Configuration } from "./configuration" +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios" +import globalAxios from "axios" // Some imports not used depending on template conditions // @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; -import type { RequestArgs } from './base'; +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "./common" +import type { RequestArgs } from "./base" // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; +import { + BASE_PATH, + COLLECTION_FORMATS, + BaseAPI, + RequiredError, + operationServerMap, +} from "./base" /** * Basket item model serializer with product information @@ -29,42 +45,42 @@ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerM * @interface BasketItemWithProduct */ export interface BasketItemWithProduct { - /** - * - * @type {Product} - * @memberof BasketItemWithProduct - */ - 'product': Product; - /** - * - * @type {number} - * @memberof BasketItemWithProduct - */ - 'id': number; - /** - * Return the total price of the basket item with discounts. - * @type {number} - * @memberof BasketItemWithProduct - */ - 'price': number; - /** - * Get the price of the basket item with applicable discounts. Returns: Decimal: The price of the basket item reduced by an applicable discount. - * @type {number} - * @memberof BasketItemWithProduct - */ - 'discounted_price': number; - /** - * - * @type {number} - * @memberof BasketItemWithProduct - */ - 'quantity'?: number; - /** - * - * @type {SimpleDiscount} - * @memberof BasketItemWithProduct - */ - 'discount_applied': SimpleDiscount; + /** + * + * @type {Product} + * @memberof BasketItemWithProduct + */ + product: Product + /** + * + * @type {number} + * @memberof BasketItemWithProduct + */ + id: number + /** + * Return the total price of the basket item with discounts. + * @type {number} + * @memberof BasketItemWithProduct + */ + price: number + /** + * Get the price of the basket item with applicable discounts. Returns: Decimal: The price of the basket item reduced by an applicable discount. + * @type {number} + * @memberof BasketItemWithProduct + */ + discounted_price: number + /** + * + * @type {number} + * @memberof BasketItemWithProduct + */ + quantity?: number + /** + * + * @type {SimpleDiscount} + * @memberof BasketItemWithProduct + */ + discount_applied: SimpleDiscount } /** * Basket model serializer with items and products @@ -72,1333 +88,1333 @@ export interface BasketItemWithProduct { * @interface BasketWithProduct */ export interface BasketWithProduct { - /** - * - * @type {number} - * @memberof BasketWithProduct - */ - 'id': number; - /** - * - * @type {number} - * @memberof BasketWithProduct - */ - 'user': number; - /** - * - * @type {IntegratedSystem} - * @memberof BasketWithProduct - */ - 'integrated_system': IntegratedSystem; - /** - * - * @type {Array} - * @memberof BasketWithProduct - */ - 'basket_items': Array; - /** - * Get the subtotal for the basket - * @type {number} - * @memberof BasketWithProduct - */ - 'subtotal': number; - /** - * Get the tax for the basket - * @type {number} - * @memberof BasketWithProduct - */ - 'tax': number; - /** - * - * @type {TaxRate} - * @memberof BasketWithProduct - */ - 'tax_rate': TaxRate; - /** - * Get the total price for the basket - * @type {number} - * @memberof BasketWithProduct - */ - 'total_price': number; + /** + * + * @type {number} + * @memberof BasketWithProduct + */ + id: number + /** + * + * @type {number} + * @memberof BasketWithProduct + */ + user: number + /** + * + * @type {IntegratedSystem} + * @memberof BasketWithProduct + */ + integrated_system: IntegratedSystem + /** + * + * @type {Array} + * @memberof BasketWithProduct + */ + basket_items: Array + /** + * Get the subtotal for the basket + * @type {number} + * @memberof BasketWithProduct + */ + subtotal: number + /** + * Get the tax for the basket + * @type {number} + * @memberof BasketWithProduct + */ + tax: number + /** + * + * @type {TaxRate} + * @memberof BasketWithProduct + */ + tax_rate: TaxRate + /** + * Get the total price for the basket + * @type {number} + * @memberof BasketWithProduct + */ + total_price: number } /** - * Serializer for companies. - * @export - * @interface Company - */ -export interface Company { - /** - * - * @type {number} - * @memberof Company - */ - 'id': number; - /** - * - * @type {string} - * @memberof Company - */ - 'name': string; -} -/** - * * `AF` - Afghanistan * `AX` - Åland Islands * `AL` - Albania * `DZ` - Algeria * `AS` - American Samoa * `AD` - Andorra * `AO` - Angola * `AI` - Anguilla * `AQ` - Antarctica * `AG` - Antigua and Barbuda * `AR` - Argentina * `AM` - Armenia * `AW` - Aruba * `AU` - Australia * `AT` - Austria * `AZ` - Azerbaijan * `BS` - Bahamas * `BH` - Bahrain * `BD` - Bangladesh * `BB` - Barbados * `BY` - Belarus * `BE` - Belgium * `BZ` - Belize * `BJ` - Benin * `BM` - Bermuda * `BT` - Bhutan * `BO` - Bolivia * `BQ` - Bonaire, Sint Eustatius and Saba * `BA` - Bosnia and Herzegovina * `BW` - Botswana * `BV` - Bouvet Island * `BR` - Brazil * `IO` - British Indian Ocean Territory * `BN` - Brunei * `BG` - Bulgaria * `BF` - Burkina Faso * `BI` - Burundi * `CV` - Cabo Verde * `KH` - Cambodia * `CM` - Cameroon * `CA` - Canada * `KY` - Cayman Islands * `CF` - Central African Republic * `TD` - Chad * `CL` - Chile * `CN` - China * `CX` - Christmas Island * `CC` - Cocos (Keeling) Islands * `CO` - Colombia * `KM` - Comoros * `CG` - Congo * `CD` - Congo (the Democratic Republic of the) * `CK` - Cook Islands * `CR` - Costa Rica * `CI` - Côte d\'Ivoire * `HR` - Croatia * `CU` - Cuba * `CW` - Curaçao * `CY` - Cyprus * `CZ` - Czechia * `DK` - Denmark * `DJ` - Djibouti * `DM` - Dominica * `DO` - Dominican Republic * `EC` - Ecuador * `EG` - Egypt * `SV` - El Salvador * `GQ` - Equatorial Guinea * `ER` - Eritrea * `EE` - Estonia * `SZ` - Eswatini * `ET` - Ethiopia * `FK` - Falkland Islands (Malvinas) * `FO` - Faroe Islands * `FJ` - Fiji * `FI` - Finland * `FR` - France * `GF` - French Guiana * `PF` - French Polynesia * `TF` - French Southern Territories * `GA` - Gabon * `GM` - Gambia * `GE` - Georgia * `DE` - Germany * `GH` - Ghana * `GI` - Gibraltar * `GR` - Greece * `GL` - Greenland * `GD` - Grenada * `GP` - Guadeloupe * `GU` - Guam * `GT` - Guatemala * `GG` - Guernsey * `GN` - Guinea * `GW` - Guinea-Bissau * `GY` - Guyana * `HT` - Haiti * `HM` - Heard Island and McDonald Islands * `VA` - Holy See * `HN` - Honduras * `HK` - Hong Kong * `HU` - Hungary * `IS` - Iceland * `IN` - India * `ID` - Indonesia * `IR` - Iran * `IQ` - Iraq * `IE` - Ireland * `IM` - Isle of Man * `IL` - Israel * `IT` - Italy * `JM` - Jamaica * `JP` - Japan * `JE` - Jersey * `JO` - Jordan * `KZ` - Kazakhstan * `KE` - Kenya * `KI` - Kiribati * `KW` - Kuwait * `KG` - Kyrgyzstan * `LA` - Laos * `LV` - Latvia * `LB` - Lebanon * `LS` - Lesotho * `LR` - Liberia * `LY` - Libya * `LI` - Liechtenstein * `LT` - Lithuania * `LU` - Luxembourg * `MO` - Macao * `MG` - Madagascar * `MW` - Malawi * `MY` - Malaysia * `MV` - Maldives * `ML` - Mali * `MT` - Malta * `MH` - Marshall Islands * `MQ` - Martinique * `MR` - Mauritania * `MU` - Mauritius * `YT` - Mayotte * `MX` - Mexico * `FM` - Micronesia * `MD` - Moldova * `MC` - Monaco * `MN` - Mongolia * `ME` - Montenegro * `MS` - Montserrat * `MA` - Morocco * `MZ` - Mozambique * `MM` - Myanmar * `NA` - Namibia * `NR` - Nauru * `NP` - Nepal * `NL` - Netherlands * `NC` - New Caledonia * `NZ` - New Zealand * `NI` - Nicaragua * `NE` - Niger * `NG` - Nigeria * `NU` - Niue * `NF` - Norfolk Island * `KP` - North Korea * `MK` - North Macedonia * `MP` - Northern Mariana Islands * `NO` - Norway * `OM` - Oman * `PK` - Pakistan * `PW` - Palau * `PS` - Palestine, State of * `PA` - Panama * `PG` - Papua New Guinea * `PY` - Paraguay * `PE` - Peru * `PH` - Philippines * `PN` - Pitcairn * `PL` - Poland * `PT` - Portugal * `PR` - Puerto Rico * `QA` - Qatar * `RE` - Réunion * `RO` - Romania * `RU` - Russia * `RW` - Rwanda * `BL` - Saint Barthélemy * `SH` - Saint Helena, Ascension and Tristan da Cunha * `KN` - Saint Kitts and Nevis * `LC` - Saint Lucia * `MF` - Saint Martin (French part) * `PM` - Saint Pierre and Miquelon * `VC` - Saint Vincent and the Grenadines * `WS` - Samoa * `SM` - San Marino * `ST` - Sao Tome and Principe * `SA` - Saudi Arabia * `SN` - Senegal * `RS` - Serbia * `SC` - Seychelles * `SL` - Sierra Leone * `SG` - Singapore * `SX` - Sint Maarten (Dutch part) * `SK` - Slovakia * `SI` - Slovenia * `SB` - Solomon Islands * `SO` - Somalia * `ZA` - South Africa * `GS` - South Georgia and the South Sandwich Islands * `KR` - South Korea * `SS` - South Sudan * `ES` - Spain * `LK` - Sri Lanka * `SD` - Sudan * `SR` - Suriname * `SJ` - Svalbard and Jan Mayen * `SE` - Sweden * `CH` - Switzerland * `SY` - Syria * `TW` - Taiwan * `TJ` - Tajikistan * `TZ` - Tanzania * `TH` - Thailand * `TL` - Timor-Leste * `TG` - Togo * `TK` - Tokelau * `TO` - Tonga * `TT` - Trinidad and Tobago * `TN` - Tunisia * `TR` - Türkiye * `TM` - Turkmenistan * `TC` - Turks and Caicos Islands * `TV` - Tuvalu * `UG` - Uganda * `UA` - Ukraine * `AE` - United Arab Emirates * `GB` - United Kingdom * `UM` - United States Minor Outlying Islands * `US` - United States of America * `UY` - Uruguay * `UZ` - Uzbekistan * `VU` - Vanuatu * `VE` - Venezuela * `VN` - Vietnam * `VG` - Virgin Islands (British) * `VI` - Virgin Islands (U.S.) * `WF` - Wallis and Futuna * `EH` - Western Sahara * `YE` - Yemen * `ZM` - Zambia * `ZW` - Zimbabwe - * @export - * @enum {string} - */ - -export const CountryCodeEnumDescriptions = { - 'AF': "Afghanistan", - 'AX': "Åland Islands", - 'AL': "Albania", - 'DZ': "Algeria", - 'AS': "American Samoa", - 'AD': "Andorra", - 'AO': "Angola", - 'AI': "Anguilla", - 'AQ': "Antarctica", - 'AG': "Antigua and Barbuda", - 'AR': "Argentina", - 'AM': "Armenia", - 'AW': "Aruba", - 'AU': "Australia", - 'AT': "Austria", - 'AZ': "Azerbaijan", - 'BS': "Bahamas", - 'BH': "Bahrain", - 'BD': "Bangladesh", - 'BB': "Barbados", - 'BY': "Belarus", - 'BE': "Belgium", - 'BZ': "Belize", - 'BJ': "Benin", - 'BM': "Bermuda", - 'BT': "Bhutan", - 'BO': "Bolivia", - 'BQ': "Bonaire, Sint Eustatius and Saba", - 'BA': "Bosnia and Herzegovina", - 'BW': "Botswana", - 'BV': "Bouvet Island", - 'BR': "Brazil", - 'IO': "British Indian Ocean Territory", - 'BN': "Brunei", - 'BG': "Bulgaria", - 'BF': "Burkina Faso", - 'BI': "Burundi", - 'CV': "Cabo Verde", - 'KH': "Cambodia", - 'CM': "Cameroon", - 'CA': "Canada", - 'KY': "Cayman Islands", - 'CF': "Central African Republic", - 'TD': "Chad", - 'CL': "Chile", - 'CN': "China", - 'CX': "Christmas Island", - 'CC': "Cocos (Keeling) Islands", - 'CO': "Colombia", - 'KM': "Comoros", - 'CG': "Congo", - 'CD': "Congo (the Democratic Republic of the)", - 'CK': "Cook Islands", - 'CR': "Costa Rica", - 'CI': "Côte d'Ivoire", - 'HR': "Croatia", - 'CU': "Cuba", - 'CW': "Curaçao", - 'CY': "Cyprus", - 'CZ': "Czechia", - 'DK': "Denmark", - 'DJ': "Djibouti", - 'DM': "Dominica", - 'DO': "Dominican Republic", - 'EC': "Ecuador", - 'EG': "Egypt", - 'SV': "El Salvador", - 'GQ': "Equatorial Guinea", - 'ER': "Eritrea", - 'EE': "Estonia", - 'SZ': "Eswatini", - 'ET': "Ethiopia", - 'FK': "Falkland Islands (Malvinas)", - 'FO': "Faroe Islands", - 'FJ': "Fiji", - 'FI': "Finland", - 'FR': "France", - 'GF': "French Guiana", - 'PF': "French Polynesia", - 'TF': "French Southern Territories", - 'GA': "Gabon", - 'GM': "Gambia", - 'GE': "Georgia", - 'DE': "Germany", - 'GH': "Ghana", - 'GI': "Gibraltar", - 'GR': "Greece", - 'GL': "Greenland", - 'GD': "Grenada", - 'GP': "Guadeloupe", - 'GU': "Guam", - 'GT': "Guatemala", - 'GG': "Guernsey", - 'GN': "Guinea", - 'GW': "Guinea-Bissau", - 'GY': "Guyana", - 'HT': "Haiti", - 'HM': "Heard Island and McDonald Islands", - 'VA': "Holy See", - 'HN': "Honduras", - 'HK': "Hong Kong", - 'HU': "Hungary", - 'IS': "Iceland", - 'IN': "India", - 'ID': "Indonesia", - 'IR': "Iran", - 'IQ': "Iraq", - 'IE': "Ireland", - 'IM': "Isle of Man", - 'IL': "Israel", - 'IT': "Italy", - 'JM': "Jamaica", - 'JP': "Japan", - 'JE': "Jersey", - 'JO': "Jordan", - 'KZ': "Kazakhstan", - 'KE': "Kenya", - 'KI': "Kiribati", - 'KW': "Kuwait", - 'KG': "Kyrgyzstan", - 'LA': "Laos", - 'LV': "Latvia", - 'LB': "Lebanon", - 'LS': "Lesotho", - 'LR': "Liberia", - 'LY': "Libya", - 'LI': "Liechtenstein", - 'LT': "Lithuania", - 'LU': "Luxembourg", - 'MO': "Macao", - 'MG': "Madagascar", - 'MW': "Malawi", - 'MY': "Malaysia", - 'MV': "Maldives", - 'ML': "Mali", - 'MT': "Malta", - 'MH': "Marshall Islands", - 'MQ': "Martinique", - 'MR': "Mauritania", - 'MU': "Mauritius", - 'YT': "Mayotte", - 'MX': "Mexico", - 'FM': "Micronesia", - 'MD': "Moldova", - 'MC': "Monaco", - 'MN': "Mongolia", - 'ME': "Montenegro", - 'MS': "Montserrat", - 'MA': "Morocco", - 'MZ': "Mozambique", - 'MM': "Myanmar", - 'NA': "Namibia", - 'NR': "Nauru", - 'NP': "Nepal", - 'NL': "Netherlands", - 'NC': "New Caledonia", - 'NZ': "New Zealand", - 'NI': "Nicaragua", - 'NE': "Niger", - 'NG': "Nigeria", - 'NU': "Niue", - 'NF': "Norfolk Island", - 'KP': "North Korea", - 'MK': "North Macedonia", - 'MP': "Northern Mariana Islands", - 'NO': "Norway", - 'OM': "Oman", - 'PK': "Pakistan", - 'PW': "Palau", - 'PS': "Palestine, State of", - 'PA': "Panama", - 'PG': "Papua New Guinea", - 'PY': "Paraguay", - 'PE': "Peru", - 'PH': "Philippines", - 'PN': "Pitcairn", - 'PL': "Poland", - 'PT': "Portugal", - 'PR': "Puerto Rico", - 'QA': "Qatar", - 'RE': "Réunion", - 'RO': "Romania", - 'RU': "Russia", - 'RW': "Rwanda", - 'BL': "Saint Barthélemy", - 'SH': "Saint Helena, Ascension and Tristan da Cunha", - 'KN': "Saint Kitts and Nevis", - 'LC': "Saint Lucia", - 'MF': "Saint Martin (French part)", - 'PM': "Saint Pierre and Miquelon", - 'VC': "Saint Vincent and the Grenadines", - 'WS': "Samoa", - 'SM': "San Marino", - 'ST': "Sao Tome and Principe", - 'SA': "Saudi Arabia", - 'SN': "Senegal", - 'RS': "Serbia", - 'SC': "Seychelles", - 'SL': "Sierra Leone", - 'SG': "Singapore", - 'SX': "Sint Maarten (Dutch part)", - 'SK': "Slovakia", - 'SI': "Slovenia", - 'SB': "Solomon Islands", - 'SO': "Somalia", - 'ZA': "South Africa", - 'GS': "South Georgia and the South Sandwich Islands", - 'KR': "South Korea", - 'SS': "South Sudan", - 'ES': "Spain", - 'LK': "Sri Lanka", - 'SD': "Sudan", - 'SR': "Suriname", - 'SJ': "Svalbard and Jan Mayen", - 'SE': "Sweden", - 'CH': "Switzerland", - 'SY': "Syria", - 'TW': "Taiwan", - 'TJ': "Tajikistan", - 'TZ': "Tanzania", - 'TH': "Thailand", - 'TL': "Timor-Leste", - 'TG': "Togo", - 'TK': "Tokelau", - 'TO': "Tonga", - 'TT': "Trinidad and Tobago", - 'TN': "Tunisia", - 'TR': "Türkiye", - 'TM': "Turkmenistan", - 'TC': "Turks and Caicos Islands", - 'TV': "Tuvalu", - 'UG': "Uganda", - 'UA': "Ukraine", - 'AE': "United Arab Emirates", - 'GB': "United Kingdom", - 'UM': "United States Minor Outlying Islands", - 'US': "United States of America", - 'UY': "Uruguay", - 'UZ': "Uzbekistan", - 'VU': "Vanuatu", - 'VE': "Venezuela", - 'VN': "Vietnam", - 'VG': "Virgin Islands (British)", - 'VI': "Virgin Islands (U.S.)", - 'WF': "Wallis and Futuna", - 'EH': "Western Sahara", - 'YE': "Yemen", - 'ZM': "Zambia", - 'ZW': "Zimbabwe", -} as const; - -export const CountryCodeEnum = { - /** - * Afghanistan - */ - Af: 'AF', - /** - * Åland Islands - */ - Ax: 'AX', - /** - * Albania - */ - Al: 'AL', - /** - * Algeria - */ - Dz: 'DZ', - /** - * American Samoa - */ - As: 'AS', - /** - * Andorra - */ - Ad: 'AD', - /** - * Angola - */ - Ao: 'AO', - /** - * Anguilla - */ - Ai: 'AI', - /** - * Antarctica - */ - Aq: 'AQ', - /** - * Antigua and Barbuda - */ - Ag: 'AG', - /** - * Argentina - */ - Ar: 'AR', - /** - * Armenia - */ - Am: 'AM', - /** - * Aruba - */ - Aw: 'AW', - /** - * Australia - */ - Au: 'AU', - /** - * Austria - */ - At: 'AT', - /** - * Azerbaijan - */ - Az: 'AZ', - /** - * Bahamas - */ - Bs: 'BS', - /** - * Bahrain - */ - Bh: 'BH', - /** - * Bangladesh - */ - Bd: 'BD', - /** - * Barbados - */ - Bb: 'BB', - /** - * Belarus - */ - By: 'BY', - /** - * Belgium - */ - Be: 'BE', - /** - * Belize - */ - Bz: 'BZ', - /** - * Benin - */ - Bj: 'BJ', - /** - * Bermuda - */ - Bm: 'BM', - /** - * Bhutan - */ - Bt: 'BT', - /** - * Bolivia - */ - Bo: 'BO', - /** - * Bonaire, Sint Eustatius and Saba - */ - Bq: 'BQ', - /** - * Bosnia and Herzegovina - */ - Ba: 'BA', - /** - * Botswana - */ - Bw: 'BW', - /** - * Bouvet Island - */ - Bv: 'BV', - /** - * Brazil - */ - Br: 'BR', - /** - * British Indian Ocean Territory - */ - Io: 'IO', - /** - * Brunei - */ - Bn: 'BN', - /** - * Bulgaria - */ - Bg: 'BG', - /** - * Burkina Faso - */ - Bf: 'BF', - /** - * Burundi - */ - Bi: 'BI', - /** - * Cabo Verde - */ - Cv: 'CV', - /** - * Cambodia - */ - Kh: 'KH', - /** - * Cameroon - */ - Cm: 'CM', - /** - * Canada - */ - Ca: 'CA', - /** - * Cayman Islands - */ - Ky: 'KY', - /** - * Central African Republic - */ - Cf: 'CF', - /** - * Chad - */ - Td: 'TD', - /** - * Chile - */ - Cl: 'CL', - /** - * China - */ - Cn: 'CN', - /** - * Christmas Island - */ - Cx: 'CX', - /** - * Cocos (Keeling) Islands - */ - Cc: 'CC', - /** - * Colombia - */ - Co: 'CO', - /** - * Comoros - */ - Km: 'KM', - /** - * Congo - */ - Cg: 'CG', - /** - * Congo (the Democratic Republic of the) - */ - Cd: 'CD', - /** - * Cook Islands - */ - Ck: 'CK', - /** - * Costa Rica - */ - Cr: 'CR', - /** - * Côte d'Ivoire - */ - Ci: 'CI', - /** - * Croatia - */ - Hr: 'HR', - /** - * Cuba - */ - Cu: 'CU', - /** - * Curaçao - */ - Cw: 'CW', - /** - * Cyprus - */ - Cy: 'CY', - /** - * Czechia - */ - Cz: 'CZ', - /** - * Denmark - */ - Dk: 'DK', - /** - * Djibouti - */ - Dj: 'DJ', - /** - * Dominica - */ - Dm: 'DM', - /** - * Dominican Republic - */ - Do: 'DO', - /** - * Ecuador - */ - Ec: 'EC', - /** - * Egypt - */ - Eg: 'EG', - /** - * El Salvador - */ - Sv: 'SV', - /** - * Equatorial Guinea - */ - Gq: 'GQ', - /** - * Eritrea - */ - Er: 'ER', - /** - * Estonia - */ - Ee: 'EE', - /** - * Eswatini - */ - Sz: 'SZ', - /** - * Ethiopia - */ - Et: 'ET', - /** - * Falkland Islands (Malvinas) - */ - Fk: 'FK', - /** - * Faroe Islands - */ - Fo: 'FO', - /** - * Fiji - */ - Fj: 'FJ', - /** - * Finland - */ - Fi: 'FI', - /** - * France - */ - Fr: 'FR', - /** - * French Guiana - */ - Gf: 'GF', - /** - * French Polynesia - */ - Pf: 'PF', - /** - * French Southern Territories - */ - Tf: 'TF', - /** - * Gabon - */ - Ga: 'GA', - /** - * Gambia - */ - Gm: 'GM', - /** - * Georgia - */ - Ge: 'GE', - /** - * Germany - */ - De: 'DE', - /** - * Ghana - */ - Gh: 'GH', - /** - * Gibraltar - */ - Gi: 'GI', - /** - * Greece - */ - Gr: 'GR', - /** - * Greenland - */ - Gl: 'GL', - /** - * Grenada - */ - Gd: 'GD', - /** - * Guadeloupe - */ - Gp: 'GP', - /** - * Guam - */ - Gu: 'GU', - /** - * Guatemala - */ - Gt: 'GT', - /** - * Guernsey - */ - Gg: 'GG', - /** - * Guinea - */ - Gn: 'GN', - /** - * Guinea-Bissau - */ - Gw: 'GW', - /** - * Guyana - */ - Gy: 'GY', - /** - * Haiti - */ - Ht: 'HT', - /** - * Heard Island and McDonald Islands - */ - Hm: 'HM', - /** - * Holy See - */ - Va: 'VA', - /** - * Honduras - */ - Hn: 'HN', - /** - * Hong Kong - */ - Hk: 'HK', - /** - * Hungary - */ - Hu: 'HU', - /** - * Iceland - */ - Is: 'IS', - /** - * India - */ - In: 'IN', - /** - * Indonesia - */ - Id: 'ID', - /** - * Iran - */ - Ir: 'IR', - /** - * Iraq - */ - Iq: 'IQ', - /** - * Ireland - */ - Ie: 'IE', - /** - * Isle of Man - */ - Im: 'IM', - /** - * Israel - */ - Il: 'IL', - /** - * Italy - */ - It: 'IT', - /** - * Jamaica - */ - Jm: 'JM', - /** - * Japan - */ - Jp: 'JP', - /** - * Jersey - */ - Je: 'JE', - /** - * Jordan - */ - Jo: 'JO', - /** - * Kazakhstan - */ - Kz: 'KZ', - /** - * Kenya - */ - Ke: 'KE', - /** - * Kiribati - */ - Ki: 'KI', - /** - * Kuwait - */ - Kw: 'KW', - /** - * Kyrgyzstan - */ - Kg: 'KG', - /** - * Laos - */ - La: 'LA', - /** - * Latvia - */ - Lv: 'LV', - /** - * Lebanon - */ - Lb: 'LB', - /** - * Lesotho - */ - Ls: 'LS', - /** - * Liberia - */ - Lr: 'LR', - /** - * Libya - */ - Ly: 'LY', - /** - * Liechtenstein - */ - Li: 'LI', - /** - * Lithuania - */ - Lt: 'LT', - /** - * Luxembourg - */ - Lu: 'LU', - /** - * Macao - */ - Mo: 'MO', - /** - * Madagascar - */ - Mg: 'MG', - /** - * Malawi - */ - Mw: 'MW', - /** - * Malaysia - */ - My: 'MY', - /** - * Maldives - */ - Mv: 'MV', - /** - * Mali - */ - Ml: 'ML', - /** - * Malta - */ - Mt: 'MT', - /** - * Marshall Islands - */ - Mh: 'MH', - /** - * Martinique - */ - Mq: 'MQ', - /** - * Mauritania - */ - Mr: 'MR', - /** - * Mauritius - */ - Mu: 'MU', - /** - * Mayotte - */ - Yt: 'YT', - /** - * Mexico - */ - Mx: 'MX', - /** - * Micronesia - */ - Fm: 'FM', - /** - * Moldova - */ - Md: 'MD', - /** - * Monaco - */ - Mc: 'MC', - /** - * Mongolia - */ - Mn: 'MN', - /** - * Montenegro - */ - Me: 'ME', - /** - * Montserrat - */ - Ms: 'MS', - /** - * Morocco - */ - Ma: 'MA', - /** - * Mozambique - */ - Mz: 'MZ', - /** - * Myanmar - */ - Mm: 'MM', - /** - * Namibia - */ - Na: 'NA', - /** - * Nauru - */ - Nr: 'NR', - /** - * Nepal - */ - Np: 'NP', - /** - * Netherlands - */ - Nl: 'NL', - /** - * New Caledonia - */ - Nc: 'NC', - /** - * New Zealand - */ - Nz: 'NZ', - /** - * Nicaragua - */ - Ni: 'NI', - /** - * Niger - */ - Ne: 'NE', - /** - * Nigeria - */ - Ng: 'NG', - /** - * Niue - */ - Nu: 'NU', - /** - * Norfolk Island - */ - Nf: 'NF', - /** - * North Korea - */ - Kp: 'KP', - /** - * North Macedonia - */ - Mk: 'MK', - /** - * Northern Mariana Islands - */ - Mp: 'MP', - /** - * Norway - */ - No: 'NO', - /** - * Oman - */ - Om: 'OM', - /** - * Pakistan - */ - Pk: 'PK', - /** - * Palau - */ - Pw: 'PW', - /** - * Palestine, State of - */ - Ps: 'PS', - /** - * Panama - */ - Pa: 'PA', - /** - * Papua New Guinea - */ - Pg: 'PG', - /** - * Paraguay - */ - Py: 'PY', - /** - * Peru - */ - Pe: 'PE', - /** - * Philippines - */ - Ph: 'PH', - /** - * Pitcairn - */ - Pn: 'PN', - /** - * Poland - */ - Pl: 'PL', - /** - * Portugal - */ - Pt: 'PT', - /** - * Puerto Rico - */ - Pr: 'PR', - /** - * Qatar - */ - Qa: 'QA', - /** - * Réunion - */ - Re: 'RE', - /** - * Romania - */ - Ro: 'RO', - /** - * Russia - */ - Ru: 'RU', - /** - * Rwanda - */ - Rw: 'RW', - /** - * Saint Barthélemy - */ - Bl: 'BL', - /** - * Saint Helena, Ascension and Tristan da Cunha - */ - Sh: 'SH', - /** - * Saint Kitts and Nevis - */ - Kn: 'KN', - /** - * Saint Lucia - */ - Lc: 'LC', - /** - * Saint Martin (French part) - */ - Mf: 'MF', - /** - * Saint Pierre and Miquelon - */ - Pm: 'PM', - /** - * Saint Vincent and the Grenadines - */ - Vc: 'VC', - /** - * Samoa - */ - Ws: 'WS', - /** - * San Marino - */ - Sm: 'SM', - /** - * Sao Tome and Principe - */ - St: 'ST', - /** - * Saudi Arabia - */ - Sa: 'SA', - /** - * Senegal - */ - Sn: 'SN', - /** - * Serbia - */ - Rs: 'RS', - /** - * Seychelles - */ - Sc: 'SC', - /** - * Sierra Leone - */ - Sl: 'SL', - /** - * Singapore - */ - Sg: 'SG', - /** - * Sint Maarten (Dutch part) - */ - Sx: 'SX', - /** - * Slovakia - */ - Sk: 'SK', - /** - * Slovenia - */ - Si: 'SI', - /** - * Solomon Islands - */ - Sb: 'SB', - /** - * Somalia - */ - So: 'SO', - /** - * South Africa - */ - Za: 'ZA', - /** - * South Georgia and the South Sandwich Islands - */ - Gs: 'GS', - /** - * South Korea - */ - Kr: 'KR', - /** - * South Sudan - */ - Ss: 'SS', - /** - * Spain - */ - Es: 'ES', - /** - * Sri Lanka - */ - Lk: 'LK', - /** - * Sudan - */ - Sd: 'SD', - /** - * Suriname - */ - Sr: 'SR', - /** - * Svalbard and Jan Mayen - */ - Sj: 'SJ', - /** - * Sweden - */ - Se: 'SE', - /** - * Switzerland - */ - Ch: 'CH', - /** - * Syria - */ - Sy: 'SY', - /** - * Taiwan - */ - Tw: 'TW', - /** - * Tajikistan - */ - Tj: 'TJ', - /** - * Tanzania - */ - Tz: 'TZ', - /** - * Thailand - */ - Th: 'TH', - /** - * Timor-Leste - */ - Tl: 'TL', - /** - * Togo - */ - Tg: 'TG', - /** - * Tokelau - */ - Tk: 'TK', - /** - * Tonga - */ - To: 'TO', - /** - * Trinidad and Tobago - */ - Tt: 'TT', - /** - * Tunisia - */ - Tn: 'TN', - /** - * Türkiye - */ - Tr: 'TR', - /** - * Turkmenistan - */ - Tm: 'TM', - /** - * Turks and Caicos Islands - */ - Tc: 'TC', - /** - * Tuvalu - */ - Tv: 'TV', - /** - * Uganda - */ - Ug: 'UG', - /** - * Ukraine - */ - Ua: 'UA', - /** - * United Arab Emirates - */ - Ae: 'AE', - /** - * United Kingdom - */ - Gb: 'GB', - /** - * United States Minor Outlying Islands - */ - Um: 'UM', - /** - * United States of America - */ - Us: 'US', - /** - * Uruguay - */ - Uy: 'UY', - /** - * Uzbekistan - */ - Uz: 'UZ', - /** - * Vanuatu - */ - Vu: 'VU', - /** - * Venezuela - */ - Ve: 'VE', - /** - * Vietnam - */ - Vn: 'VN', - /** - * Virgin Islands (British) - */ - Vg: 'VG', - /** - * Virgin Islands (U.S.) - */ - Vi: 'VI', - /** - * Wallis and Futuna - */ - Wf: 'WF', - /** - * Western Sahara - */ - Eh: 'EH', - /** - * Yemen - */ - Ye: 'YE', - /** - * Zambia - */ - Zm: 'ZM', - /** - * Zimbabwe - */ - Zw: 'ZW' -} as const; + * Serializer for companies. + * @export + * @interface Company + */ +export interface Company { + /** + * + * @type {number} + * @memberof Company + */ + id: number + /** + * + * @type {string} + * @memberof Company + */ + name: string +} +/** + * * `AF` - Afghanistan * `AX` - Åland Islands * `AL` - Albania * `DZ` - Algeria * `AS` - American Samoa * `AD` - Andorra * `AO` - Angola * `AI` - Anguilla * `AQ` - Antarctica * `AG` - Antigua and Barbuda * `AR` - Argentina * `AM` - Armenia * `AW` - Aruba * `AU` - Australia * `AT` - Austria * `AZ` - Azerbaijan * `BS` - Bahamas * `BH` - Bahrain * `BD` - Bangladesh * `BB` - Barbados * `BY` - Belarus * `BE` - Belgium * `BZ` - Belize * `BJ` - Benin * `BM` - Bermuda * `BT` - Bhutan * `BO` - Bolivia * `BQ` - Bonaire, Sint Eustatius and Saba * `BA` - Bosnia and Herzegovina * `BW` - Botswana * `BV` - Bouvet Island * `BR` - Brazil * `IO` - British Indian Ocean Territory * `BN` - Brunei * `BG` - Bulgaria * `BF` - Burkina Faso * `BI` - Burundi * `CV` - Cabo Verde * `KH` - Cambodia * `CM` - Cameroon * `CA` - Canada * `KY` - Cayman Islands * `CF` - Central African Republic * `TD` - Chad * `CL` - Chile * `CN` - China * `CX` - Christmas Island * `CC` - Cocos (Keeling) Islands * `CO` - Colombia * `KM` - Comoros * `CG` - Congo * `CD` - Congo (the Democratic Republic of the) * `CK` - Cook Islands * `CR` - Costa Rica * `CI` - Côte d\'Ivoire * `HR` - Croatia * `CU` - Cuba * `CW` - Curaçao * `CY` - Cyprus * `CZ` - Czechia * `DK` - Denmark * `DJ` - Djibouti * `DM` - Dominica * `DO` - Dominican Republic * `EC` - Ecuador * `EG` - Egypt * `SV` - El Salvador * `GQ` - Equatorial Guinea * `ER` - Eritrea * `EE` - Estonia * `SZ` - Eswatini * `ET` - Ethiopia * `FK` - Falkland Islands (Malvinas) * `FO` - Faroe Islands * `FJ` - Fiji * `FI` - Finland * `FR` - France * `GF` - French Guiana * `PF` - French Polynesia * `TF` - French Southern Territories * `GA` - Gabon * `GM` - Gambia * `GE` - Georgia * `DE` - Germany * `GH` - Ghana * `GI` - Gibraltar * `GR` - Greece * `GL` - Greenland * `GD` - Grenada * `GP` - Guadeloupe * `GU` - Guam * `GT` - Guatemala * `GG` - Guernsey * `GN` - Guinea * `GW` - Guinea-Bissau * `GY` - Guyana * `HT` - Haiti * `HM` - Heard Island and McDonald Islands * `VA` - Holy See * `HN` - Honduras * `HK` - Hong Kong * `HU` - Hungary * `IS` - Iceland * `IN` - India * `ID` - Indonesia * `IR` - Iran * `IQ` - Iraq * `IE` - Ireland * `IM` - Isle of Man * `IL` - Israel * `IT` - Italy * `JM` - Jamaica * `JP` - Japan * `JE` - Jersey * `JO` - Jordan * `KZ` - Kazakhstan * `KE` - Kenya * `KI` - Kiribati * `KW` - Kuwait * `KG` - Kyrgyzstan * `LA` - Laos * `LV` - Latvia * `LB` - Lebanon * `LS` - Lesotho * `LR` - Liberia * `LY` - Libya * `LI` - Liechtenstein * `LT` - Lithuania * `LU` - Luxembourg * `MO` - Macao * `MG` - Madagascar * `MW` - Malawi * `MY` - Malaysia * `MV` - Maldives * `ML` - Mali * `MT` - Malta * `MH` - Marshall Islands * `MQ` - Martinique * `MR` - Mauritania * `MU` - Mauritius * `YT` - Mayotte * `MX` - Mexico * `FM` - Micronesia * `MD` - Moldova * `MC` - Monaco * `MN` - Mongolia * `ME` - Montenegro * `MS` - Montserrat * `MA` - Morocco * `MZ` - Mozambique * `MM` - Myanmar * `NA` - Namibia * `NR` - Nauru * `NP` - Nepal * `NL` - Netherlands * `NC` - New Caledonia * `NZ` - New Zealand * `NI` - Nicaragua * `NE` - Niger * `NG` - Nigeria * `NU` - Niue * `NF` - Norfolk Island * `KP` - North Korea * `MK` - North Macedonia * `MP` - Northern Mariana Islands * `NO` - Norway * `OM` - Oman * `PK` - Pakistan * `PW` - Palau * `PS` - Palestine, State of * `PA` - Panama * `PG` - Papua New Guinea * `PY` - Paraguay * `PE` - Peru * `PH` - Philippines * `PN` - Pitcairn * `PL` - Poland * `PT` - Portugal * `PR` - Puerto Rico * `QA` - Qatar * `RE` - Réunion * `RO` - Romania * `RU` - Russia * `RW` - Rwanda * `BL` - Saint Barthélemy * `SH` - Saint Helena, Ascension and Tristan da Cunha * `KN` - Saint Kitts and Nevis * `LC` - Saint Lucia * `MF` - Saint Martin (French part) * `PM` - Saint Pierre and Miquelon * `VC` - Saint Vincent and the Grenadines * `WS` - Samoa * `SM` - San Marino * `ST` - Sao Tome and Principe * `SA` - Saudi Arabia * `SN` - Senegal * `RS` - Serbia * `SC` - Seychelles * `SL` - Sierra Leone * `SG` - Singapore * `SX` - Sint Maarten (Dutch part) * `SK` - Slovakia * `SI` - Slovenia * `SB` - Solomon Islands * `SO` - Somalia * `ZA` - South Africa * `GS` - South Georgia and the South Sandwich Islands * `KR` - South Korea * `SS` - South Sudan * `ES` - Spain * `LK` - Sri Lanka * `SD` - Sudan * `SR` - Suriname * `SJ` - Svalbard and Jan Mayen * `SE` - Sweden * `CH` - Switzerland * `SY` - Syria * `TW` - Taiwan * `TJ` - Tajikistan * `TZ` - Tanzania * `TH` - Thailand * `TL` - Timor-Leste * `TG` - Togo * `TK` - Tokelau * `TO` - Tonga * `TT` - Trinidad and Tobago * `TN` - Tunisia * `TR` - Türkiye * `TM` - Turkmenistan * `TC` - Turks and Caicos Islands * `TV` - Tuvalu * `UG` - Uganda * `UA` - Ukraine * `AE` - United Arab Emirates * `GB` - United Kingdom * `UM` - United States Minor Outlying Islands * `US` - United States of America * `UY` - Uruguay * `UZ` - Uzbekistan * `VU` - Vanuatu * `VE` - Venezuela * `VN` - Vietnam * `VG` - Virgin Islands (British) * `VI` - Virgin Islands (U.S.) * `WF` - Wallis and Futuna * `EH` - Western Sahara * `YE` - Yemen * `ZM` - Zambia * `ZW` - Zimbabwe + * @export + * @enum {string} + */ -export type CountryCodeEnum = typeof CountryCodeEnum[keyof typeof CountryCodeEnum]; +export const CountryCodeEnumDescriptions = { + AF: "Afghanistan", + AX: "Åland Islands", + AL: "Albania", + DZ: "Algeria", + AS: "American Samoa", + AD: "Andorra", + AO: "Angola", + AI: "Anguilla", + AQ: "Antarctica", + AG: "Antigua and Barbuda", + AR: "Argentina", + AM: "Armenia", + AW: "Aruba", + AU: "Australia", + AT: "Austria", + AZ: "Azerbaijan", + BS: "Bahamas", + BH: "Bahrain", + BD: "Bangladesh", + BB: "Barbados", + BY: "Belarus", + BE: "Belgium", + BZ: "Belize", + BJ: "Benin", + BM: "Bermuda", + BT: "Bhutan", + BO: "Bolivia", + BQ: "Bonaire, Sint Eustatius and Saba", + BA: "Bosnia and Herzegovina", + BW: "Botswana", + BV: "Bouvet Island", + BR: "Brazil", + IO: "British Indian Ocean Territory", + BN: "Brunei", + BG: "Bulgaria", + BF: "Burkina Faso", + BI: "Burundi", + CV: "Cabo Verde", + KH: "Cambodia", + CM: "Cameroon", + CA: "Canada", + KY: "Cayman Islands", + CF: "Central African Republic", + TD: "Chad", + CL: "Chile", + CN: "China", + CX: "Christmas Island", + CC: "Cocos (Keeling) Islands", + CO: "Colombia", + KM: "Comoros", + CG: "Congo", + CD: "Congo (the Democratic Republic of the)", + CK: "Cook Islands", + CR: "Costa Rica", + CI: "Côte d'Ivoire", + HR: "Croatia", + CU: "Cuba", + CW: "Curaçao", + CY: "Cyprus", + CZ: "Czechia", + DK: "Denmark", + DJ: "Djibouti", + DM: "Dominica", + DO: "Dominican Republic", + EC: "Ecuador", + EG: "Egypt", + SV: "El Salvador", + GQ: "Equatorial Guinea", + ER: "Eritrea", + EE: "Estonia", + SZ: "Eswatini", + ET: "Ethiopia", + FK: "Falkland Islands (Malvinas)", + FO: "Faroe Islands", + FJ: "Fiji", + FI: "Finland", + FR: "France", + GF: "French Guiana", + PF: "French Polynesia", + TF: "French Southern Territories", + GA: "Gabon", + GM: "Gambia", + GE: "Georgia", + DE: "Germany", + GH: "Ghana", + GI: "Gibraltar", + GR: "Greece", + GL: "Greenland", + GD: "Grenada", + GP: "Guadeloupe", + GU: "Guam", + GT: "Guatemala", + GG: "Guernsey", + GN: "Guinea", + GW: "Guinea-Bissau", + GY: "Guyana", + HT: "Haiti", + HM: "Heard Island and McDonald Islands", + VA: "Holy See", + HN: "Honduras", + HK: "Hong Kong", + HU: "Hungary", + IS: "Iceland", + IN: "India", + ID: "Indonesia", + IR: "Iran", + IQ: "Iraq", + IE: "Ireland", + IM: "Isle of Man", + IL: "Israel", + IT: "Italy", + JM: "Jamaica", + JP: "Japan", + JE: "Jersey", + JO: "Jordan", + KZ: "Kazakhstan", + KE: "Kenya", + KI: "Kiribati", + KW: "Kuwait", + KG: "Kyrgyzstan", + LA: "Laos", + LV: "Latvia", + LB: "Lebanon", + LS: "Lesotho", + LR: "Liberia", + LY: "Libya", + LI: "Liechtenstein", + LT: "Lithuania", + LU: "Luxembourg", + MO: "Macao", + MG: "Madagascar", + MW: "Malawi", + MY: "Malaysia", + MV: "Maldives", + ML: "Mali", + MT: "Malta", + MH: "Marshall Islands", + MQ: "Martinique", + MR: "Mauritania", + MU: "Mauritius", + YT: "Mayotte", + MX: "Mexico", + FM: "Micronesia", + MD: "Moldova", + MC: "Monaco", + MN: "Mongolia", + ME: "Montenegro", + MS: "Montserrat", + MA: "Morocco", + MZ: "Mozambique", + MM: "Myanmar", + NA: "Namibia", + NR: "Nauru", + NP: "Nepal", + NL: "Netherlands", + NC: "New Caledonia", + NZ: "New Zealand", + NI: "Nicaragua", + NE: "Niger", + NG: "Nigeria", + NU: "Niue", + NF: "Norfolk Island", + KP: "North Korea", + MK: "North Macedonia", + MP: "Northern Mariana Islands", + NO: "Norway", + OM: "Oman", + PK: "Pakistan", + PW: "Palau", + PS: "Palestine, State of", + PA: "Panama", + PG: "Papua New Guinea", + PY: "Paraguay", + PE: "Peru", + PH: "Philippines", + PN: "Pitcairn", + PL: "Poland", + PT: "Portugal", + PR: "Puerto Rico", + QA: "Qatar", + RE: "Réunion", + RO: "Romania", + RU: "Russia", + RW: "Rwanda", + BL: "Saint Barthélemy", + SH: "Saint Helena, Ascension and Tristan da Cunha", + KN: "Saint Kitts and Nevis", + LC: "Saint Lucia", + MF: "Saint Martin (French part)", + PM: "Saint Pierre and Miquelon", + VC: "Saint Vincent and the Grenadines", + WS: "Samoa", + SM: "San Marino", + ST: "Sao Tome and Principe", + SA: "Saudi Arabia", + SN: "Senegal", + RS: "Serbia", + SC: "Seychelles", + SL: "Sierra Leone", + SG: "Singapore", + SX: "Sint Maarten (Dutch part)", + SK: "Slovakia", + SI: "Slovenia", + SB: "Solomon Islands", + SO: "Somalia", + ZA: "South Africa", + GS: "South Georgia and the South Sandwich Islands", + KR: "South Korea", + SS: "South Sudan", + ES: "Spain", + LK: "Sri Lanka", + SD: "Sudan", + SR: "Suriname", + SJ: "Svalbard and Jan Mayen", + SE: "Sweden", + CH: "Switzerland", + SY: "Syria", + TW: "Taiwan", + TJ: "Tajikistan", + TZ: "Tanzania", + TH: "Thailand", + TL: "Timor-Leste", + TG: "Togo", + TK: "Tokelau", + TO: "Tonga", + TT: "Trinidad and Tobago", + TN: "Tunisia", + TR: "Türkiye", + TM: "Turkmenistan", + TC: "Turks and Caicos Islands", + TV: "Tuvalu", + UG: "Uganda", + UA: "Ukraine", + AE: "United Arab Emirates", + GB: "United Kingdom", + UM: "United States Minor Outlying Islands", + US: "United States of America", + UY: "Uruguay", + UZ: "Uzbekistan", + VU: "Vanuatu", + VE: "Venezuela", + VN: "Vietnam", + VG: "Virgin Islands (British)", + VI: "Virgin Islands (U.S.)", + WF: "Wallis and Futuna", + EH: "Western Sahara", + YE: "Yemen", + ZM: "Zambia", + ZW: "Zimbabwe", +} as const +export const CountryCodeEnum = { + /** + * Afghanistan + */ + Af: "AF", + /** + * Åland Islands + */ + Ax: "AX", + /** + * Albania + */ + Al: "AL", + /** + * Algeria + */ + Dz: "DZ", + /** + * American Samoa + */ + As: "AS", + /** + * Andorra + */ + Ad: "AD", + /** + * Angola + */ + Ao: "AO", + /** + * Anguilla + */ + Ai: "AI", + /** + * Antarctica + */ + Aq: "AQ", + /** + * Antigua and Barbuda + */ + Ag: "AG", + /** + * Argentina + */ + Ar: "AR", + /** + * Armenia + */ + Am: "AM", + /** + * Aruba + */ + Aw: "AW", + /** + * Australia + */ + Au: "AU", + /** + * Austria + */ + At: "AT", + /** + * Azerbaijan + */ + Az: "AZ", + /** + * Bahamas + */ + Bs: "BS", + /** + * Bahrain + */ + Bh: "BH", + /** + * Bangladesh + */ + Bd: "BD", + /** + * Barbados + */ + Bb: "BB", + /** + * Belarus + */ + By: "BY", + /** + * Belgium + */ + Be: "BE", + /** + * Belize + */ + Bz: "BZ", + /** + * Benin + */ + Bj: "BJ", + /** + * Bermuda + */ + Bm: "BM", + /** + * Bhutan + */ + Bt: "BT", + /** + * Bolivia + */ + Bo: "BO", + /** + * Bonaire, Sint Eustatius and Saba + */ + Bq: "BQ", + /** + * Bosnia and Herzegovina + */ + Ba: "BA", + /** + * Botswana + */ + Bw: "BW", + /** + * Bouvet Island + */ + Bv: "BV", + /** + * Brazil + */ + Br: "BR", + /** + * British Indian Ocean Territory + */ + Io: "IO", + /** + * Brunei + */ + Bn: "BN", + /** + * Bulgaria + */ + Bg: "BG", + /** + * Burkina Faso + */ + Bf: "BF", + /** + * Burundi + */ + Bi: "BI", + /** + * Cabo Verde + */ + Cv: "CV", + /** + * Cambodia + */ + Kh: "KH", + /** + * Cameroon + */ + Cm: "CM", + /** + * Canada + */ + Ca: "CA", + /** + * Cayman Islands + */ + Ky: "KY", + /** + * Central African Republic + */ + Cf: "CF", + /** + * Chad + */ + Td: "TD", + /** + * Chile + */ + Cl: "CL", + /** + * China + */ + Cn: "CN", + /** + * Christmas Island + */ + Cx: "CX", + /** + * Cocos (Keeling) Islands + */ + Cc: "CC", + /** + * Colombia + */ + Co: "CO", + /** + * Comoros + */ + Km: "KM", + /** + * Congo + */ + Cg: "CG", + /** + * Congo (the Democratic Republic of the) + */ + Cd: "CD", + /** + * Cook Islands + */ + Ck: "CK", + /** + * Costa Rica + */ + Cr: "CR", + /** + * Côte d'Ivoire + */ + Ci: "CI", + /** + * Croatia + */ + Hr: "HR", + /** + * Cuba + */ + Cu: "CU", + /** + * Curaçao + */ + Cw: "CW", + /** + * Cyprus + */ + Cy: "CY", + /** + * Czechia + */ + Cz: "CZ", + /** + * Denmark + */ + Dk: "DK", + /** + * Djibouti + */ + Dj: "DJ", + /** + * Dominica + */ + Dm: "DM", + /** + * Dominican Republic + */ + Do: "DO", + /** + * Ecuador + */ + Ec: "EC", + /** + * Egypt + */ + Eg: "EG", + /** + * El Salvador + */ + Sv: "SV", + /** + * Equatorial Guinea + */ + Gq: "GQ", + /** + * Eritrea + */ + Er: "ER", + /** + * Estonia + */ + Ee: "EE", + /** + * Eswatini + */ + Sz: "SZ", + /** + * Ethiopia + */ + Et: "ET", + /** + * Falkland Islands (Malvinas) + */ + Fk: "FK", + /** + * Faroe Islands + */ + Fo: "FO", + /** + * Fiji + */ + Fj: "FJ", + /** + * Finland + */ + Fi: "FI", + /** + * France + */ + Fr: "FR", + /** + * French Guiana + */ + Gf: "GF", + /** + * French Polynesia + */ + Pf: "PF", + /** + * French Southern Territories + */ + Tf: "TF", + /** + * Gabon + */ + Ga: "GA", + /** + * Gambia + */ + Gm: "GM", + /** + * Georgia + */ + Ge: "GE", + /** + * Germany + */ + De: "DE", + /** + * Ghana + */ + Gh: "GH", + /** + * Gibraltar + */ + Gi: "GI", + /** + * Greece + */ + Gr: "GR", + /** + * Greenland + */ + Gl: "GL", + /** + * Grenada + */ + Gd: "GD", + /** + * Guadeloupe + */ + Gp: "GP", + /** + * Guam + */ + Gu: "GU", + /** + * Guatemala + */ + Gt: "GT", + /** + * Guernsey + */ + Gg: "GG", + /** + * Guinea + */ + Gn: "GN", + /** + * Guinea-Bissau + */ + Gw: "GW", + /** + * Guyana + */ + Gy: "GY", + /** + * Haiti + */ + Ht: "HT", + /** + * Heard Island and McDonald Islands + */ + Hm: "HM", + /** + * Holy See + */ + Va: "VA", + /** + * Honduras + */ + Hn: "HN", + /** + * Hong Kong + */ + Hk: "HK", + /** + * Hungary + */ + Hu: "HU", + /** + * Iceland + */ + Is: "IS", + /** + * India + */ + In: "IN", + /** + * Indonesia + */ + Id: "ID", + /** + * Iran + */ + Ir: "IR", + /** + * Iraq + */ + Iq: "IQ", + /** + * Ireland + */ + Ie: "IE", + /** + * Isle of Man + */ + Im: "IM", + /** + * Israel + */ + Il: "IL", + /** + * Italy + */ + It: "IT", + /** + * Jamaica + */ + Jm: "JM", + /** + * Japan + */ + Jp: "JP", + /** + * Jersey + */ + Je: "JE", + /** + * Jordan + */ + Jo: "JO", + /** + * Kazakhstan + */ + Kz: "KZ", + /** + * Kenya + */ + Ke: "KE", + /** + * Kiribati + */ + Ki: "KI", + /** + * Kuwait + */ + Kw: "KW", + /** + * Kyrgyzstan + */ + Kg: "KG", + /** + * Laos + */ + La: "LA", + /** + * Latvia + */ + Lv: "LV", + /** + * Lebanon + */ + Lb: "LB", + /** + * Lesotho + */ + Ls: "LS", + /** + * Liberia + */ + Lr: "LR", + /** + * Libya + */ + Ly: "LY", + /** + * Liechtenstein + */ + Li: "LI", + /** + * Lithuania + */ + Lt: "LT", + /** + * Luxembourg + */ + Lu: "LU", + /** + * Macao + */ + Mo: "MO", + /** + * Madagascar + */ + Mg: "MG", + /** + * Malawi + */ + Mw: "MW", + /** + * Malaysia + */ + My: "MY", + /** + * Maldives + */ + Mv: "MV", + /** + * Mali + */ + Ml: "ML", + /** + * Malta + */ + Mt: "MT", + /** + * Marshall Islands + */ + Mh: "MH", + /** + * Martinique + */ + Mq: "MQ", + /** + * Mauritania + */ + Mr: "MR", + /** + * Mauritius + */ + Mu: "MU", + /** + * Mayotte + */ + Yt: "YT", + /** + * Mexico + */ + Mx: "MX", + /** + * Micronesia + */ + Fm: "FM", + /** + * Moldova + */ + Md: "MD", + /** + * Monaco + */ + Mc: "MC", + /** + * Mongolia + */ + Mn: "MN", + /** + * Montenegro + */ + Me: "ME", + /** + * Montserrat + */ + Ms: "MS", + /** + * Morocco + */ + Ma: "MA", + /** + * Mozambique + */ + Mz: "MZ", + /** + * Myanmar + */ + Mm: "MM", + /** + * Namibia + */ + Na: "NA", + /** + * Nauru + */ + Nr: "NR", + /** + * Nepal + */ + Np: "NP", + /** + * Netherlands + */ + Nl: "NL", + /** + * New Caledonia + */ + Nc: "NC", + /** + * New Zealand + */ + Nz: "NZ", + /** + * Nicaragua + */ + Ni: "NI", + /** + * Niger + */ + Ne: "NE", + /** + * Nigeria + */ + Ng: "NG", + /** + * Niue + */ + Nu: "NU", + /** + * Norfolk Island + */ + Nf: "NF", + /** + * North Korea + */ + Kp: "KP", + /** + * North Macedonia + */ + Mk: "MK", + /** + * Northern Mariana Islands + */ + Mp: "MP", + /** + * Norway + */ + No: "NO", + /** + * Oman + */ + Om: "OM", + /** + * Pakistan + */ + Pk: "PK", + /** + * Palau + */ + Pw: "PW", + /** + * Palestine, State of + */ + Ps: "PS", + /** + * Panama + */ + Pa: "PA", + /** + * Papua New Guinea + */ + Pg: "PG", + /** + * Paraguay + */ + Py: "PY", + /** + * Peru + */ + Pe: "PE", + /** + * Philippines + */ + Ph: "PH", + /** + * Pitcairn + */ + Pn: "PN", + /** + * Poland + */ + Pl: "PL", + /** + * Portugal + */ + Pt: "PT", + /** + * Puerto Rico + */ + Pr: "PR", + /** + * Qatar + */ + Qa: "QA", + /** + * Réunion + */ + Re: "RE", + /** + * Romania + */ + Ro: "RO", + /** + * Russia + */ + Ru: "RU", + /** + * Rwanda + */ + Rw: "RW", + /** + * Saint Barthélemy + */ + Bl: "BL", + /** + * Saint Helena, Ascension and Tristan da Cunha + */ + Sh: "SH", + /** + * Saint Kitts and Nevis + */ + Kn: "KN", + /** + * Saint Lucia + */ + Lc: "LC", + /** + * Saint Martin (French part) + */ + Mf: "MF", + /** + * Saint Pierre and Miquelon + */ + Pm: "PM", + /** + * Saint Vincent and the Grenadines + */ + Vc: "VC", + /** + * Samoa + */ + Ws: "WS", + /** + * San Marino + */ + Sm: "SM", + /** + * Sao Tome and Principe + */ + St: "ST", + /** + * Saudi Arabia + */ + Sa: "SA", + /** + * Senegal + */ + Sn: "SN", + /** + * Serbia + */ + Rs: "RS", + /** + * Seychelles + */ + Sc: "SC", + /** + * Sierra Leone + */ + Sl: "SL", + /** + * Singapore + */ + Sg: "SG", + /** + * Sint Maarten (Dutch part) + */ + Sx: "SX", + /** + * Slovakia + */ + Sk: "SK", + /** + * Slovenia + */ + Si: "SI", + /** + * Solomon Islands + */ + Sb: "SB", + /** + * Somalia + */ + So: "SO", + /** + * South Africa + */ + Za: "ZA", + /** + * South Georgia and the South Sandwich Islands + */ + Gs: "GS", + /** + * South Korea + */ + Kr: "KR", + /** + * South Sudan + */ + Ss: "SS", + /** + * Spain + */ + Es: "ES", + /** + * Sri Lanka + */ + Lk: "LK", + /** + * Sudan + */ + Sd: "SD", + /** + * Suriname + */ + Sr: "SR", + /** + * Svalbard and Jan Mayen + */ + Sj: "SJ", + /** + * Sweden + */ + Se: "SE", + /** + * Switzerland + */ + Ch: "CH", + /** + * Syria + */ + Sy: "SY", + /** + * Taiwan + */ + Tw: "TW", + /** + * Tajikistan + */ + Tj: "TJ", + /** + * Tanzania + */ + Tz: "TZ", + /** + * Thailand + */ + Th: "TH", + /** + * Timor-Leste + */ + Tl: "TL", + /** + * Togo + */ + Tg: "TG", + /** + * Tokelau + */ + Tk: "TK", + /** + * Tonga + */ + To: "TO", + /** + * Trinidad and Tobago + */ + Tt: "TT", + /** + * Tunisia + */ + Tn: "TN", + /** + * Türkiye + */ + Tr: "TR", + /** + * Turkmenistan + */ + Tm: "TM", + /** + * Turks and Caicos Islands + */ + Tc: "TC", + /** + * Tuvalu + */ + Tv: "TV", + /** + * Uganda + */ + Ug: "UG", + /** + * Ukraine + */ + Ua: "UA", + /** + * United Arab Emirates + */ + Ae: "AE", + /** + * United Kingdom + */ + Gb: "GB", + /** + * United States Minor Outlying Islands + */ + Um: "UM", + /** + * United States of America + */ + Us: "US", + /** + * Uruguay + */ + Uy: "UY", + /** + * Uzbekistan + */ + Uz: "UZ", + /** + * Vanuatu + */ + Vu: "VU", + /** + * Venezuela + */ + Ve: "VE", + /** + * Vietnam + */ + Vn: "VN", + /** + * Virgin Islands (British) + */ + Vg: "VG", + /** + * Virgin Islands (U.S.) + */ + Vi: "VI", + /** + * Wallis and Futuna + */ + Wf: "WF", + /** + * Western Sahara + */ + Eh: "EH", + /** + * Yemen + */ + Ye: "YE", + /** + * Zambia + */ + Zm: "ZM", + /** + * Zimbabwe + */ + Zw: "ZW", +} as const + +export type CountryCodeEnum = + (typeof CountryCodeEnum)[keyof typeof CountryCodeEnum] /** * Really basic serializer for the payload that we need to send to CyberSource. @@ -1406,24 +1422,24 @@ export type CountryCodeEnum = typeof CountryCodeEnum[keyof typeof CountryCodeEnu * @interface CyberSourceCheckout */ export interface CyberSourceCheckout { - /** - * - * @type {{ [key: string]: any; }} - * @memberof CyberSourceCheckout - */ - 'payload': { [key: string]: any; }; - /** - * - * @type {string} - * @memberof CyberSourceCheckout - */ - 'url': string; - /** - * - * @type {string} - * @memberof CyberSourceCheckout - */ - 'method': string; + /** + * + * @type {{ [key: string]: any; }} + * @memberof CyberSourceCheckout + */ + payload: { [key: string]: any } + /** + * + * @type {string} + * @memberof CyberSourceCheckout + */ + url: string + /** + * + * @type {string} + * @memberof CyberSourceCheckout + */ + method: string } /** * Serializer for discounts. @@ -1431,75 +1447,74 @@ export interface CyberSourceCheckout { * @interface Discount */ export interface Discount { - /** - * - * @type {number} - * @memberof Discount - */ - 'id': number; - /** - * - * @type {string} - * @memberof Discount - */ - 'discount_code': string; - /** - * - * @type {string} - * @memberof Discount - */ - 'amount': string; - /** - * - * @type {PaymentTypeEnum} - * @memberof Discount - */ - 'payment_type'?: PaymentTypeEnum | null; - /** - * - * @type {number} - * @memberof Discount - */ - 'max_redemptions'?: number | null; - /** - * If set, this discount code will not be redeemable before this date. - * @type {string} - * @memberof Discount - */ - 'activation_date'?: string | null; - /** - * If set, this discount code will not be redeemable after this date. - * @type {string} - * @memberof Discount - */ - 'expiration_date'?: string | null; - /** - * - * @type {IntegratedSystem} - * @memberof Discount - */ - 'integrated_system': IntegratedSystem; - /** - * - * @type {Product} - * @memberof Discount - */ - 'product': Product; - /** - * - * @type {Array} - * @memberof Discount - */ - 'assigned_users': Array; - /** - * - * @type {Company} - * @memberof Discount - */ - 'company': Company; + /** + * + * @type {number} + * @memberof Discount + */ + id: number + /** + * + * @type {string} + * @memberof Discount + */ + discount_code: string + /** + * + * @type {string} + * @memberof Discount + */ + amount: string + /** + * + * @type {PaymentTypeEnum} + * @memberof Discount + */ + payment_type?: PaymentTypeEnum | null + /** + * + * @type {number} + * @memberof Discount + */ + max_redemptions?: number | null + /** + * If set, this discount code will not be redeemable before this date. + * @type {string} + * @memberof Discount + */ + activation_date?: string | null + /** + * If set, this discount code will not be redeemable after this date. + * @type {string} + * @memberof Discount + */ + expiration_date?: string | null + /** + * + * @type {IntegratedSystem} + * @memberof Discount + */ + integrated_system: IntegratedSystem + /** + * + * @type {Product} + * @memberof Discount + */ + product: Product + /** + * + * @type {Array} + * @memberof Discount + */ + assigned_users: Array + /** + * + * @type {Company} + * @memberof Discount + */ + company: Company } - /** * * `percent-off` - percent-off * `dollars-off` - dollars-off * `fixed-price` - fixed-price * @export @@ -1507,28 +1522,28 @@ export interface Discount { */ export const DiscountTypeEnumDescriptions = { - 'percent-off': "percent-off", - 'dollars-off': "dollars-off", - 'fixed-price': "fixed-price", -} as const; + "percent-off": "percent-off", + "dollars-off": "dollars-off", + "fixed-price": "fixed-price", +} as const export const DiscountTypeEnum = { - /** - * percent-off - */ - PercentOff: 'percent-off', - /** - * dollars-off - */ - DollarsOff: 'dollars-off', - /** - * fixed-price - */ - FixedPrice: 'fixed-price' -} as const; - -export type DiscountTypeEnum = typeof DiscountTypeEnum[keyof typeof DiscountTypeEnum]; - + /** + * percent-off + */ + PercentOff: "percent-off", + /** + * dollars-off + */ + DollarsOff: "dollars-off", + /** + * fixed-price + */ + FixedPrice: "fixed-price", +} as const + +export type DiscountTypeEnum = + (typeof DiscountTypeEnum)[keyof typeof DiscountTypeEnum] /** * Serializer for IntegratedSystem model. @@ -1536,30 +1551,30 @@ export type DiscountTypeEnum = typeof DiscountTypeEnum[keyof typeof DiscountType * @interface IntegratedSystem */ export interface IntegratedSystem { - /** - * - * @type {number} - * @memberof IntegratedSystem - */ - 'id': number; - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - 'name': string; - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - 'slug'?: string | null; - /** - * - * @type {string} - * @memberof IntegratedSystem - */ - 'description'?: string; + /** + * + * @type {number} + * @memberof IntegratedSystem + */ + id: number + /** + * + * @type {string} + * @memberof IntegratedSystem + */ + name: string + /** + * + * @type {string} + * @memberof IntegratedSystem + */ + slug?: string | null + /** + * + * @type {string} + * @memberof IntegratedSystem + */ + description?: string } /** * Serializer for IntegratedSystem model. @@ -1567,24 +1582,24 @@ export interface IntegratedSystem { * @interface IntegratedSystemRequest */ export interface IntegratedSystemRequest { - /** - * - * @type {string} - * @memberof IntegratedSystemRequest - */ - 'name': string; - /** - * - * @type {string} - * @memberof IntegratedSystemRequest - */ - 'slug'?: string | null; - /** - * - * @type {string} - * @memberof IntegratedSystemRequest - */ - 'description'?: string; + /** + * + * @type {string} + * @memberof IntegratedSystemRequest + */ + name: string + /** + * + * @type {string} + * @memberof IntegratedSystemRequest + */ + slug?: string | null + /** + * + * @type {string} + * @memberof IntegratedSystemRequest + */ + description?: string } /** * Serializes a line item for an order. @@ -1592,42 +1607,42 @@ export interface IntegratedSystemRequest { * @interface Line */ export interface Line { - /** - * - * @type {number} - * @memberof Line - */ - 'id': number; - /** - * - * @type {number} - * @memberof Line - */ - 'quantity': number; - /** - * Return the item description - * @type {string} - * @memberof Line - */ - 'item_description': string; - /** - * - * @type {string} - * @memberof Line - */ - 'unit_price': string; - /** - * - * @type {string} - * @memberof Line - */ - 'total_price': string; - /** - * - * @type {Product} - * @memberof Line - */ - 'product': Product; + /** + * + * @type {number} + * @memberof Line + */ + id: number + /** + * + * @type {number} + * @memberof Line + */ + quantity: number + /** + * Return the item description + * @type {string} + * @memberof Line + */ + item_description: string + /** + * + * @type {string} + * @memberof Line + */ + unit_price: string + /** + * + * @type {string} + * @memberof Line + */ + total_price: string + /** + * + * @type {Product} + * @memberof Line + */ + product: Product } /** * @@ -1636,15 +1651,14 @@ export interface Line { */ export const NullEnumDescriptions = { - 'null': "", -} as const; + null: "", +} as const export const NullEnum = { - Null: 'null' -} as const; - -export type NullEnum = typeof NullEnum[keyof typeof NullEnum]; + Null: "null", +} as const +export type NullEnum = (typeof NullEnum)[keyof typeof NullEnum] /** * Serializer for order history. @@ -1652,87 +1666,86 @@ export type NullEnum = typeof NullEnum[keyof typeof NullEnum]; * @interface OrderHistory */ export interface OrderHistory { - /** - * - * @type {number} - * @memberof OrderHistory - */ - 'id': number; - /** - * - * @type {StateEnum} - * @memberof OrderHistory - */ - 'state'?: StateEnum; - /** - * - * @type {string} - * @memberof OrderHistory - */ - 'reference_number'?: string; - /** - * - * @type {number} - * @memberof OrderHistory - */ - 'purchaser': number; - /** - * - * @type {string} - * @memberof OrderHistory - */ - 'total_price_paid': string; - /** - * - * @type {Array} - * @memberof OrderHistory - */ - 'lines': Array; - /** - * - * @type {string} - * @memberof OrderHistory - */ - 'created_on': string; - /** - * - * @type {string} - * @memberof OrderHistory - */ - 'updated_on': string; + /** + * + * @type {number} + * @memberof OrderHistory + */ + id: number + /** + * + * @type {StateEnum} + * @memberof OrderHistory + */ + state?: StateEnum + /** + * + * @type {string} + * @memberof OrderHistory + */ + reference_number?: string + /** + * + * @type {number} + * @memberof OrderHistory + */ + purchaser: number + /** + * + * @type {string} + * @memberof OrderHistory + */ + total_price_paid: string + /** + * + * @type {Array} + * @memberof OrderHistory + */ + lines: Array + /** + * + * @type {string} + * @memberof OrderHistory + */ + created_on: string + /** + * + * @type {string} + * @memberof OrderHistory + */ + updated_on: string } - /** * * @export * @interface PaginatedBasketWithProductList */ export interface PaginatedBasketWithProductList { - /** - * - * @type {number} - * @memberof PaginatedBasketWithProductList - */ - 'count': number; - /** - * - * @type {string} - * @memberof PaginatedBasketWithProductList - */ - 'next'?: string | null; - /** - * - * @type {string} - * @memberof PaginatedBasketWithProductList - */ - 'previous'?: string | null; - /** - * - * @type {Array} - * @memberof PaginatedBasketWithProductList - */ - 'results': Array; + /** + * + * @type {number} + * @memberof PaginatedBasketWithProductList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedBasketWithProductList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedBasketWithProductList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedBasketWithProductList + */ + results: Array } /** * @@ -1740,30 +1753,30 @@ export interface PaginatedBasketWithProductList { * @interface PaginatedIntegratedSystemList */ export interface PaginatedIntegratedSystemList { - /** - * - * @type {number} - * @memberof PaginatedIntegratedSystemList - */ - 'count': number; - /** - * - * @type {string} - * @memberof PaginatedIntegratedSystemList - */ - 'next'?: string | null; - /** - * - * @type {string} - * @memberof PaginatedIntegratedSystemList - */ - 'previous'?: string | null; - /** - * - * @type {Array} - * @memberof PaginatedIntegratedSystemList - */ - 'results': Array; + /** + * + * @type {number} + * @memberof PaginatedIntegratedSystemList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedIntegratedSystemList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedIntegratedSystemList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedIntegratedSystemList + */ + results: Array } /** * @@ -1771,30 +1784,30 @@ export interface PaginatedIntegratedSystemList { * @interface PaginatedOrderHistoryList */ export interface PaginatedOrderHistoryList { - /** - * - * @type {number} - * @memberof PaginatedOrderHistoryList - */ - 'count': number; - /** - * - * @type {string} - * @memberof PaginatedOrderHistoryList - */ - 'next'?: string | null; - /** - * - * @type {string} - * @memberof PaginatedOrderHistoryList - */ - 'previous'?: string | null; - /** - * - * @type {Array} - * @memberof PaginatedOrderHistoryList - */ - 'results': Array; + /** + * + * @type {number} + * @memberof PaginatedOrderHistoryList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedOrderHistoryList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedOrderHistoryList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedOrderHistoryList + */ + results: Array } /** * @@ -1802,30 +1815,30 @@ export interface PaginatedOrderHistoryList { * @interface PaginatedProductList */ export interface PaginatedProductList { - /** - * - * @type {number} - * @memberof PaginatedProductList - */ - 'count': number; - /** - * - * @type {string} - * @memberof PaginatedProductList - */ - 'next'?: string | null; - /** - * - * @type {string} - * @memberof PaginatedProductList - */ - 'previous'?: string | null; - /** - * - * @type {Array} - * @memberof PaginatedProductList - */ - 'results': Array; + /** + * + * @type {number} + * @memberof PaginatedProductList + */ + count: number + /** + * + * @type {string} + * @memberof PaginatedProductList + */ + next?: string | null + /** + * + * @type {string} + * @memberof PaginatedProductList + */ + previous?: string | null + /** + * + * @type {Array} + * @memberof PaginatedProductList + */ + results: Array } /** * Serializer for IntegratedSystem model. @@ -1833,24 +1846,24 @@ export interface PaginatedProductList { * @interface PatchedIntegratedSystemRequest */ export interface PatchedIntegratedSystemRequest { - /** - * - * @type {string} - * @memberof PatchedIntegratedSystemRequest - */ - 'name'?: string; - /** - * - * @type {string} - * @memberof PatchedIntegratedSystemRequest - */ - 'slug'?: string | null; - /** - * - * @type {string} - * @memberof PatchedIntegratedSystemRequest - */ - 'description'?: string; + /** + * + * @type {string} + * @memberof PatchedIntegratedSystemRequest + */ + name?: string + /** + * + * @type {string} + * @memberof PatchedIntegratedSystemRequest + */ + slug?: string | null + /** + * + * @type {string} + * @memberof PatchedIntegratedSystemRequest + */ + description?: string } /** * Serializer for Product model. @@ -1858,42 +1871,48 @@ export interface PatchedIntegratedSystemRequest { * @interface PatchedProductRequest */ export interface PatchedProductRequest { - /** - * SKU of the product. - * @type {string} - * @memberof PatchedProductRequest - */ - 'sku'?: string; - /** - * Short name of the product, displayed in carts/etc. - * @type {string} - * @memberof PatchedProductRequest - */ - 'name'?: string; - /** - * Long description of the product. - * @type {string} - * @memberof PatchedProductRequest - */ - 'description'?: string; - /** - * System-specific data for the product (in JSON). - * @type {any} - * @memberof PatchedProductRequest - */ - 'system_data'?: any | null; - /** - * Owner system of the product. - * @type {number} - * @memberof PatchedProductRequest - */ - 'system'?: number; - /** - * Price (decimal to two places) - * @type {string} - * @memberof PatchedProductRequest - */ - 'price'?: string; + /** + * SKU of the product. + * @type {string} + * @memberof PatchedProductRequest + */ + sku?: string + /** + * Short name of the product, displayed in carts/etc. + * @type {string} + * @memberof PatchedProductRequest + */ + name?: string + /** + * Long description of the product. + * @type {string} + * @memberof PatchedProductRequest + */ + description?: string + /** + * System-specific data for the product (in JSON). + * @type {any} + * @memberof PatchedProductRequest + */ + system_data?: any | null + /** + * Owner system of the product. + * @type {number} + * @memberof PatchedProductRequest + */ + system?: number + /** + * Price (decimal to two places) + * @type {string} + * @memberof PatchedProductRequest + */ + price?: string + /** + * Image metadata including URL, alt text, and description (in JSON). + * @type {any} + * @memberof PatchedProductRequest + */ + image_metadata?: any | null } /** * * `marketing` - marketing * `sales` - sales * `financial-assistance` - financial-assistance * `customer-support` - customer-support * `staff` - staff * `legacy` - legacy * `credit_card` - credit_card * `purchase_order` - purchase_order @@ -1902,53 +1921,53 @@ export interface PatchedProductRequest { */ export const PaymentTypeEnumDescriptions = { - 'marketing': "marketing", - 'sales': "sales", - 'financial-assistance': "financial-assistance", - 'customer-support': "customer-support", - 'staff': "staff", - 'legacy': "legacy", - 'credit_card': "credit_card", - 'purchase_order': "purchase_order", -} as const; + marketing: "marketing", + sales: "sales", + "financial-assistance": "financial-assistance", + "customer-support": "customer-support", + staff: "staff", + legacy: "legacy", + credit_card: "credit_card", + purchase_order: "purchase_order", +} as const export const PaymentTypeEnum = { - /** - * marketing - */ - Marketing: 'marketing', - /** - * sales - */ - Sales: 'sales', - /** - * financial-assistance - */ - FinancialAssistance: 'financial-assistance', - /** - * customer-support - */ - CustomerSupport: 'customer-support', - /** - * staff - */ - Staff: 'staff', - /** - * legacy - */ - Legacy: 'legacy', - /** - * credit_card - */ - CreditCard: 'credit_card', - /** - * purchase_order - */ - PurchaseOrder: 'purchase_order' -} as const; - -export type PaymentTypeEnum = typeof PaymentTypeEnum[keyof typeof PaymentTypeEnum]; - + /** + * marketing + */ + Marketing: "marketing", + /** + * sales + */ + Sales: "sales", + /** + * financial-assistance + */ + FinancialAssistance: "financial-assistance", + /** + * customer-support + */ + CustomerSupport: "customer-support", + /** + * staff + */ + Staff: "staff", + /** + * legacy + */ + Legacy: "legacy", + /** + * credit_card + */ + CreditCard: "credit_card", + /** + * purchase_order + */ + PurchaseOrder: "purchase_order", +} as const + +export type PaymentTypeEnum = + (typeof PaymentTypeEnum)[keyof typeof PaymentTypeEnum] /** * Serializer for Product model. @@ -1956,1001 +1975,1498 @@ export type PaymentTypeEnum = typeof PaymentTypeEnum[keyof typeof PaymentTypeEnu * @interface Product */ export interface Product { + /** + * + * @type {number} + * @memberof Product + */ + id: number + /** + * SKU of the product. + * @type {string} + * @memberof Product + */ + sku: string + /** + * Short name of the product, displayed in carts/etc. + * @type {string} + * @memberof Product + */ + name: string + /** + * Long description of the product. + * @type {string} + * @memberof Product + */ + description: string + /** + * System-specific data for the product (in JSON). + * @type {any} + * @memberof Product + */ + system_data?: any | null + /** + * Owner system of the product. + * @type {number} + * @memberof Product + */ + system: number + /** + * Price (decimal to two places) + * @type {string} + * @memberof Product + */ + price: string + /** + * + * @type {boolean} + * @memberof Product + */ + deleted_by_cascade: boolean + /** + * Image metadata including URL, alt text, and description (in JSON). + * @type {any} + * @memberof Product + */ + image_metadata?: any | null +} +/** + * Serializer for Product model. + * @export + * @interface ProductRequest + */ +export interface ProductRequest { + /** + * SKU of the product. + * @type {string} + * @memberof ProductRequest + */ + sku: string + /** + * Short name of the product, displayed in carts/etc. + * @type {string} + * @memberof ProductRequest + */ + name: string + /** + * Long description of the product. + * @type {string} + * @memberof ProductRequest + */ + description: string + /** + * System-specific data for the product (in JSON). + * @type {any} + * @memberof ProductRequest + */ + system_data?: any | null + /** + * Owner system of the product. + * @type {number} + * @memberof ProductRequest + */ + system: number + /** + * Price (decimal to two places) + * @type {string} + * @memberof ProductRequest + */ + price: string + /** + * Image metadata including URL, alt text, and description (in JSON). + * @type {any} + * @memberof ProductRequest + */ + image_metadata?: any | null +} +/** + * Simpler serializer for discounts. + * @export + * @interface SimpleDiscount + */ +export interface SimpleDiscount { + /** + * + * @type {number} + * @memberof SimpleDiscount + */ + id: number + /** + * + * @type {string} + * @memberof SimpleDiscount + */ + discount_code: string + /** + * + * @type {string} + * @memberof SimpleDiscount + */ + amount: string + /** + * + * @type {DiscountTypeEnum} + * @memberof SimpleDiscount + */ + discount_type: DiscountTypeEnum + /** + * Return the formatted discount amount. This quantizes percent discounts to whole numbers. This is probably fine. + * @type {string} + * @memberof SimpleDiscount + */ + formatted_discount_amount: string +} + +/** + * * `pending` - Pending * `fulfilled` - Fulfilled * `canceled` - Canceled * `refunded` - Refunded * `declined` - Declined * `errored` - Errored * `review` - Review + * @export + * @enum {string} + */ + +export const StateEnumDescriptions = { + pending: "Pending", + fulfilled: "Fulfilled", + canceled: "Canceled", + refunded: "Refunded", + declined: "Declined", + errored: "Errored", + review: "Review", +} as const + +export const StateEnum = { + /** + * Pending + */ + Pending: "pending", + /** + * Fulfilled + */ + Fulfilled: "fulfilled", + /** + * Canceled + */ + Canceled: "canceled", + /** + * Refunded + */ + Refunded: "refunded", + /** + * Declined + */ + Declined: "declined", + /** + * Errored + */ + Errored: "errored", + /** + * Review + */ + Review: "review", +} as const + +export type StateEnum = (typeof StateEnum)[keyof typeof StateEnum] + +/** + * TaxRate model serializer + * @export + * @interface TaxRate + */ +export interface TaxRate { + /** + * + * @type {number} + * @memberof TaxRate + */ + id: number + /** + * + * @type {CountryCodeEnum} + * @memberof TaxRate + */ + country_code: CountryCodeEnum + /** + * + * @type {string} + * @memberof TaxRate + */ + tax_rate?: string + /** + * + * @type {string} + * @memberof TaxRate + */ + tax_rate_name?: string +} + +/** + * Serializer for User model. + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id: number + /** + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * @type {string} + * @memberof User + */ + username: string + /** + * + * @type {string} + * @memberof User + */ + email?: string + /** + * + * @type {string} + * @memberof User + */ + first_name?: string + /** + * + * @type {string} + * @memberof User + */ + last_name?: string +} + +/** + * MetaApi - axios parameter creator + * @export + */ +export const MetaApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemRequest} IntegratedSystemRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metaIntegratedSystemCreate: async ( + IntegratedSystemRequest: IntegratedSystemRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'IntegratedSystemRequest' is not null or undefined + assertParamExists( + "metaIntegratedSystemCreate", + "IntegratedSystemRequest", + IntegratedSystemRequest, + ) + const localVarPath = `/api/v0/meta/integrated_system/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + IntegratedSystemRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metaIntegratedSystemDestroy: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaIntegratedSystemDestroy", "id", id) + const localVarPath = `/api/v0/meta/integrated_system/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metaIntegratedSystemList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v0/meta/integrated_system/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {PatchedIntegratedSystemRequest} [PatchedIntegratedSystemRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metaIntegratedSystemPartialUpdate: async ( + id: number, + PatchedIntegratedSystemRequest?: PatchedIntegratedSystemRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaIntegratedSystemPartialUpdate", "id", id) + const localVarPath = `/api/v0/meta/integrated_system/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedIntegratedSystemRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * - * @type {number} - * @memberof Product + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'id': number; + metaIntegratedSystemRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaIntegratedSystemRetrieve", "id", id) + const localVarPath = `/api/v0/meta/integrated_system/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * SKU of the product. - * @type {string} - * @memberof Product + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {IntegratedSystemRequest} IntegratedSystemRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'sku': string; + metaIntegratedSystemUpdate: async ( + id: number, + IntegratedSystemRequest: IntegratedSystemRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaIntegratedSystemUpdate", "id", id) + // verify required parameter 'IntegratedSystemRequest' is not null or undefined + assertParamExists( + "metaIntegratedSystemUpdate", + "IntegratedSystemRequest", + IntegratedSystemRequest, + ) + const localVarPath = `/api/v0/meta/integrated_system/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + IntegratedSystemRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * Short name of the product, displayed in carts/etc. - * @type {string} - * @memberof Product + * Viewset for Product model. + * @param {ProductRequest} ProductRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'name': string; + metaProductCreate: async ( + ProductRequest: ProductRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'ProductRequest' is not null or undefined + assertParamExists("metaProductCreate", "ProductRequest", ProductRequest) + const localVarPath = `/api/v0/meta/product/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + ProductRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * Long description of the product. - * @type {string} - * @memberof Product + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'description': string; + metaProductDestroy: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaProductDestroy", "id", id) + const localVarPath = `/api/v0/meta/product/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * System-specific data for the product (in JSON). - * @type {any} - * @memberof Product + * Viewset for Product model. + * @param {number} [limit] Number of results to return per page. + * @param {string} [name] + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [system__slug] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'system_data'?: any | null; + metaProductList: async ( + limit?: number, + name?: string, + offset?: number, + system__slug?: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v0/meta/product/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (name !== undefined) { + localVarQueryParameter["name"] = name + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + if (system__slug !== undefined) { + localVarQueryParameter["system__slug"] = system__slug + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * Owner system of the product. - * @type {number} - * @memberof Product + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {PatchedProductRequest} [PatchedProductRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'system': number; + metaProductPartialUpdate: async ( + id: number, + PatchedProductRequest?: PatchedProductRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaProductPartialUpdate", "id", id) + const localVarPath = `/api/v0/meta/product/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PATCH", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + PatchedProductRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * Price (decimal to two places) - * @type {string} - * @memberof Product + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'price': string; + metaProductRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaProductRetrieve", "id", id) + const localVarPath = `/api/v0/meta/product/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * - * @type {boolean} - * @memberof Product + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {ProductRequest} ProductRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'deleted_by_cascade': boolean; + metaProductUpdate: async ( + id: number, + ProductRequest: ProductRequest, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("metaProductUpdate", "id", id) + // verify required parameter 'ProductRequest' is not null or undefined + assertParamExists("metaProductUpdate", "ProductRequest", ProductRequest) + const localVarPath = `/api/v0/meta/product/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + localVarHeaderParameter["Content-Type"] = "application/json" + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + localVarRequestOptions.data = serializeDataIfNeeded( + ProductRequest, + localVarRequestOptions, + configuration, + ) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } } + /** - * Serializer for Product model. + * MetaApi - functional programming interface * @export - * @interface ProductRequest */ -export interface ProductRequest { +export const MetaApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = MetaApiAxiosParamCreator(configuration) + return { + /** + * Viewset for IntegratedSystem model. + * @param {IntegratedSystemRequest} IntegratedSystemRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async metaIntegratedSystemCreate( + IntegratedSystemRequest: IntegratedSystemRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaIntegratedSystemCreate( + IntegratedSystemRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaIntegratedSystemCreate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * SKU of the product. - * @type {string} - * @memberof ProductRequest + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'sku': string; + async metaIntegratedSystemDestroy( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaIntegratedSystemDestroy(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaIntegratedSystemDestroy"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * Short name of the product, displayed in carts/etc. - * @type {string} - * @memberof ProductRequest + * Viewset for IntegratedSystem model. + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'name': string; + async metaIntegratedSystemList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaIntegratedSystemList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaIntegratedSystemList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * Long description of the product. - * @type {string} - * @memberof ProductRequest + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {PatchedIntegratedSystemRequest} [PatchedIntegratedSystemRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'description': string; + async metaIntegratedSystemPartialUpdate( + id: number, + PatchedIntegratedSystemRequest?: PatchedIntegratedSystemRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaIntegratedSystemPartialUpdate( + id, + PatchedIntegratedSystemRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaIntegratedSystemPartialUpdate"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * System-specific data for the product (in JSON). - * @type {any} - * @memberof ProductRequest + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'system_data'?: any | null; + async metaIntegratedSystemRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaIntegratedSystemRetrieve( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaIntegratedSystemRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * Owner system of the product. - * @type {number} - * @memberof ProductRequest + * Viewset for IntegratedSystem model. + * @param {number} id A unique integer value identifying this integrated system. + * @param {IntegratedSystemRequest} IntegratedSystemRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'system': number; + async metaIntegratedSystemUpdate( + id: number, + IntegratedSystemRequest: IntegratedSystemRequest, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaIntegratedSystemUpdate( + id, + IntegratedSystemRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaIntegratedSystemUpdate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * Price (decimal to two places) - * @type {string} - * @memberof ProductRequest + * Viewset for Product model. + * @param {ProductRequest} ProductRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'price': string; -} -/** - * Simpler serializer for discounts. - * @export - * @interface SimpleDiscount - */ -export interface SimpleDiscount { + async metaProductCreate( + ProductRequest: ProductRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaProductCreate( + ProductRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaProductCreate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * - * @type {number} - * @memberof SimpleDiscount + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'id': number; + async metaProductDestroy( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaProductDestroy(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaProductDestroy"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * - * @type {string} - * @memberof SimpleDiscount + * Viewset for Product model. + * @param {number} [limit] Number of results to return per page. + * @param {string} [name] + * @param {number} [offset] The initial index from which to return the results. + * @param {string} [system__slug] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'discount_code': string; + async metaProductList( + limit?: number, + name?: string, + offset?: number, + system__slug?: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.metaProductList( + limit, + name, + offset, + system__slug, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaProductList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * - * @type {string} - * @memberof SimpleDiscount + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {PatchedProductRequest} [PatchedProductRequest] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'amount': string; + async metaProductPartialUpdate( + id: number, + PatchedProductRequest?: PatchedProductRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaProductPartialUpdate( + id, + PatchedProductRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaProductPartialUpdate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * - * @type {DiscountTypeEnum} - * @memberof SimpleDiscount + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'discount_type': DiscountTypeEnum; + async metaProductRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaProductRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaProductRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * Return the formatted discount amount. This quantizes percent discounts to whole numbers. This is probably fine. - * @type {string} - * @memberof SimpleDiscount + * Viewset for Product model. + * @param {number} id A unique integer value identifying this product. + * @param {ProductRequest} ProductRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'formatted_discount_amount': string; + async metaProductUpdate( + id: number, + ProductRequest: ProductRequest, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.metaProductUpdate( + id, + ProductRequest, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["MetaApi.metaProductUpdate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } } - /** - * * `pending` - Pending * `fulfilled` - Fulfilled * `canceled` - Canceled * `refunded` - Refunded * `declined` - Declined * `errored` - Errored * `review` - Review + * MetaApi - factory interface * @export - * @enum {string} */ - -export const StateEnumDescriptions = { - 'pending': "Pending", - 'fulfilled': "Fulfilled", - 'canceled': "Canceled", - 'refunded': "Refunded", - 'declined': "Declined", - 'errored': "Errored", - 'review': "Review", -} as const; - -export const StateEnum = { - /** - * Pending - */ - Pending: 'pending', +export const MetaApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = MetaApiFp(configuration) + return { /** - * Fulfilled - */ - Fulfilled: 'fulfilled', - /** - * Canceled - */ - Canceled: 'canceled', - /** - * Refunded - */ - Refunded: 'refunded', - /** - * Declined - */ - Declined: 'declined', + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metaIntegratedSystemCreate( + requestParameters: MetaApiMetaIntegratedSystemCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaIntegratedSystemCreate( + requestParameters.IntegratedSystemRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * Errored - */ - Errored: 'errored', + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metaIntegratedSystemDestroy( + requestParameters: MetaApiMetaIntegratedSystemDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaIntegratedSystemDestroy(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, /** - * Review - */ - Review: 'review' -} as const; - -export type StateEnum = typeof StateEnum[keyof typeof StateEnum]; - - -/** - * TaxRate model serializer - * @export - * @interface TaxRate - */ -export interface TaxRate { + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metaIntegratedSystemList( + requestParameters: MetaApiMetaIntegratedSystemListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaIntegratedSystemList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {number} - * @memberof TaxRate + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'id': number; + metaIntegratedSystemPartialUpdate( + requestParameters: MetaApiMetaIntegratedSystemPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaIntegratedSystemPartialUpdate( + requestParameters.id, + requestParameters.PatchedIntegratedSystemRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {CountryCodeEnum} - * @memberof TaxRate + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'country_code': CountryCodeEnum; + metaIntegratedSystemRetrieve( + requestParameters: MetaApiMetaIntegratedSystemRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaIntegratedSystemRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {string} - * @memberof TaxRate + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'tax_rate'?: string; + metaIntegratedSystemUpdate( + requestParameters: MetaApiMetaIntegratedSystemUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaIntegratedSystemUpdate( + requestParameters.id, + requestParameters.IntegratedSystemRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {string} - * @memberof TaxRate + * Viewset for Product model. + * @param {MetaApiMetaProductCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'tax_rate_name'?: string; -} - - -/** - * Serializer for User model. - * @export - * @interface User - */ -export interface User { + metaProductCreate( + requestParameters: MetaApiMetaProductCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaProductCreate(requestParameters.ProductRequest, options) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {number} - * @memberof User + * Viewset for Product model. + * @param {MetaApiMetaProductDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'id': number; + metaProductDestroy( + requestParameters: MetaApiMetaProductDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaProductDestroy(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, /** - * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - * @type {string} - * @memberof User + * Viewset for Product model. + * @param {MetaApiMetaProductListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'username': string; + metaProductList( + requestParameters: MetaApiMetaProductListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaProductList( + requestParameters.limit, + requestParameters.name, + requestParameters.offset, + requestParameters.system__slug, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {string} - * @memberof User + * Viewset for Product model. + * @param {MetaApiMetaProductPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'email'?: string; + metaProductPartialUpdate( + requestParameters: MetaApiMetaProductPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaProductPartialUpdate( + requestParameters.id, + requestParameters.PatchedProductRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {string} - * @memberof User + * Viewset for Product model. + * @param {MetaApiMetaProductRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'first_name'?: string; + metaProductRetrieve( + requestParameters: MetaApiMetaProductRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaProductRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, /** - * - * @type {string} - * @memberof User + * Viewset for Product model. + * @param {MetaApiMetaProductUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - 'last_name'?: string; + metaProductUpdate( + requestParameters: MetaApiMetaProductUpdateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .metaProductUpdate( + requestParameters.id, + requestParameters.ProductRequest, + options, + ) + .then((request) => request(axios, basePath)) + }, + } } -/** - * MetaApi - axios parameter creator - * @export - */ -export const MetaApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemRequest} IntegratedSystemRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemCreate: async (IntegratedSystemRequest: IntegratedSystemRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'IntegratedSystemRequest' is not null or undefined - assertParamExists('metaIntegratedSystemCreate', 'IntegratedSystemRequest', IntegratedSystemRequest) - const localVarPath = `/api/v0/meta/integrated_system/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(IntegratedSystemRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaIntegratedSystemDestroy', 'id', id) - const localVarPath = `/api/v0/meta/integrated_system/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemList: async (limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v0/meta/integrated_system/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (offset !== undefined) { - localVarQueryParameter['offset'] = offset; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {PatchedIntegratedSystemRequest} [PatchedIntegratedSystemRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemPartialUpdate: async (id: number, PatchedIntegratedSystemRequest?: PatchedIntegratedSystemRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaIntegratedSystemPartialUpdate', 'id', id) - const localVarPath = `/api/v0/meta/integrated_system/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(PatchedIntegratedSystemRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaIntegratedSystemRetrieve', 'id', id) - const localVarPath = `/api/v0/meta/integrated_system/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {IntegratedSystemRequest} IntegratedSystemRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemUpdate: async (id: number, IntegratedSystemRequest: IntegratedSystemRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaIntegratedSystemUpdate', 'id', id) - // verify required parameter 'IntegratedSystemRequest' is not null or undefined - assertParamExists('metaIntegratedSystemUpdate', 'IntegratedSystemRequest', IntegratedSystemRequest) - const localVarPath = `/api/v0/meta/integrated_system/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(IntegratedSystemRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for Product model. - * @param {ProductRequest} ProductRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductCreate: async (ProductRequest: ProductRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'ProductRequest' is not null or undefined - assertParamExists('metaProductCreate', 'ProductRequest', ProductRequest) - const localVarPath = `/api/v0/meta/product/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(ProductRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductDestroy: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaProductDestroy', 'id', id) - const localVarPath = `/api/v0/meta/product/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for Product model. - * @param {number} [limit] Number of results to return per page. - * @param {string} [name] - * @param {number} [offset] The initial index from which to return the results. - * @param {string} [system__slug] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductList: async (limit?: number, name?: string, offset?: number, system__slug?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v0/meta/product/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (name !== undefined) { - localVarQueryParameter['name'] = name; - } - - if (offset !== undefined) { - localVarQueryParameter['offset'] = offset; - } - - if (system__slug !== undefined) { - localVarQueryParameter['system__slug'] = system__slug; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {PatchedProductRequest} [PatchedProductRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductPartialUpdate: async (id: number, PatchedProductRequest?: PatchedProductRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaProductPartialUpdate', 'id', id) - const localVarPath = `/api/v0/meta/product/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(PatchedProductRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaProductRetrieve', 'id', id) - const localVarPath = `/api/v0/meta/product/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {ProductRequest} ProductRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductUpdate: async (id: number, ProductRequest: ProductRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('metaProductUpdate', 'id', id) - // verify required parameter 'ProductRequest' is not null or undefined - assertParamExists('metaProductUpdate', 'ProductRequest', ProductRequest) - const localVarPath = `/api/v0/meta/product/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(ProductRequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * MetaApi - functional programming interface - * @export - */ -export const MetaApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = MetaApiAxiosParamCreator(configuration) - return { - /** - * Viewset for IntegratedSystem model. - * @param {IntegratedSystemRequest} IntegratedSystemRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaIntegratedSystemCreate(IntegratedSystemRequest: IntegratedSystemRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaIntegratedSystemCreate(IntegratedSystemRequest, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaIntegratedSystemCreate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaIntegratedSystemDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaIntegratedSystemDestroy(id, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaIntegratedSystemDestroy']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaIntegratedSystemList(limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaIntegratedSystemList(limit, offset, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaIntegratedSystemList']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {PatchedIntegratedSystemRequest} [PatchedIntegratedSystemRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaIntegratedSystemPartialUpdate(id: number, PatchedIntegratedSystemRequest?: PatchedIntegratedSystemRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaIntegratedSystemPartialUpdate(id, PatchedIntegratedSystemRequest, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaIntegratedSystemPartialUpdate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaIntegratedSystemRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaIntegratedSystemRetrieve(id, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaIntegratedSystemRetrieve']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for IntegratedSystem model. - * @param {number} id A unique integer value identifying this integrated system. - * @param {IntegratedSystemRequest} IntegratedSystemRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaIntegratedSystemUpdate(id: number, IntegratedSystemRequest: IntegratedSystemRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaIntegratedSystemUpdate(id, IntegratedSystemRequest, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaIntegratedSystemUpdate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for Product model. - * @param {ProductRequest} ProductRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaProductCreate(ProductRequest: ProductRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaProductCreate(ProductRequest, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaProductCreate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaProductDestroy(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaProductDestroy(id, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaProductDestroy']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for Product model. - * @param {number} [limit] Number of results to return per page. - * @param {string} [name] - * @param {number} [offset] The initial index from which to return the results. - * @param {string} [system__slug] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaProductList(limit?: number, name?: string, offset?: number, system__slug?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaProductList(limit, name, offset, system__slug, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaProductList']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {PatchedProductRequest} [PatchedProductRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaProductPartialUpdate(id: number, PatchedProductRequest?: PatchedProductRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaProductPartialUpdate(id, PatchedProductRequest, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaProductPartialUpdate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaProductRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaProductRetrieve(id, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaProductRetrieve']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Viewset for Product model. - * @param {number} id A unique integer value identifying this product. - * @param {ProductRequest} ProductRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async metaProductUpdate(id: number, ProductRequest: ProductRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.metaProductUpdate(id, ProductRequest, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['MetaApi.metaProductUpdate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - } -}; - -/** - * MetaApi - factory interface - * @export - */ -export const MetaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = MetaApiFp(configuration) - return { - /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemCreate(requestParameters: MetaApiMetaIntegratedSystemCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaIntegratedSystemCreate(requestParameters.IntegratedSystemRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemDestroy(requestParameters: MetaApiMetaIntegratedSystemDestroyRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaIntegratedSystemDestroy(requestParameters.id, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemList(requestParameters: MetaApiMetaIntegratedSystemListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaIntegratedSystemList(requestParameters.limit, requestParameters.offset, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemPartialUpdate(requestParameters: MetaApiMetaIntegratedSystemPartialUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaIntegratedSystemPartialUpdate(requestParameters.id, requestParameters.PatchedIntegratedSystemRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemRetrieve(requestParameters: MetaApiMetaIntegratedSystemRetrieveRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaIntegratedSystemRetrieve(requestParameters.id, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaIntegratedSystemUpdate(requestParameters: MetaApiMetaIntegratedSystemUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaIntegratedSystemUpdate(requestParameters.id, requestParameters.IntegratedSystemRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for Product model. - * @param {MetaApiMetaProductCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductCreate(requestParameters: MetaApiMetaProductCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaProductCreate(requestParameters.ProductRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for Product model. - * @param {MetaApiMetaProductDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductDestroy(requestParameters: MetaApiMetaProductDestroyRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaProductDestroy(requestParameters.id, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for Product model. - * @param {MetaApiMetaProductListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductList(requestParameters: MetaApiMetaProductListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaProductList(requestParameters.limit, requestParameters.name, requestParameters.offset, requestParameters.system__slug, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for Product model. - * @param {MetaApiMetaProductPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductPartialUpdate(requestParameters: MetaApiMetaProductPartialUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaProductPartialUpdate(requestParameters.id, requestParameters.PatchedProductRequest, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for Product model. - * @param {MetaApiMetaProductRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductRetrieve(requestParameters: MetaApiMetaProductRetrieveRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaProductRetrieve(requestParameters.id, options).then((request) => request(axios, basePath)); - }, - /** - * Viewset for Product model. - * @param {MetaApiMetaProductUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metaProductUpdate(requestParameters: MetaApiMetaProductUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.metaProductUpdate(requestParameters.id, requestParameters.ProductRequest, options).then((request) => request(axios, basePath)); - }, - }; -}; - /** * Request parameters for metaIntegratedSystemCreate operation in MetaApi. * @export * @interface MetaApiMetaIntegratedSystemCreateRequest */ export interface MetaApiMetaIntegratedSystemCreateRequest { - /** - * - * @type {IntegratedSystemRequest} - * @memberof MetaApiMetaIntegratedSystemCreate - */ - readonly IntegratedSystemRequest: IntegratedSystemRequest + /** + * + * @type {IntegratedSystemRequest} + * @memberof MetaApiMetaIntegratedSystemCreate + */ + readonly IntegratedSystemRequest: IntegratedSystemRequest } /** @@ -2959,12 +3475,12 @@ export interface MetaApiMetaIntegratedSystemCreateRequest { * @interface MetaApiMetaIntegratedSystemDestroyRequest */ export interface MetaApiMetaIntegratedSystemDestroyRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof MetaApiMetaIntegratedSystemDestroy - */ - readonly id: number + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof MetaApiMetaIntegratedSystemDestroy + */ + readonly id: number } /** @@ -2973,19 +3489,19 @@ export interface MetaApiMetaIntegratedSystemDestroyRequest { * @interface MetaApiMetaIntegratedSystemListRequest */ export interface MetaApiMetaIntegratedSystemListRequest { - /** - * Number of results to return per page. - * @type {number} - * @memberof MetaApiMetaIntegratedSystemList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof MetaApiMetaIntegratedSystemList - */ - readonly offset?: number + /** + * Number of results to return per page. + * @type {number} + * @memberof MetaApiMetaIntegratedSystemList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof MetaApiMetaIntegratedSystemList + */ + readonly offset?: number } /** @@ -2994,19 +3510,19 @@ export interface MetaApiMetaIntegratedSystemListRequest { * @interface MetaApiMetaIntegratedSystemPartialUpdateRequest */ export interface MetaApiMetaIntegratedSystemPartialUpdateRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof MetaApiMetaIntegratedSystemPartialUpdate - */ - readonly id: number - - /** - * - * @type {PatchedIntegratedSystemRequest} - * @memberof MetaApiMetaIntegratedSystemPartialUpdate - */ - readonly PatchedIntegratedSystemRequest?: PatchedIntegratedSystemRequest + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof MetaApiMetaIntegratedSystemPartialUpdate + */ + readonly id: number + + /** + * + * @type {PatchedIntegratedSystemRequest} + * @memberof MetaApiMetaIntegratedSystemPartialUpdate + */ + readonly PatchedIntegratedSystemRequest?: PatchedIntegratedSystemRequest } /** @@ -3015,12 +3531,12 @@ export interface MetaApiMetaIntegratedSystemPartialUpdateRequest { * @interface MetaApiMetaIntegratedSystemRetrieveRequest */ export interface MetaApiMetaIntegratedSystemRetrieveRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof MetaApiMetaIntegratedSystemRetrieve - */ - readonly id: number + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof MetaApiMetaIntegratedSystemRetrieve + */ + readonly id: number } /** @@ -3029,19 +3545,19 @@ export interface MetaApiMetaIntegratedSystemRetrieveRequest { * @interface MetaApiMetaIntegratedSystemUpdateRequest */ export interface MetaApiMetaIntegratedSystemUpdateRequest { - /** - * A unique integer value identifying this integrated system. - * @type {number} - * @memberof MetaApiMetaIntegratedSystemUpdate - */ - readonly id: number - - /** - * - * @type {IntegratedSystemRequest} - * @memberof MetaApiMetaIntegratedSystemUpdate - */ - readonly IntegratedSystemRequest: IntegratedSystemRequest + /** + * A unique integer value identifying this integrated system. + * @type {number} + * @memberof MetaApiMetaIntegratedSystemUpdate + */ + readonly id: number + + /** + * + * @type {IntegratedSystemRequest} + * @memberof MetaApiMetaIntegratedSystemUpdate + */ + readonly IntegratedSystemRequest: IntegratedSystemRequest } /** @@ -3050,12 +3566,12 @@ export interface MetaApiMetaIntegratedSystemUpdateRequest { * @interface MetaApiMetaProductCreateRequest */ export interface MetaApiMetaProductCreateRequest { - /** - * - * @type {ProductRequest} - * @memberof MetaApiMetaProductCreate - */ - readonly ProductRequest: ProductRequest + /** + * + * @type {ProductRequest} + * @memberof MetaApiMetaProductCreate + */ + readonly ProductRequest: ProductRequest } /** @@ -3064,12 +3580,12 @@ export interface MetaApiMetaProductCreateRequest { * @interface MetaApiMetaProductDestroyRequest */ export interface MetaApiMetaProductDestroyRequest { - /** - * A unique integer value identifying this product. - * @type {number} - * @memberof MetaApiMetaProductDestroy - */ - readonly id: number + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof MetaApiMetaProductDestroy + */ + readonly id: number } /** @@ -3078,848 +3594,1346 @@ export interface MetaApiMetaProductDestroyRequest { * @interface MetaApiMetaProductListRequest */ export interface MetaApiMetaProductListRequest { + /** + * Number of results to return per page. + * @type {number} + * @memberof MetaApiMetaProductList + */ + readonly limit?: number + + /** + * + * @type {string} + * @memberof MetaApiMetaProductList + */ + readonly name?: string + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof MetaApiMetaProductList + */ + readonly offset?: number + + /** + * + * @type {string} + * @memberof MetaApiMetaProductList + */ + readonly system__slug?: string +} + +/** + * Request parameters for metaProductPartialUpdate operation in MetaApi. + * @export + * @interface MetaApiMetaProductPartialUpdateRequest + */ +export interface MetaApiMetaProductPartialUpdateRequest { + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof MetaApiMetaProductPartialUpdate + */ + readonly id: number + + /** + * + * @type {PatchedProductRequest} + * @memberof MetaApiMetaProductPartialUpdate + */ + readonly PatchedProductRequest?: PatchedProductRequest +} + +/** + * Request parameters for metaProductRetrieve operation in MetaApi. + * @export + * @interface MetaApiMetaProductRetrieveRequest + */ +export interface MetaApiMetaProductRetrieveRequest { + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof MetaApiMetaProductRetrieve + */ + readonly id: number +} + +/** + * Request parameters for metaProductUpdate operation in MetaApi. + * @export + * @interface MetaApiMetaProductUpdateRequest + */ +export interface MetaApiMetaProductUpdateRequest { + /** + * A unique integer value identifying this product. + * @type {number} + * @memberof MetaApiMetaProductUpdate + */ + readonly id: number + + /** + * + * @type {ProductRequest} + * @memberof MetaApiMetaProductUpdate + */ + readonly ProductRequest: ProductRequest +} + +/** + * MetaApi - object-oriented interface + * @export + * @class MetaApi + * @extends {BaseAPI} + */ +export class MetaApi extends BaseAPI { + /** + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaIntegratedSystemCreate( + requestParameters: MetaApiMetaIntegratedSystemCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaIntegratedSystemCreate( + requestParameters.IntegratedSystemRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaIntegratedSystemDestroy( + requestParameters: MetaApiMetaIntegratedSystemDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaIntegratedSystemDestroy(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaIntegratedSystemList( + requestParameters: MetaApiMetaIntegratedSystemListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaIntegratedSystemList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaIntegratedSystemPartialUpdate( + requestParameters: MetaApiMetaIntegratedSystemPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaIntegratedSystemPartialUpdate( + requestParameters.id, + requestParameters.PatchedIntegratedSystemRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaIntegratedSystemRetrieve( + requestParameters: MetaApiMetaIntegratedSystemRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaIntegratedSystemRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for IntegratedSystem model. + * @param {MetaApiMetaIntegratedSystemUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaIntegratedSystemUpdate( + requestParameters: MetaApiMetaIntegratedSystemUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaIntegratedSystemUpdate( + requestParameters.id, + requestParameters.IntegratedSystemRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for Product model. + * @param {MetaApiMetaProductCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaProductCreate( + requestParameters: MetaApiMetaProductCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaProductCreate(requestParameters.ProductRequest, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for Product model. + * @param {MetaApiMetaProductDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaProductDestroy( + requestParameters: MetaApiMetaProductDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaProductDestroy(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for Product model. + * @param {MetaApiMetaProductListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaProductList( + requestParameters: MetaApiMetaProductListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaProductList( + requestParameters.limit, + requestParameters.name, + requestParameters.offset, + requestParameters.system__slug, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for Product model. + * @param {MetaApiMetaProductPartialUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaProductPartialUpdate( + requestParameters: MetaApiMetaProductPartialUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaProductPartialUpdate( + requestParameters.id, + requestParameters.PatchedProductRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for Product model. + * @param {MetaApiMetaProductRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaProductRetrieve( + requestParameters: MetaApiMetaProductRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaProductRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Viewset for Product model. + * @param {MetaApiMetaProductUpdateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetaApi + */ + public metaProductUpdate( + requestParameters: MetaApiMetaProductUpdateRequest, + options?: RawAxiosRequestConfig, + ) { + return MetaApiFp(this.configuration) + .metaProductUpdate( + requestParameters.id, + requestParameters.ProductRequest, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } +} + +/** + * PaymentsApi - axios parameter creator + * @export + */ +export const PaymentsApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { /** - * Number of results to return per page. - * @type {number} - * @memberof MetaApiMetaProductList + * Creates or updates a basket for the current user, adding the discount if valid. + * @param {string} discount_code + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly limit?: number - + paymentsBasketsAddDiscountCreate: async ( + discount_code: string, + system_slug: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'discount_code' is not null or undefined + assertParamExists( + "paymentsBasketsAddDiscountCreate", + "discount_code", + discount_code, + ) + // verify required parameter 'system_slug' is not null or undefined + assertParamExists( + "paymentsBasketsAddDiscountCreate", + "system_slug", + system_slug, + ) + const localVarPath = + `/api/v0/payments/baskets/add_discount/{system_slug}/`.replace( + `{${"system_slug"}}`, + encodeURIComponent(String(system_slug)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (discount_code !== undefined) { + localVarQueryParameter["discount_code"] = discount_code + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Clears the basket for the current user. + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + paymentsBasketsClearDestroy: async ( + system_slug: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'system_slug' is not null or undefined + assertParamExists( + "paymentsBasketsClearDestroy", + "system_slug", + system_slug, + ) + const localVarPath = + `/api/v0/payments/baskets/clear/{system_slug}/`.replace( + `{${"system_slug"}}`, + encodeURIComponent(String(system_slug)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * - * @type {string} - * @memberof MetaApiMetaProductList + * Creates or updates a basket for the current user, adding the selected product. + * @param {string} sku + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly name?: string - + paymentsBasketsCreateFromProductCreate: async ( + sku: string, + system_slug: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'sku' is not null or undefined + assertParamExists("paymentsBasketsCreateFromProductCreate", "sku", sku) + // verify required parameter 'system_slug' is not null or undefined + assertParamExists( + "paymentsBasketsCreateFromProductCreate", + "system_slug", + system_slug, + ) + const localVarPath = + `/api/v0/payments/baskets/create_from_product/{system_slug}/{sku}/` + .replace(`{${"sku"}}`, encodeURIComponent(String(sku))) + .replace( + `{${"system_slug"}}`, + encodeURIComponent(String(system_slug)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Returns or creates a basket for the current user and system. + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + paymentsBasketsForSystemRetrieve: async ( + system_slug: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'system_slug' is not null or undefined + assertParamExists( + "paymentsBasketsForSystemRetrieve", + "system_slug", + system_slug, + ) + const localVarPath = + `/api/v0/payments/baskets/for_system/{system_slug}/`.replace( + `{${"system_slug"}}`, + encodeURIComponent(String(system_slug)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrives the current user\'s baskets, one per system. + * @param {number} [integrated_system] + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + paymentsBasketsList: async ( + integrated_system?: number, + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v0/payments/baskets/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (integrated_system !== undefined) { + localVarQueryParameter["integrated_system"] = integrated_system + } + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrieve a basket for the current user. + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + paymentsBasketsRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("paymentsBasketsRetrieve", "id", id) + const localVarPath = `/api/v0/payments/baskets/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + paymentsCheckoutCreate: async ( + system_slug: string, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'system_slug' is not null or undefined + assertParamExists("paymentsCheckoutCreate", "system_slug", system_slug) + const localVarPath = `/api/v0/payments/checkout/{system_slug}/`.replace( + `{${"system_slug"}}`, + encodeURIComponent(String(system_slug)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Create a discount. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + paymentsDiscountsCreate: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v0/payments/discounts/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + /** + * Retrives the current user\'s completed orders. + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + paymentsOrdersHistoryList: async ( + limit?: number, + offset?: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v0/payments/orders/history/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + if (limit !== undefined) { + localVarQueryParameter["limit"] = limit + } + + if (offset !== undefined) { + localVarQueryParameter["offset"] = offset + } + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, /** - * The initial index from which to return the results. - * @type {number} - * @memberof MetaApiMetaProductList + * Retrieve a completed order for the current user. + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly offset?: number + paymentsOrdersHistoryRetrieve: async ( + id: number, + options: RawAxiosRequestConfig = {}, + ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists("paymentsOrdersHistoryRetrieve", "id", id) + const localVarPath = `/api/v0/payments/orders/history/{id}/`.replace( + `{${"id"}}`, + encodeURIComponent(String(id)), + ) + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} +/** + * PaymentsApi - functional programming interface + * @export + */ +export const PaymentsApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = PaymentsApiAxiosParamCreator(configuration) + return { + /** + * Creates or updates a basket for the current user, adding the discount if valid. + * @param {string} discount_code + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async paymentsBasketsAddDiscountCreate( + discount_code: string, + system_slug: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsBasketsAddDiscountCreate( + discount_code, + system_slug, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsBasketsAddDiscountCreate"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + /** + * Clears the basket for the current user. + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async paymentsBasketsClearDestroy( + system_slug: string, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsBasketsClearDestroy( + system_slug, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsBasketsClearDestroy"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * - * @type {string} - * @memberof MetaApiMetaProductList + * Creates or updates a basket for the current user, adding the selected product. + * @param {string} sku + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly system__slug?: string -} - -/** - * Request parameters for metaProductPartialUpdate operation in MetaApi. - * @export - * @interface MetaApiMetaProductPartialUpdateRequest - */ -export interface MetaApiMetaProductPartialUpdateRequest { + async paymentsBasketsCreateFromProductCreate( + sku: string, + system_slug: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsBasketsCreateFromProductCreate( + sku, + system_slug, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap[ + "PaymentsApi.paymentsBasketsCreateFromProductCreate" + ]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * A unique integer value identifying this product. - * @type {number} - * @memberof MetaApiMetaProductPartialUpdate + * Returns or creates a basket for the current user and system. + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly id: number - + async paymentsBasketsForSystemRetrieve( + system_slug: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsBasketsForSystemRetrieve( + system_slug, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsBasketsForSystemRetrieve"]?.[ + index + ]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * - * @type {PatchedProductRequest} - * @memberof MetaApiMetaProductPartialUpdate + * Retrives the current user\'s baskets, one per system. + * @param {number} [integrated_system] + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly PatchedProductRequest?: PatchedProductRequest -} - -/** - * Request parameters for metaProductRetrieve operation in MetaApi. - * @export - * @interface MetaApiMetaProductRetrieveRequest - */ -export interface MetaApiMetaProductRetrieveRequest { + async paymentsBasketsList( + integrated_system?: number, + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsBasketsList( + integrated_system, + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsBasketsList"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * A unique integer value identifying this product. - * @type {number} - * @memberof MetaApiMetaProductRetrieve + * Retrieve a basket for the current user. + * @param {number} id + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly id: number -} - -/** - * Request parameters for metaProductUpdate operation in MetaApi. - * @export - * @interface MetaApiMetaProductUpdateRequest - */ -export interface MetaApiMetaProductUpdateRequest { + async paymentsBasketsRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsBasketsRetrieve(id, options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsBasketsRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * A unique integer value identifying this product. - * @type {number} - * @memberof MetaApiMetaProductUpdate + * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. + * @param {string} system_slug + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly id: number - + async paymentsCheckoutCreate( + system_slug: string, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsCheckoutCreate( + system_slug, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsCheckoutCreate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * - * @type {ProductRequest} - * @memberof MetaApiMetaProductUpdate + * Create a discount. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - readonly ProductRequest: ProductRequest -} - -/** - * MetaApi - object-oriented interface - * @export - * @class MetaApi - * @extends {BaseAPI} - */ -export class MetaApi extends BaseAPI { + async paymentsDiscountsCreate( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsDiscountsCreate(options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsDiscountsCreate"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemCreateRequest} requestParameters Request parameters. + * Retrives the current user\'s completed orders. + * @param {number} [limit] Number of results to return per page. + * @param {number} [offset] The initial index from which to return the results. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaIntegratedSystemCreate(requestParameters: MetaApiMetaIntegratedSystemCreateRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaIntegratedSystemCreate(requestParameters.IntegratedSystemRequest, options).then((request) => request(this.axios, this.basePath)); - } - + async paymentsOrdersHistoryList( + limit?: number, + offset?: number, + options?: RawAxiosRequestConfig, + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string, + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsOrdersHistoryList( + limit, + offset, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsOrdersHistoryList"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemDestroyRequest} requestParameters Request parameters. + * Retrieve a completed order for the current user. + * @param {number} id * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaIntegratedSystemDestroy(requestParameters: MetaApiMetaIntegratedSystemDestroyRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaIntegratedSystemDestroy(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); - } + async paymentsOrdersHistoryRetrieve( + id: number, + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.paymentsOrdersHistoryRetrieve( + id, + options, + ) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["PaymentsApi.paymentsOrdersHistoryRetrieve"]?.[index] + ?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} +/** + * PaymentsApi - factory interface + * @export + */ +export const PaymentsApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = PaymentsApiFp(configuration) + return { /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemListRequest} requestParameters Request parameters. + * Creates or updates a basket for the current user, adding the discount if valid. + * @param {PaymentsApiPaymentsBasketsAddDiscountCreateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaIntegratedSystemList(requestParameters: MetaApiMetaIntegratedSystemListRequest = {}, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaIntegratedSystemList(requestParameters.limit, requestParameters.offset, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsBasketsAddDiscountCreate( + requestParameters: PaymentsApiPaymentsBasketsAddDiscountCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsBasketsAddDiscountCreate( + requestParameters.discount_code, + requestParameters.system_slug, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemPartialUpdateRequest} requestParameters Request parameters. + * Clears the basket for the current user. + * @param {PaymentsApiPaymentsBasketsClearDestroyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaIntegratedSystemPartialUpdate(requestParameters: MetaApiMetaIntegratedSystemPartialUpdateRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaIntegratedSystemPartialUpdate(requestParameters.id, requestParameters.PatchedIntegratedSystemRequest, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsBasketsClearDestroy( + requestParameters: PaymentsApiPaymentsBasketsClearDestroyRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsBasketsClearDestroy(requestParameters.system_slug, options) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemRetrieveRequest} requestParameters Request parameters. + * Creates or updates a basket for the current user, adding the selected product. + * @param {PaymentsApiPaymentsBasketsCreateFromProductCreateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaIntegratedSystemRetrieve(requestParameters: MetaApiMetaIntegratedSystemRetrieveRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaIntegratedSystemRetrieve(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsBasketsCreateFromProductCreate( + requestParameters: PaymentsApiPaymentsBasketsCreateFromProductCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsBasketsCreateFromProductCreate( + requestParameters.sku, + requestParameters.system_slug, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for IntegratedSystem model. - * @param {MetaApiMetaIntegratedSystemUpdateRequest} requestParameters Request parameters. + * Returns or creates a basket for the current user and system. + * @param {PaymentsApiPaymentsBasketsForSystemRetrieveRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaIntegratedSystemUpdate(requestParameters: MetaApiMetaIntegratedSystemUpdateRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaIntegratedSystemUpdate(requestParameters.id, requestParameters.IntegratedSystemRequest, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsBasketsForSystemRetrieve( + requestParameters: PaymentsApiPaymentsBasketsForSystemRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsBasketsForSystemRetrieve( + requestParameters.system_slug, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for Product model. - * @param {MetaApiMetaProductCreateRequest} requestParameters Request parameters. + * Retrives the current user\'s baskets, one per system. + * @param {PaymentsApiPaymentsBasketsListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaProductCreate(requestParameters: MetaApiMetaProductCreateRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaProductCreate(requestParameters.ProductRequest, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsBasketsList( + requestParameters: PaymentsApiPaymentsBasketsListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsBasketsList( + requestParameters.integrated_system, + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for Product model. - * @param {MetaApiMetaProductDestroyRequest} requestParameters Request parameters. + * Retrieve a basket for the current user. + * @param {PaymentsApiPaymentsBasketsRetrieveRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaProductDestroy(requestParameters: MetaApiMetaProductDestroyRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaProductDestroy(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsBasketsRetrieve( + requestParameters: PaymentsApiPaymentsBasketsRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsBasketsRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for Product model. - * @param {MetaApiMetaProductListRequest} requestParameters Request parameters. + * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. + * @param {PaymentsApiPaymentsCheckoutCreateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaProductList(requestParameters: MetaApiMetaProductListRequest = {}, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaProductList(requestParameters.limit, requestParameters.name, requestParameters.offset, requestParameters.system__slug, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsCheckoutCreate( + requestParameters: PaymentsApiPaymentsCheckoutCreateRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsCheckoutCreate(requestParameters.system_slug, options) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for Product model. - * @param {MetaApiMetaProductPartialUpdateRequest} requestParameters Request parameters. + * Create a discount. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaProductPartialUpdate(requestParameters: MetaApiMetaProductPartialUpdateRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaProductPartialUpdate(requestParameters.id, requestParameters.PatchedProductRequest, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsDiscountsCreate( + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsDiscountsCreate(options) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for Product model. - * @param {MetaApiMetaProductRetrieveRequest} requestParameters Request parameters. + * Retrives the current user\'s completed orders. + * @param {PaymentsApiPaymentsOrdersHistoryListRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaProductRetrieve(requestParameters: MetaApiMetaProductRetrieveRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaProductRetrieve(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); - } - + paymentsOrdersHistoryList( + requestParameters: PaymentsApiPaymentsOrdersHistoryListRequest = {}, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsOrdersHistoryList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(axios, basePath)) + }, /** - * Viewset for Product model. - * @param {MetaApiMetaProductUpdateRequest} requestParameters Request parameters. + * Retrieve a completed order for the current user. + * @param {PaymentsApiPaymentsOrdersHistoryRetrieveRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof MetaApi */ - public metaProductUpdate(requestParameters: MetaApiMetaProductUpdateRequest, options?: RawAxiosRequestConfig) { - return MetaApiFp(this.configuration).metaProductUpdate(requestParameters.id, requestParameters.ProductRequest, options).then((request) => request(this.axios, this.basePath)); - } + paymentsOrdersHistoryRetrieve( + requestParameters: PaymentsApiPaymentsOrdersHistoryRetrieveRequest, + options?: RawAxiosRequestConfig, + ): AxiosPromise { + return localVarFp + .paymentsOrdersHistoryRetrieve(requestParameters.id, options) + .then((request) => request(axios, basePath)) + }, + } } - - -/** - * PaymentsApi - axios parameter creator - * @export - */ -export const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Creates or updates a basket for the current user, adding the discount if valid. - * @param {string} discount_code - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsAddDiscountCreate: async (discount_code: string, system_slug: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'discount_code' is not null or undefined - assertParamExists('paymentsBasketsAddDiscountCreate', 'discount_code', discount_code) - // verify required parameter 'system_slug' is not null or undefined - assertParamExists('paymentsBasketsAddDiscountCreate', 'system_slug', system_slug) - const localVarPath = `/api/v0/payments/baskets/add_discount/{system_slug}/` - .replace(`{${"system_slug"}}`, encodeURIComponent(String(system_slug))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (discount_code !== undefined) { - localVarQueryParameter['discount_code'] = discount_code; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Clears the basket for the current user. - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsClearDestroy: async (system_slug: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'system_slug' is not null or undefined - assertParamExists('paymentsBasketsClearDestroy', 'system_slug', system_slug) - const localVarPath = `/api/v0/payments/baskets/clear/{system_slug}/` - .replace(`{${"system_slug"}}`, encodeURIComponent(String(system_slug))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Creates or updates a basket for the current user, adding the selected product. - * @param {string} sku - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsCreateFromProductCreate: async (sku: string, system_slug: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'sku' is not null or undefined - assertParamExists('paymentsBasketsCreateFromProductCreate', 'sku', sku) - // verify required parameter 'system_slug' is not null or undefined - assertParamExists('paymentsBasketsCreateFromProductCreate', 'system_slug', system_slug) - const localVarPath = `/api/v0/payments/baskets/create_from_product/{system_slug}/{sku}/` - .replace(`{${"sku"}}`, encodeURIComponent(String(sku))) - .replace(`{${"system_slug"}}`, encodeURIComponent(String(system_slug))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns or creates a basket for the current user and system. - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsForSystemRetrieve: async (system_slug: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'system_slug' is not null or undefined - assertParamExists('paymentsBasketsForSystemRetrieve', 'system_slug', system_slug) - const localVarPath = `/api/v0/payments/baskets/for_system/{system_slug}/` - .replace(`{${"system_slug"}}`, encodeURIComponent(String(system_slug))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrives the current user\'s baskets, one per system. - * @param {number} [integrated_system] - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsList: async (integrated_system?: number, limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v0/payments/baskets/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (integrated_system !== undefined) { - localVarQueryParameter['integrated_system'] = integrated_system; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (offset !== undefined) { - localVarQueryParameter['offset'] = offset; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve a basket for the current user. - * @param {number} id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('paymentsBasketsRetrieve', 'id', id) - const localVarPath = `/api/v0/payments/baskets/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsCheckoutCreate: async (system_slug: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'system_slug' is not null or undefined - assertParamExists('paymentsCheckoutCreate', 'system_slug', system_slug) - const localVarPath = `/api/v0/payments/checkout/{system_slug}/` - .replace(`{${"system_slug"}}`, encodeURIComponent(String(system_slug))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Create a discount. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsDiscountsCreate: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v0/payments/discounts/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrives the current user\'s completed orders. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsOrdersHistoryList: async (limit?: number, offset?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v0/payments/orders/history/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (offset !== undefined) { - localVarQueryParameter['offset'] = offset; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieve a completed order for the current user. - * @param {number} id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsOrdersHistoryRetrieve: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('paymentsOrdersHistoryRetrieve', 'id', id) - const localVarPath = `/api/v0/payments/orders/history/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * PaymentsApi - functional programming interface - * @export - */ -export const PaymentsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = PaymentsApiAxiosParamCreator(configuration) - return { - /** - * Creates or updates a basket for the current user, adding the discount if valid. - * @param {string} discount_code - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsBasketsAddDiscountCreate(discount_code: string, system_slug: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsBasketsAddDiscountCreate(discount_code, system_slug, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsBasketsAddDiscountCreate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Clears the basket for the current user. - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsBasketsClearDestroy(system_slug: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsBasketsClearDestroy(system_slug, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsBasketsClearDestroy']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Creates or updates a basket for the current user, adding the selected product. - * @param {string} sku - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsBasketsCreateFromProductCreate(sku: string, system_slug: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsBasketsCreateFromProductCreate(sku, system_slug, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsBasketsCreateFromProductCreate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Returns or creates a basket for the current user and system. - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsBasketsForSystemRetrieve(system_slug: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsBasketsForSystemRetrieve(system_slug, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsBasketsForSystemRetrieve']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Retrives the current user\'s baskets, one per system. - * @param {number} [integrated_system] - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsBasketsList(integrated_system?: number, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsBasketsList(integrated_system, limit, offset, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsBasketsList']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Retrieve a basket for the current user. - * @param {number} id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsBasketsRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsBasketsRetrieve(id, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsBasketsRetrieve']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. - * @param {string} system_slug - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsCheckoutCreate(system_slug: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsCheckoutCreate(system_slug, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsCheckoutCreate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Create a discount. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsDiscountsCreate(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsDiscountsCreate(options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsDiscountsCreate']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Retrives the current user\'s completed orders. - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsOrdersHistoryList(limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsOrdersHistoryList(limit, offset, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsOrdersHistoryList']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - /** - * Retrieve a completed order for the current user. - * @param {number} id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async paymentsOrdersHistoryRetrieve(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.paymentsOrdersHistoryRetrieve(id, options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['PaymentsApi.paymentsOrdersHistoryRetrieve']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - } -}; - -/** - * PaymentsApi - factory interface - * @export - */ -export const PaymentsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = PaymentsApiFp(configuration) - return { - /** - * Creates or updates a basket for the current user, adding the discount if valid. - * @param {PaymentsApiPaymentsBasketsAddDiscountCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsAddDiscountCreate(requestParameters: PaymentsApiPaymentsBasketsAddDiscountCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsBasketsAddDiscountCreate(requestParameters.discount_code, requestParameters.system_slug, options).then((request) => request(axios, basePath)); - }, - /** - * Clears the basket for the current user. - * @param {PaymentsApiPaymentsBasketsClearDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsClearDestroy(requestParameters: PaymentsApiPaymentsBasketsClearDestroyRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsBasketsClearDestroy(requestParameters.system_slug, options).then((request) => request(axios, basePath)); - }, - /** - * Creates or updates a basket for the current user, adding the selected product. - * @param {PaymentsApiPaymentsBasketsCreateFromProductCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsCreateFromProductCreate(requestParameters: PaymentsApiPaymentsBasketsCreateFromProductCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsBasketsCreateFromProductCreate(requestParameters.sku, requestParameters.system_slug, options).then((request) => request(axios, basePath)); - }, - /** - * Returns or creates a basket for the current user and system. - * @param {PaymentsApiPaymentsBasketsForSystemRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsForSystemRetrieve(requestParameters: PaymentsApiPaymentsBasketsForSystemRetrieveRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsBasketsForSystemRetrieve(requestParameters.system_slug, options).then((request) => request(axios, basePath)); - }, - /** - * Retrives the current user\'s baskets, one per system. - * @param {PaymentsApiPaymentsBasketsListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsList(requestParameters: PaymentsApiPaymentsBasketsListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsBasketsList(requestParameters.integrated_system, requestParameters.limit, requestParameters.offset, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieve a basket for the current user. - * @param {PaymentsApiPaymentsBasketsRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsBasketsRetrieve(requestParameters: PaymentsApiPaymentsBasketsRetrieveRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsBasketsRetrieve(requestParameters.id, options).then((request) => request(axios, basePath)); - }, - /** - * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. - * @param {PaymentsApiPaymentsCheckoutCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsCheckoutCreate(requestParameters: PaymentsApiPaymentsCheckoutCreateRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsCheckoutCreate(requestParameters.system_slug, options).then((request) => request(axios, basePath)); - }, - /** - * Create a discount. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsDiscountsCreate(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsDiscountsCreate(options).then((request) => request(axios, basePath)); - }, - /** - * Retrives the current user\'s completed orders. - * @param {PaymentsApiPaymentsOrdersHistoryListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsOrdersHistoryList(requestParameters: PaymentsApiPaymentsOrdersHistoryListRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsOrdersHistoryList(requestParameters.limit, requestParameters.offset, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieve a completed order for the current user. - * @param {PaymentsApiPaymentsOrdersHistoryRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - paymentsOrdersHistoryRetrieve(requestParameters: PaymentsApiPaymentsOrdersHistoryRetrieveRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.paymentsOrdersHistoryRetrieve(requestParameters.id, options).then((request) => request(axios, basePath)); - }, - }; -}; - /** * Request parameters for paymentsBasketsAddDiscountCreate operation in PaymentsApi. * @export * @interface PaymentsApiPaymentsBasketsAddDiscountCreateRequest */ export interface PaymentsApiPaymentsBasketsAddDiscountCreateRequest { - /** - * - * @type {string} - * @memberof PaymentsApiPaymentsBasketsAddDiscountCreate - */ - readonly discount_code: string - - /** - * - * @type {string} - * @memberof PaymentsApiPaymentsBasketsAddDiscountCreate - */ - readonly system_slug: string + /** + * + * @type {string} + * @memberof PaymentsApiPaymentsBasketsAddDiscountCreate + */ + readonly discount_code: string + + /** + * + * @type {string} + * @memberof PaymentsApiPaymentsBasketsAddDiscountCreate + */ + readonly system_slug: string } /** @@ -3928,12 +4942,12 @@ export interface PaymentsApiPaymentsBasketsAddDiscountCreateRequest { * @interface PaymentsApiPaymentsBasketsClearDestroyRequest */ export interface PaymentsApiPaymentsBasketsClearDestroyRequest { - /** - * - * @type {string} - * @memberof PaymentsApiPaymentsBasketsClearDestroy - */ - readonly system_slug: string + /** + * + * @type {string} + * @memberof PaymentsApiPaymentsBasketsClearDestroy + */ + readonly system_slug: string } /** @@ -3942,19 +4956,19 @@ export interface PaymentsApiPaymentsBasketsClearDestroyRequest { * @interface PaymentsApiPaymentsBasketsCreateFromProductCreateRequest */ export interface PaymentsApiPaymentsBasketsCreateFromProductCreateRequest { - /** - * - * @type {string} - * @memberof PaymentsApiPaymentsBasketsCreateFromProductCreate - */ - readonly sku: string - - /** - * - * @type {string} - * @memberof PaymentsApiPaymentsBasketsCreateFromProductCreate - */ - readonly system_slug: string + /** + * + * @type {string} + * @memberof PaymentsApiPaymentsBasketsCreateFromProductCreate + */ + readonly sku: string + + /** + * + * @type {string} + * @memberof PaymentsApiPaymentsBasketsCreateFromProductCreate + */ + readonly system_slug: string } /** @@ -3963,12 +4977,12 @@ export interface PaymentsApiPaymentsBasketsCreateFromProductCreateRequest { * @interface PaymentsApiPaymentsBasketsForSystemRetrieveRequest */ export interface PaymentsApiPaymentsBasketsForSystemRetrieveRequest { - /** - * - * @type {string} - * @memberof PaymentsApiPaymentsBasketsForSystemRetrieve - */ - readonly system_slug: string + /** + * + * @type {string} + * @memberof PaymentsApiPaymentsBasketsForSystemRetrieve + */ + readonly system_slug: string } /** @@ -3977,26 +4991,26 @@ export interface PaymentsApiPaymentsBasketsForSystemRetrieveRequest { * @interface PaymentsApiPaymentsBasketsListRequest */ export interface PaymentsApiPaymentsBasketsListRequest { - /** - * - * @type {number} - * @memberof PaymentsApiPaymentsBasketsList - */ - readonly integrated_system?: number - - /** - * Number of results to return per page. - * @type {number} - * @memberof PaymentsApiPaymentsBasketsList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof PaymentsApiPaymentsBasketsList - */ - readonly offset?: number + /** + * + * @type {number} + * @memberof PaymentsApiPaymentsBasketsList + */ + readonly integrated_system?: number + + /** + * Number of results to return per page. + * @type {number} + * @memberof PaymentsApiPaymentsBasketsList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof PaymentsApiPaymentsBasketsList + */ + readonly offset?: number } /** @@ -4005,12 +5019,12 @@ export interface PaymentsApiPaymentsBasketsListRequest { * @interface PaymentsApiPaymentsBasketsRetrieveRequest */ export interface PaymentsApiPaymentsBasketsRetrieveRequest { - /** - * - * @type {number} - * @memberof PaymentsApiPaymentsBasketsRetrieve - */ - readonly id: number + /** + * + * @type {number} + * @memberof PaymentsApiPaymentsBasketsRetrieve + */ + readonly id: number } /** @@ -4019,12 +5033,12 @@ export interface PaymentsApiPaymentsBasketsRetrieveRequest { * @interface PaymentsApiPaymentsCheckoutCreateRequest */ export interface PaymentsApiPaymentsCheckoutCreateRequest { - /** - * - * @type {string} - * @memberof PaymentsApiPaymentsCheckoutCreate - */ - readonly system_slug: string + /** + * + * @type {string} + * @memberof PaymentsApiPaymentsCheckoutCreate + */ + readonly system_slug: string } /** @@ -4033,19 +5047,19 @@ export interface PaymentsApiPaymentsCheckoutCreateRequest { * @interface PaymentsApiPaymentsOrdersHistoryListRequest */ export interface PaymentsApiPaymentsOrdersHistoryListRequest { - /** - * Number of results to return per page. - * @type {number} - * @memberof PaymentsApiPaymentsOrdersHistoryList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof PaymentsApiPaymentsOrdersHistoryList - */ - readonly offset?: number + /** + * Number of results to return per page. + * @type {number} + * @memberof PaymentsApiPaymentsOrdersHistoryList + */ + readonly limit?: number + + /** + * The initial index from which to return the results. + * @type {number} + * @memberof PaymentsApiPaymentsOrdersHistoryList + */ + readonly offset?: number } /** @@ -4054,12 +5068,12 @@ export interface PaymentsApiPaymentsOrdersHistoryListRequest { * @interface PaymentsApiPaymentsOrdersHistoryRetrieveRequest */ export interface PaymentsApiPaymentsOrdersHistoryRetrieveRequest { - /** - * - * @type {number} - * @memberof PaymentsApiPaymentsOrdersHistoryRetrieve - */ - readonly id: number + /** + * + * @type {number} + * @memberof PaymentsApiPaymentsOrdersHistoryRetrieve + */ + readonly id: number } /** @@ -4069,194 +5083,285 @@ export interface PaymentsApiPaymentsOrdersHistoryRetrieveRequest { * @extends {BaseAPI} */ export class PaymentsApi extends BaseAPI { - /** - * Creates or updates a basket for the current user, adding the discount if valid. - * @param {PaymentsApiPaymentsBasketsAddDiscountCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsBasketsAddDiscountCreate(requestParameters: PaymentsApiPaymentsBasketsAddDiscountCreateRequest, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsBasketsAddDiscountCreate(requestParameters.discount_code, requestParameters.system_slug, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Clears the basket for the current user. - * @param {PaymentsApiPaymentsBasketsClearDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsBasketsClearDestroy(requestParameters: PaymentsApiPaymentsBasketsClearDestroyRequest, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsBasketsClearDestroy(requestParameters.system_slug, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Creates or updates a basket for the current user, adding the selected product. - * @param {PaymentsApiPaymentsBasketsCreateFromProductCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsBasketsCreateFromProductCreate(requestParameters: PaymentsApiPaymentsBasketsCreateFromProductCreateRequest, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsBasketsCreateFromProductCreate(requestParameters.sku, requestParameters.system_slug, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns or creates a basket for the current user and system. - * @param {PaymentsApiPaymentsBasketsForSystemRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsBasketsForSystemRetrieve(requestParameters: PaymentsApiPaymentsBasketsForSystemRetrieveRequest, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsBasketsForSystemRetrieve(requestParameters.system_slug, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrives the current user\'s baskets, one per system. - * @param {PaymentsApiPaymentsBasketsListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsBasketsList(requestParameters: PaymentsApiPaymentsBasketsListRequest = {}, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsBasketsList(requestParameters.integrated_system, requestParameters.limit, requestParameters.offset, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve a basket for the current user. - * @param {PaymentsApiPaymentsBasketsRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsBasketsRetrieve(requestParameters: PaymentsApiPaymentsBasketsRetrieveRequest, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsBasketsRetrieve(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. - * @param {PaymentsApiPaymentsCheckoutCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsCheckoutCreate(requestParameters: PaymentsApiPaymentsCheckoutCreateRequest, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsCheckoutCreate(requestParameters.system_slug, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Create a discount. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsDiscountsCreate(options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsDiscountsCreate(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrives the current user\'s completed orders. - * @param {PaymentsApiPaymentsOrdersHistoryListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsOrdersHistoryList(requestParameters: PaymentsApiPaymentsOrdersHistoryListRequest = {}, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsOrdersHistoryList(requestParameters.limit, requestParameters.offset, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve a completed order for the current user. - * @param {PaymentsApiPaymentsOrdersHistoryRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PaymentsApi - */ - public paymentsOrdersHistoryRetrieve(requestParameters: PaymentsApiPaymentsOrdersHistoryRetrieveRequest, options?: RawAxiosRequestConfig) { - return PaymentsApiFp(this.configuration).paymentsOrdersHistoryRetrieve(requestParameters.id, options).then((request) => request(this.axios, this.basePath)); - } + /** + * Creates or updates a basket for the current user, adding the discount if valid. + * @param {PaymentsApiPaymentsBasketsAddDiscountCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsBasketsAddDiscountCreate( + requestParameters: PaymentsApiPaymentsBasketsAddDiscountCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsBasketsAddDiscountCreate( + requestParameters.discount_code, + requestParameters.system_slug, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Clears the basket for the current user. + * @param {PaymentsApiPaymentsBasketsClearDestroyRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsBasketsClearDestroy( + requestParameters: PaymentsApiPaymentsBasketsClearDestroyRequest, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsBasketsClearDestroy(requestParameters.system_slug, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Creates or updates a basket for the current user, adding the selected product. + * @param {PaymentsApiPaymentsBasketsCreateFromProductCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsBasketsCreateFromProductCreate( + requestParameters: PaymentsApiPaymentsBasketsCreateFromProductCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsBasketsCreateFromProductCreate( + requestParameters.sku, + requestParameters.system_slug, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Returns or creates a basket for the current user and system. + * @param {PaymentsApiPaymentsBasketsForSystemRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsBasketsForSystemRetrieve( + requestParameters: PaymentsApiPaymentsBasketsForSystemRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsBasketsForSystemRetrieve(requestParameters.system_slug, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrives the current user\'s baskets, one per system. + * @param {PaymentsApiPaymentsBasketsListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsBasketsList( + requestParameters: PaymentsApiPaymentsBasketsListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsBasketsList( + requestParameters.integrated_system, + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a basket for the current user. + * @param {PaymentsApiPaymentsBasketsRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsBasketsRetrieve( + requestParameters: PaymentsApiPaymentsBasketsRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsBasketsRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Generates and returns the form payload for the current basket for the specified system, which can be used to start the checkout process. + * @param {PaymentsApiPaymentsCheckoutCreateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsCheckoutCreate( + requestParameters: PaymentsApiPaymentsCheckoutCreateRequest, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsCheckoutCreate(requestParameters.system_slug, options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Create a discount. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsDiscountsCreate(options?: RawAxiosRequestConfig) { + return PaymentsApiFp(this.configuration) + .paymentsDiscountsCreate(options) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrives the current user\'s completed orders. + * @param {PaymentsApiPaymentsOrdersHistoryListRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsOrdersHistoryList( + requestParameters: PaymentsApiPaymentsOrdersHistoryListRequest = {}, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsOrdersHistoryList( + requestParameters.limit, + requestParameters.offset, + options, + ) + .then((request) => request(this.axios, this.basePath)) + } + + /** + * Retrieve a completed order for the current user. + * @param {PaymentsApiPaymentsOrdersHistoryRetrieveRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PaymentsApi + */ + public paymentsOrdersHistoryRetrieve( + requestParameters: PaymentsApiPaymentsOrdersHistoryRetrieveRequest, + options?: RawAxiosRequestConfig, + ) { + return PaymentsApiFp(this.configuration) + .paymentsOrdersHistoryRetrieve(requestParameters.id, options) + .then((request) => request(this.axios, this.basePath)) + } } - - /** * UsersApi - axios parameter creator * @export */ -export const UsersApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * User retrieve and update viewsets for the current user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - usersMeRetrieve: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v0/users/me/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; +export const UsersApiAxiosParamCreator = function ( + configuration?: Configuration, +) { + return { + /** + * User retrieve and update viewsets for the current user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + usersMeRetrieve: async ( + options: RawAxiosRequestConfig = {}, + ): Promise => { + const localVarPath = `/api/v0/users/me/` + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL) + let baseOptions + if (configuration) { + baseOptions = configuration.baseOptions + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + } + const localVarHeaderParameter = {} as any + const localVarQueryParameter = {} as any + + setSearchParams(localVarUrlObj, localVarQueryParameter) + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {} + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + } + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + } + }, + } +} /** * UsersApi - functional programming interface * @export */ -export const UsersApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration) - return { - /** - * User retrieve and update viewsets for the current user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async usersMeRetrieve(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.usersMeRetrieve(options); - const index = configuration?.serverIndex ?? 0; - const operationBasePath = operationServerMap['UsersApi.usersMeRetrieve']?.[index]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); - }, - } -}; +export const UsersApiFp = function (configuration?: Configuration) { + const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration) + return { + /** + * User retrieve and update viewsets for the current user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async usersMeRetrieve( + options?: RawAxiosRequestConfig, + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.usersMeRetrieve(options) + const index = configuration?.serverIndex ?? 0 + const operationBasePath = + operationServerMap["UsersApi.usersMeRetrieve"]?.[index]?.url + return (axios, basePath) => + createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration, + )(axios, operationBasePath || basePath) + }, + } +} /** * UsersApi - factory interface * @export */ -export const UsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = UsersApiFp(configuration) - return { - /** - * User retrieve and update viewsets for the current user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - usersMeRetrieve(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.usersMeRetrieve(options).then((request) => request(axios, basePath)); - }, - }; -}; +export const UsersApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance, +) { + const localVarFp = UsersApiFp(configuration) + return { + /** + * User retrieve and update viewsets for the current user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + usersMeRetrieve(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp + .usersMeRetrieve(options) + .then((request) => request(axios, basePath)) + }, + } +} /** * UsersApi - object-oriented interface @@ -4265,13 +5370,15 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath * @extends {BaseAPI} */ export class UsersApi extends BaseAPI { - /** - * User retrieve and update viewsets for the current user - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UsersApi - */ - public usersMeRetrieve(options?: RawAxiosRequestConfig) { - return UsersApiFp(this.configuration).usersMeRetrieve(options).then((request) => request(this.axios, this.basePath)); - } + /** + * User retrieve and update viewsets for the current user + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UsersApi + */ + public usersMeRetrieve(options?: RawAxiosRequestConfig) { + return UsersApiFp(this.configuration) + .usersMeRetrieve(options) + .then((request) => request(this.axios, this.basePath)) + } } diff --git a/frontends/api/src/generated/v0/base.ts b/frontends/api/src/generated/v0/base.ts index 4637f4dc..a669c751 100644 --- a/frontends/api/src/generated/v0/base.ts +++ b/frontends/api/src/generated/v0/base.ts @@ -12,25 +12,24 @@ * Do not edit the class manually. */ - -import type { Configuration } from './configuration'; +import type { Configuration } from "./configuration" // Some imports not used depending on template conditions // @ts-ignore -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios" +import globalAxios from "axios" -export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); +export const BASE_PATH = "http://localhost".replace(/\/+$/, "") /** * * @export */ export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -}; + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +} /** * @@ -38,8 +37,8 @@ export const COLLECTION_FORMATS = { * @interface RequestArgs */ export interface RequestArgs { - url: string; - options: RawAxiosRequestConfig; + url: string + options: RawAxiosRequestConfig } /** @@ -48,15 +47,19 @@ export interface RequestArgs { * @class BaseAPI */ export class BaseAPI { - protected configuration: Configuration | undefined; + protected configuration: Configuration | undefined - constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { - if (configuration) { - this.configuration = configuration; - this.basePath = configuration.basePath ?? basePath; - } + constructor( + configuration?: Configuration, + protected basePath: string = BASE_PATH, + protected axios: AxiosInstance = globalAxios, + ) { + if (configuration) { + this.configuration = configuration + this.basePath = configuration.basePath ?? basePath } -}; + } +} /** * @@ -65,22 +68,24 @@ export class BaseAPI { * @extends {Error} */ export class RequiredError extends Error { - constructor(public field: string, msg?: string) { - super(msg); - this.name = "RequiredError" - } + constructor( + public field: string, + msg?: string, + ) { + super(msg) + this.name = "RequiredError" + } } interface ServerMap { - [key: string]: { - url: string, - description: string, - }[]; + [key: string]: { + url: string + description: string + }[] } /** * * @export */ -export const operationServerMap: ServerMap = { -} +export const operationServerMap: ServerMap = {} diff --git a/frontends/api/src/generated/v0/common.ts b/frontends/api/src/generated/v0/common.ts index 6b33a226..13f16c41 100644 --- a/frontends/api/src/generated/v0/common.ts +++ b/frontends/api/src/generated/v0/common.ts @@ -12,98 +12,132 @@ * Do not edit the class manually. */ - -import type { Configuration } from "./configuration"; -import type { RequestArgs } from "./base"; -import type { AxiosInstance, AxiosResponse } from 'axios'; -import { RequiredError } from "./base"; +import type { Configuration } from "./configuration" +import type { RequestArgs } from "./base" +import type { AxiosInstance, AxiosResponse } from "axios" +import { RequiredError } from "./base" /** * * @export */ -export const DUMMY_BASE_URL = 'https://example.com' +export const DUMMY_BASE_URL = "https://example.com" /** * * @throws {RequiredError} * @export */ -export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } +export const assertParamExists = function ( + functionName: string, + paramName: string, + paramValue: unknown, +) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError( + paramName, + `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, + ) + } } /** * * @export */ -export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } +export const setApiKeyToObject = async function ( + object: any, + keyParamName: string, + configuration?: Configuration, +) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = + typeof configuration.apiKey === "function" + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey + object[keyParamName] = localVarApiKeyValue + } } /** * * @export */ -export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; +export const setBasicAuthToObject = function ( + object: any, + configuration?: Configuration, +) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { + username: configuration.username, + password: configuration.password, } + } } /** * * @export */ -export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } +export const setBearerAuthToObject = async function ( + object: any, + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const accessToken = + typeof configuration.accessToken === "function" + ? await configuration.accessToken() + : await configuration.accessToken + object["Authorization"] = "Bearer " + accessToken + } } /** * * @export */ -export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } +export const setOAuthToObject = async function ( + object: any, + name: string, + scopes: string[], + configuration?: Configuration, +) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = + typeof configuration.accessToken === "function" + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken + object["Authorization"] = "Bearer " + localVarAccessTokenValue + } } -function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { - if (parameter == null) return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); - } - else { - Object.keys(parameter).forEach(currentKey => - setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) - ); - } +function setFlattenedQueryParams( + urlSearchParams: URLSearchParams, + parameter: any, + key: string = "", +): void { + if (parameter == null) return + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + ;(parameter as any[]).forEach((item) => + setFlattenedQueryParams(urlSearchParams, item, key), + ) + } else { + Object.keys(parameter).forEach((currentKey) => + setFlattenedQueryParams( + urlSearchParams, + parameter[currentKey], + `${key}${key !== "" ? "." : ""}${currentKey}`, + ), + ) } - else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } - else { - urlSearchParams.set(key, parameter); - } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter) + } else { + urlSearchParams.set(key, parameter) } + } } /** @@ -111,23 +145,28 @@ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: an * @export */ export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); + const searchParams = new URLSearchParams(url.search) + setFlattenedQueryParams(searchParams, objects) + url.search = searchParams.toString() } /** * * @export */ -export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { - const nonString = typeof value !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers['Content-Type']) - : nonString; - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : (value || ""); +export const serializeDataIfNeeded = function ( + value: any, + requestOptions: any, + configuration?: Configuration, +) { + const nonString = typeof value !== "string" + const needsSerialization = + nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) + : nonString + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : value || "" } /** @@ -135,16 +174,29 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, * @export */ export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash + return url.pathname + url.search + url.hash } /** * * @export */ -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); - }; +export const createRequestFunction = function ( + axiosArgs: RequestArgs, + globalAxios: AxiosInstance, + BASE_PATH: string, + configuration?: Configuration, +) { + return >( + axios: AxiosInstance = globalAxios, + basePath: string = BASE_PATH, + ) => { + const axiosRequestArgs = { + ...axiosArgs.options, + url: + (axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) + + axiosArgs.url, + } + return axios.request(axiosRequestArgs) + } } diff --git a/frontends/api/src/generated/v0/configuration.ts b/frontends/api/src/generated/v0/configuration.ts index 914a165d..f207afa3 100644 --- a/frontends/api/src/generated/v0/configuration.ts +++ b/frontends/api/src/generated/v0/configuration.ts @@ -12,99 +12,121 @@ * Do not edit the class manually. */ - export interface ConfigurationParameters { - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - username?: string; - password?: string; - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - basePath?: string; - serverIndex?: number; - baseOptions?: any; - formDataCtor?: new () => any; + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise) + username?: string + password?: string + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise) + basePath?: string + serverIndex?: number + baseOptions?: any + formDataCtor?: new () => any } export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string; - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string; - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string; - /** - * override server index - * - * @type {number} - * @memberof Configuration - */ - serverIndex?: number; - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any; - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any; + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: + | string + | Promise + | ((name: string) => string) + | ((name: string) => Promise) + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string) + | ((name?: string, scopes?: string[]) => Promise) + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = param.baseOptions; - this.formDataCtor = param.formDataCtor; - } + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey + this.username = param.username + this.password = param.password + this.accessToken = param.accessToken + this.basePath = param.basePath + this.serverIndex = param.serverIndex + this.baseOptions = param.baseOptions + this.formDataCtor = param.formDataCtor + } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + "^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$", + "i", + ) + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === "application/json-patch+json") + ) + } } diff --git a/frontends/api/src/generated/v0/index.ts b/frontends/api/src/generated/v0/index.ts index 9f2a7004..7b0c76ac 100644 --- a/frontends/api/src/generated/v0/index.ts +++ b/frontends/api/src/generated/v0/index.ts @@ -12,6 +12,5 @@ * Do not edit the class manually. */ - -export * from "./api"; -export * from "./configuration"; +export * from "./api" +export * from "./configuration" diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..d1b59cb8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,78 @@ +{ + "name": "root", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "root", + "version": "0.0.0", + "workspaces": [ + "frontends/*" + ], + "dependencies": { + "prettier": "^3.0.3", + "prettier-plugin-sh": "^0.14.0" + } + }, + "node_modules/mvdan-sh": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/mvdan-sh/-/mvdan-sh-0.10.1.tgz", + "integrity": "sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==", + "license": "BSD-3-Clause" + }, + "node_modules/prettier": { + "version": "3.4.2", + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-sh": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.14.0.tgz", + "integrity": "sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==", + "license": "MIT", + "dependencies": { + "mvdan-sh": "^0.10.1", + "sh-syntax": "^0.4.1" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + }, + "peerDependencies": { + "prettier": "^3.0.3" + } + }, + "node_modules/sh-syntax": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/sh-syntax/-/sh-syntax-0.4.2.tgz", + "integrity": "sha512-/l2UZ5fhGZLVZa16XQM9/Vq/hezGGbdHeVEA01uWjOL1+7Ek/gt6FquW0iKKws4a9AYPYvlz6RyVvjh3JxOteg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + } + } +} diff --git a/package.json b/package.json index aeeec6f9..dc254f31 100644 --- a/package.json +++ b/package.json @@ -4,80 +4,10 @@ "workspaces": [ "frontends/*" ], - "scripts": { - "foreach": "yarn workspaces foreach -pvi --exclude=root run", - "start-dev": "yarn workspaces foreach -pvi run start-dev", - "build": "yarn workspaces foreach run build", - "lint-check": "yarn foreach global:lint-check", - "lint-fix": "yarn foreach global:lint-fix", - "fmt-check": "prettier --check .", - "fmt-fix": "prettier --write .", - "test": "yarn global:test", - "test-watch": "yarn global:test-watch", - "scss-lint": "yarn foreach global:scss-lint", - "scss-lint-fix": "yarn foreach global:scss-lint-fix", - "typecheck": "yarn foreach global:typecheck", - "global:lint-check": "cd $INIT_CWD && eslint . --ext .js,.jsx,.ts,.tsx", - "global:scss-lint": "cd $INIT_CWD && stylelint '**/*.scss' --allow-empty-input", - "global:scss-lint-fix": "cd $INIT_CWD && stylelint '**/*.scss' --allow-empty-input --fix", - "global:lint-fix": "cd $INIT_CWD && eslint --fix . --ext .js,.jsx,.ts,.tsx", - "global:test": "cd $INIT_CWD && NODE_ENV=test jest", - "global:typecheck": "cd $INIT_CWD && tsc --noEmit", - "global:test-watch": "cd $INIT_CWD && NODE_ENV=test jest --watch", - "create-package": "yarn workspace ol-template plop package" - }, + "scripts": {}, "version": "0.0.0", - "packageManager": "yarn@4.5.0", "dependencies": { - "@ebay/nice-modal-react": "^1.2.10", - "@swc/core": "^1.3.32", - "@swc/jest": "^0.2.26", - "@testing-library/jest-dom": "^6.0.0", - "@testing-library/react": "^14.0.0", - "@testing-library/user-event": "^14.4.3", - "@types/css-mediaquery": "^0.1.1", - "@types/jest": "^29.5.2", - "@types/jest-when": "^3.5.2", - "@types/react-dotdotdot": "^1.2.5", - "@types/react-infinite-scroller": "^1.2.3", - "@types/styled-components": "^5.1.25", - "@types/url-assembler": "^2.1.1", - "@typescript-eslint/eslint-plugin": "^8.0.0", - "casual-browserify": "^1.5.19-2", - "css-mediaquery": "^0.1.2", - "eslint": "^9.0.0", - "eslint-config-mitodl": "^1.0.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jest": "^27.1.1", - "eslint-plugin-mocha": "^10.0.5", - "eslint-plugin-react": "^7.30.1", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-testing-library": "^6.0.0", - "exec-sh": "^0.4.0", - "html-entities": "^2.3.3", - "iso-639-1": "^3.0.0", - "jest": "^29.6.4", - "jest-environment-jsdom": "^29.5.0", - "jest-extended": "^4.0.0", - "jest-fail-on-console": "^2.4.2", - "jest-watch-typeahead": "^2.2.2", - "jest-when": "^3.5.1", - "locale-code": "^2.0.2", "prettier": "^3.0.3", - "prettier-plugin-django-alpine": "^1.2.6", - "query-string": "^7.1.1", - "rc-tooltip": "^5.2.2", - "react-appzi": "^1.0.4", - "react-share": "^4.4.0", - "rimraf": "^3.0.2", - "stylelint": "^15.2.0", - "stylelint-config-standard-scss": "^7.0.1", - "swc-loader": "^0.2.3", - "tiny-invariant": "^1.3.1", - "ts-node": "^10.9.1", - "type-fest": "^4.8.1", - "typescript": "^5.1.6", - "url-assembler": "^2.1.1" + "prettier-plugin-sh": "^0.14.0" } }