/* tslint:disable */ /* eslint-disable */ /** * EMIL AccountService * The EMIL AccountService API description * * The version of the OpenAPI document: 1.0 * Contact: kontakt@emil.de * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // 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'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { CreateAccountRequestDto } from '../models'; // @ts-ignore import { CreateAccountResponseClass } from '../models'; // @ts-ignore import { GetAccountResponseClass } from '../models'; // @ts-ignore import { ListAccountsResponseClass } from '../models'; // @ts-ignore import { UpdateAccountRequestDto } from '../models'; // @ts-ignore import { UpdateAccountResponseClass } from '../models'; /** * AccountsApi - axios parameter creator * @export */ export const AccountsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information. **Required Permissions** \"partner-management.partners.create\" * @summary Create the account * @param {CreateAccountRequestDto} createAccountRequestDto * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAccount: async (createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createAccountRequestDto' is not null or undefined assertParamExists('createAccount', 'createAccountRequestDto', createAccountRequestDto) const localVarPath = `/accountservice/v1/accounts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createAccountRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it. **Required Permissions** \"partner-management.partners.delete\" * @summary Delete the account * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAccount: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('deleteAccount', 'code', code) const localVarPath = `/accountservice/v1/accounts/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {'policies'} [expand] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccount: async (code: string, authorization?: string, expand?: 'policies', options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('getAccount', 'code', code) const localVarPath = `/accountservice/v1/accounts/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (expand !== undefined) { localVarQueryParameter['expand'] = expand; } if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieves the details of the account that was previously created. Supply the email that was returned when you created it and Emil Api will return the corresponding account information. Email matching is case-insensitive. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {string} email * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {'policies'} [expand] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountByEmail: async (email: string, authorization?: string, expand?: 'policies', options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'email' is not null or undefined assertParamExists('getAccountByEmail', 'email', email) const localVarPath = `/accountservice/v1/accounts/by-email/{email}` .replace(`{${"email"}}`, encodeURIComponent(String(email))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (expand !== undefined) { localVarQueryParameter['expand'] = expand; } if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"partner-management.partners.view\" * @summary List accounts * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @param {'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode'} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result. * @param {'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber'} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @param {'policies'} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAccounts: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode', search?: string, order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber', expand?: 'policies', filters?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/accountservice/v1/accounts`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (pageToken !== undefined) { localVarQueryParameter['pageToken'] = pageToken; } if (filter !== undefined) { localVarQueryParameter['filter'] = filter; } if (search !== undefined) { localVarQueryParameter['search'] = search; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (expand !== undefined) { localVarQueryParameter['expand'] = expand; } if (filters !== undefined) { localVarQueryParameter['filters'] = filters; } if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\" * @summary Update the account * @param {string} code Unique identifier for the object. * @param {UpdateAccountRequestDto} updateAccountRequestDto * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAccount: async (code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('updateAccount', 'code', code) // verify required parameter 'updateAccountRequestDto' is not null or undefined assertParamExists('updateAccount', 'updateAccountRequestDto', updateAccountRequestDto) const localVarPath = `/accountservice/v1/accounts/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateAccountRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AccountsApi - functional programming interface * @export */ export const AccountsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AccountsApiAxiosParamCreator(configuration) return { /** * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information. **Required Permissions** \"partner-management.partners.create\" * @summary Create the account * @param {CreateAccountRequestDto} createAccountRequestDto * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createAccount(createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createAccount(createAccountRequestDto, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it. **Required Permissions** \"partner-management.partners.delete\" * @summary Delete the account * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteAccount(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAccount(code, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {'policies'} [expand] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAccount(code: string, authorization?: string, expand?: 'policies', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAccount(code, authorization, expand, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Retrieves the details of the account that was previously created. Supply the email that was returned when you created it and Emil Api will return the corresponding account information. Email matching is case-insensitive. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {string} email * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {'policies'} [expand] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAccountByEmail(email: string, authorization?: string, expand?: 'policies', options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountByEmail(email, authorization, expand, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"partner-management.partners.view\" * @summary List accounts * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @param {'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode'} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result. * @param {'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber'} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @param {'policies'} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode', search?: string, order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber', expand?: 'policies', filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\" * @summary Update the account * @param {string} code Unique identifier for the object. * @param {UpdateAccountRequestDto} updateAccountRequestDto * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateAccount(code, updateAccountRequestDto, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * AccountsApi - factory interface * @export */ export const AccountsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AccountsApiFp(configuration) return { /** * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information. **Required Permissions** \"partner-management.partners.create\" * @summary Create the account * @param {CreateAccountRequestDto} createAccountRequestDto * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAccount(createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options?: any): AxiosPromise { return localVarFp.createAccount(createAccountRequestDto, authorization, options).then((request) => request(axios, basePath)); }, /** * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it. **Required Permissions** \"partner-management.partners.delete\" * @summary Delete the account * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAccount(code: string, authorization?: string, options?: any): AxiosPromise { return localVarFp.deleteAccount(code, authorization, options).then((request) => request(axios, basePath)); }, /** * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {'policies'} [expand] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccount(code: string, authorization?: string, expand?: 'policies', options?: any): AxiosPromise { return localVarFp.getAccount(code, authorization, expand, options).then((request) => request(axios, basePath)); }, /** * Retrieves the details of the account that was previously created. Supply the email that was returned when you created it and Emil Api will return the corresponding account information. Email matching is case-insensitive. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {string} email * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {'policies'} [expand] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountByEmail(email: string, authorization?: string, expand?: 'policies', options?: any): AxiosPromise { return localVarFp.getAccountByEmail(email, authorization, expand, options).then((request) => request(axios, basePath)); }, /** * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"partner-management.partners.view\" * @summary List accounts * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @param {'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode'} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result. * @param {'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber'} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @param {'policies'} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode', search?: string, order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber', expand?: 'policies', filters?: string, options?: any): AxiosPromise { return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath)); }, /** * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\" * @summary Update the account * @param {string} code Unique identifier for the object. * @param {UpdateAccountRequestDto} updateAccountRequestDto * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: any): AxiosPromise { return localVarFp.updateAccount(code, updateAccountRequestDto, authorization, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createAccount operation in AccountsApi. * @export * @interface AccountsApiCreateAccountRequest */ export interface AccountsApiCreateAccountRequest { /** * * @type {CreateAccountRequestDto} * @memberof AccountsApiCreateAccount */ readonly createAccountRequestDto: CreateAccountRequestDto /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof AccountsApiCreateAccount */ readonly authorization?: string } /** * Request parameters for deleteAccount operation in AccountsApi. * @export * @interface AccountsApiDeleteAccountRequest */ export interface AccountsApiDeleteAccountRequest { /** * Unique identifier for the object. * @type {string} * @memberof AccountsApiDeleteAccount */ readonly code: string /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof AccountsApiDeleteAccount */ readonly authorization?: string } /** * Request parameters for getAccount operation in AccountsApi. * @export * @interface AccountsApiGetAccountRequest */ export interface AccountsApiGetAccountRequest { /** * Unique identifier for the object. * @type {string} * @memberof AccountsApiGetAccount */ readonly code: string /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof AccountsApiGetAccount */ readonly authorization?: string /** * * @type {'policies'} * @memberof AccountsApiGetAccount */ readonly expand?: 'policies' } /** * Request parameters for getAccountByEmail operation in AccountsApi. * @export * @interface AccountsApiGetAccountByEmailRequest */ export interface AccountsApiGetAccountByEmailRequest { /** * * @type {string} * @memberof AccountsApiGetAccountByEmail */ readonly email: string /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof AccountsApiGetAccountByEmail */ readonly authorization?: string /** * * @type {'policies'} * @memberof AccountsApiGetAccountByEmail */ readonly expand?: 'policies' } /** * Request parameters for listAccounts operation in AccountsApi. * @export * @interface AccountsApiListAccountsRequest */ export interface AccountsApiListAccountsRequest { /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof AccountsApiListAccounts */ readonly authorization?: string /** * A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10. * @type {number} * @memberof AccountsApiListAccounts */ readonly pageSize?: number /** * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list. * @type {string} * @memberof AccountsApiListAccounts */ readonly pageToken?: string /** * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. * @type {'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode'} * @memberof AccountsApiListAccounts */ readonly filter?: 'firstName' | 'code' | 'email' | 'createdAt' | 'birthDate' | 'accountNumber' | 'title' | 'lastName' | 'gender' | 'street' | 'houseNumber' | 'zipCode' | 'city' | 'phone' | 'type' | 'companyName' | 'name' | 'partnerCode' /** * To search the list by any field, pass search=xxx to fetch the result. * @type {string} * @memberof AccountsApiListAccounts */ readonly search?: string /** * The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. * @type {'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber'} * @memberof AccountsApiListAccounts */ readonly order?: 'id' | 'firstName' | 'lastName' | 'email' | 'createdAt' | 'accountNumber' /** * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. * @type {'policies'} * @memberof AccountsApiListAccounts */ readonly expand?: 'policies' /** * Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations. In general, fetching filtered responses conserves bandwidth and reduces response time. * @type {string} * @memberof AccountsApiListAccounts */ readonly filters?: string } /** * Request parameters for updateAccount operation in AccountsApi. * @export * @interface AccountsApiUpdateAccountRequest */ export interface AccountsApiUpdateAccountRequest { /** * Unique identifier for the object. * @type {string} * @memberof AccountsApiUpdateAccount */ readonly code: string /** * * @type {UpdateAccountRequestDto} * @memberof AccountsApiUpdateAccount */ readonly updateAccountRequestDto: UpdateAccountRequestDto /** * Bearer Token: provided by the login endpoint under the name accessToken. * @type {string} * @memberof AccountsApiUpdateAccount */ readonly authorization?: string } /** * AccountsApi - object-oriented interface * @export * @class AccountsApi * @extends {BaseAPI} */ export class AccountsApi extends BaseAPI { /** * This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information. **Required Permissions** \"partner-management.partners.create\" * @summary Create the account * @param {AccountsApiCreateAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ public createAccount(requestParameters: AccountsApiCreateAccountRequest, options?: AxiosRequestConfig) { return AccountsApiFp(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it. **Required Permissions** \"partner-management.partners.delete\" * @summary Delete the account * @param {AccountsApiDeleteAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ public deleteAccount(requestParameters: AccountsApiDeleteAccountRequest, options?: AxiosRequestConfig) { return AccountsApiFp(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {AccountsApiGetAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ public getAccount(requestParameters: AccountsApiGetAccountRequest, options?: AxiosRequestConfig) { return AccountsApiFp(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieves the details of the account that was previously created. Supply the email that was returned when you created it and Emil Api will return the corresponding account information. Email matching is case-insensitive. **Required Permissions** \"partner-management.partners.view\" * @summary Retrieve the account * @param {AccountsApiGetAccountByEmailRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ public getAccountByEmail(requestParameters: AccountsApiGetAccountByEmailRequest, options?: AxiosRequestConfig) { return AccountsApiFp(this.configuration).getAccountByEmail(requestParameters.email, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"partner-management.partners.view\" * @summary List accounts * @param {AccountsApiListAccountsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ public listAccounts(requestParameters: AccountsApiListAccountsRequest = {}, options?: AxiosRequestConfig) { return AccountsApiFp(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath)); } /** * Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\" * @summary Update the account * @param {AccountsApiUpdateAccountRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApi */ public updateAccount(requestParameters: AccountsApiUpdateAccountRequest, options?: AxiosRequestConfig) { return AccountsApiFp(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } }