@equisoft/equisoft-connect-sdk-typescript 13.6.1-snapshot.20240604202446 → 13.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,6 +46,7 @@ src/models/ContextUser.ts
46
46
  src/models/ContextUserContext.ts
47
47
  src/models/CredentialDto.ts
48
48
  src/models/CredentialsResponse.ts
49
+ src/models/DatabaseSetDistributorPayload.ts
49
50
  src/models/DatabaseState.ts
50
51
  src/models/DatabaseUpdateStatePayload.ts
51
52
  src/models/DatabasesDatabase.ts
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DatabaseUpdateStatePayload, DatabasesDatabase, DatabasesListDatabasesResponse, UsersListUsersResponse, UsersUpdateUserPayload, UsersUser } from '../models/index';
13
+ import type { DatabaseSetDistributorPayload, DatabaseUpdateStatePayload, DatabasesDatabase, DatabasesListDatabasesResponse, UsersListUsersResponse, UsersUpdateUserPayload, UsersUser } from '../models/index';
14
14
  export interface GetDatabaseRequest {
15
15
  databaseUuid: string;
16
16
  }
@@ -25,6 +25,13 @@ export interface ListDatabasesRequest {
25
25
  export interface ListUsersRequest {
26
26
  databaseUuid: string;
27
27
  }
28
+ export interface SetDatabaseDistributorRequest {
29
+ databaseUuid: string;
30
+ databaseSetDistributorPayload: DatabaseSetDistributorPayload;
31
+ }
32
+ export interface UnsetDatabaseDistributorRequest {
33
+ databaseUuid: string;
34
+ }
28
35
  export interface UpdateStateRequest {
29
36
  databaseUuid: string;
30
37
  databaseUpdateStatePayload: DatabaseUpdateStatePayload;
@@ -70,6 +77,22 @@ export declare class DatabasesApi extends runtime.BaseAPI {
70
77
  * List database\'s users
71
78
  */
72
79
  listUsers(requestParameters: ListUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersListUsersResponse>;
80
+ /**
81
+ * Set the database\'s distributor
82
+ */
83
+ setDatabaseDistributorRaw(requestParameters: SetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
84
+ /**
85
+ * Set the database\'s distributor
86
+ */
87
+ setDatabaseDistributor(requestParameters: SetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
88
+ /**
89
+ * Unset the database\'s distributor
90
+ */
91
+ unsetDatabaseDistributorRaw(requestParameters: UnsetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
92
+ /**
93
+ * Unset the database\'s distributor
94
+ */
95
+ unsetDatabaseDistributor(requestParameters: UnsetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
73
96
  /**
74
97
  * Update a database\'s state
75
98
  */
@@ -179,6 +179,81 @@ class DatabasesApi extends runtime.BaseAPI {
179
179
  return yield response.value();
180
180
  });
181
181
  }
182
+ /**
183
+ * Set the database\'s distributor
184
+ */
185
+ setDatabaseDistributorRaw(requestParameters, initOverrides) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ if (requestParameters.databaseUuid === null || requestParameters.databaseUuid === undefined) {
188
+ throw new runtime.RequiredError('databaseUuid', 'Required parameter requestParameters.databaseUuid was null or undefined when calling setDatabaseDistributor.');
189
+ }
190
+ if (requestParameters.databaseSetDistributorPayload === null || requestParameters.databaseSetDistributorPayload === undefined) {
191
+ throw new runtime.RequiredError('databaseSetDistributorPayload', 'Required parameter requestParameters.databaseSetDistributorPayload was null or undefined when calling setDatabaseDistributor.');
192
+ }
193
+ const queryParameters = {};
194
+ const headerParameters = {};
195
+ headerParameters['Content-Type'] = 'application/json';
196
+ if (this.configuration && this.configuration.accessToken) {
197
+ // oauth required
198
+ const token = this.configuration.accessToken;
199
+ const tokenString = yield token("OAuth2", ["crm:database"]);
200
+ if (tokenString) {
201
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
202
+ }
203
+ }
204
+ const response = yield this.request({
205
+ path: `/crm/api/v1/databases/{databaseUuid}/distributor`.replace(`{${"databaseUuid"}}`, encodeURIComponent(String(requestParameters.databaseUuid))),
206
+ method: 'PUT',
207
+ headers: headerParameters,
208
+ query: queryParameters,
209
+ body: (0, index_1.DatabaseSetDistributorPayloadToJSON)(requestParameters.databaseSetDistributorPayload),
210
+ }, initOverrides);
211
+ return new runtime.VoidApiResponse(response);
212
+ });
213
+ }
214
+ /**
215
+ * Set the database\'s distributor
216
+ */
217
+ setDatabaseDistributor(requestParameters, initOverrides) {
218
+ return __awaiter(this, void 0, void 0, function* () {
219
+ yield this.setDatabaseDistributorRaw(requestParameters, initOverrides);
220
+ });
221
+ }
222
+ /**
223
+ * Unset the database\'s distributor
224
+ */
225
+ unsetDatabaseDistributorRaw(requestParameters, initOverrides) {
226
+ return __awaiter(this, void 0, void 0, function* () {
227
+ if (requestParameters.databaseUuid === null || requestParameters.databaseUuid === undefined) {
228
+ throw new runtime.RequiredError('databaseUuid', 'Required parameter requestParameters.databaseUuid was null or undefined when calling unsetDatabaseDistributor.');
229
+ }
230
+ const queryParameters = {};
231
+ const headerParameters = {};
232
+ if (this.configuration && this.configuration.accessToken) {
233
+ // oauth required
234
+ const token = this.configuration.accessToken;
235
+ const tokenString = yield token("OAuth2", ["crm:database"]);
236
+ if (tokenString) {
237
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
238
+ }
239
+ }
240
+ const response = yield this.request({
241
+ path: `/crm/api/v1/databases/{databaseUuid}/distributor`.replace(`{${"databaseUuid"}}`, encodeURIComponent(String(requestParameters.databaseUuid))),
242
+ method: 'DELETE',
243
+ headers: headerParameters,
244
+ query: queryParameters,
245
+ }, initOverrides);
246
+ return new runtime.VoidApiResponse(response);
247
+ });
248
+ }
249
+ /**
250
+ * Unset the database\'s distributor
251
+ */
252
+ unsetDatabaseDistributor(requestParameters, initOverrides) {
253
+ return __awaiter(this, void 0, void 0, function* () {
254
+ yield this.unsetDatabaseDistributorRaw(requestParameters, initOverrides);
255
+ });
256
+ }
182
257
  /**
183
258
  * Update a database\'s state
184
259
  */
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DatabaseUpdateStatePayload, DatabasesDatabase, DatabasesListDatabasesResponse, UsersListUsersResponse, UsersUpdateUserPayload, UsersUser } from '../models/index';
13
+ import type { DatabaseSetDistributorPayload, DatabaseUpdateStatePayload, DatabasesDatabase, DatabasesListDatabasesResponse, UsersListUsersResponse, UsersUpdateUserPayload, UsersUser } from '../models/index';
14
14
  export interface GetDatabaseRequest {
15
15
  databaseUuid: string;
16
16
  }
@@ -25,6 +25,13 @@ export interface ListDatabasesRequest {
25
25
  export interface ListUsersRequest {
26
26
  databaseUuid: string;
27
27
  }
28
+ export interface SetDatabaseDistributorRequest {
29
+ databaseUuid: string;
30
+ databaseSetDistributorPayload: DatabaseSetDistributorPayload;
31
+ }
32
+ export interface UnsetDatabaseDistributorRequest {
33
+ databaseUuid: string;
34
+ }
28
35
  export interface UpdateStateRequest {
29
36
  databaseUuid: string;
30
37
  databaseUpdateStatePayload: DatabaseUpdateStatePayload;
@@ -70,6 +77,22 @@ export declare class DatabasesApi extends runtime.BaseAPI {
70
77
  * List database\'s users
71
78
  */
72
79
  listUsers(requestParameters: ListUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersListUsersResponse>;
80
+ /**
81
+ * Set the database\'s distributor
82
+ */
83
+ setDatabaseDistributorRaw(requestParameters: SetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
84
+ /**
85
+ * Set the database\'s distributor
86
+ */
87
+ setDatabaseDistributor(requestParameters: SetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
88
+ /**
89
+ * Unset the database\'s distributor
90
+ */
91
+ unsetDatabaseDistributorRaw(requestParameters: UnsetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
92
+ /**
93
+ * Unset the database\'s distributor
94
+ */
95
+ unsetDatabaseDistributor(requestParameters: UnsetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
73
96
  /**
74
97
  * Update a database\'s state
75
98
  */
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { DatabaseUpdateStatePayloadToJSON, DatabasesDatabaseFromJSON, DatabasesListDatabasesResponseFromJSON, UsersListUsersResponseFromJSON, UsersUpdateUserPayloadToJSON, UsersUserFromJSON, } from '../models/index';
24
+ import { DatabaseSetDistributorPayloadToJSON, DatabaseUpdateStatePayloadToJSON, DatabasesDatabaseFromJSON, DatabasesListDatabasesResponseFromJSON, UsersListUsersResponseFromJSON, UsersUpdateUserPayloadToJSON, UsersUserFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -176,6 +176,81 @@ export class DatabasesApi extends runtime.BaseAPI {
176
176
  return yield response.value();
177
177
  });
178
178
  }
179
+ /**
180
+ * Set the database\'s distributor
181
+ */
182
+ setDatabaseDistributorRaw(requestParameters, initOverrides) {
183
+ return __awaiter(this, void 0, void 0, function* () {
184
+ if (requestParameters.databaseUuid === null || requestParameters.databaseUuid === undefined) {
185
+ throw new runtime.RequiredError('databaseUuid', 'Required parameter requestParameters.databaseUuid was null or undefined when calling setDatabaseDistributor.');
186
+ }
187
+ if (requestParameters.databaseSetDistributorPayload === null || requestParameters.databaseSetDistributorPayload === undefined) {
188
+ throw new runtime.RequiredError('databaseSetDistributorPayload', 'Required parameter requestParameters.databaseSetDistributorPayload was null or undefined when calling setDatabaseDistributor.');
189
+ }
190
+ const queryParameters = {};
191
+ const headerParameters = {};
192
+ headerParameters['Content-Type'] = 'application/json';
193
+ if (this.configuration && this.configuration.accessToken) {
194
+ // oauth required
195
+ const token = this.configuration.accessToken;
196
+ const tokenString = yield token("OAuth2", ["crm:database"]);
197
+ if (tokenString) {
198
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
199
+ }
200
+ }
201
+ const response = yield this.request({
202
+ path: `/crm/api/v1/databases/{databaseUuid}/distributor`.replace(`{${"databaseUuid"}}`, encodeURIComponent(String(requestParameters.databaseUuid))),
203
+ method: 'PUT',
204
+ headers: headerParameters,
205
+ query: queryParameters,
206
+ body: DatabaseSetDistributorPayloadToJSON(requestParameters.databaseSetDistributorPayload),
207
+ }, initOverrides);
208
+ return new runtime.VoidApiResponse(response);
209
+ });
210
+ }
211
+ /**
212
+ * Set the database\'s distributor
213
+ */
214
+ setDatabaseDistributor(requestParameters, initOverrides) {
215
+ return __awaiter(this, void 0, void 0, function* () {
216
+ yield this.setDatabaseDistributorRaw(requestParameters, initOverrides);
217
+ });
218
+ }
219
+ /**
220
+ * Unset the database\'s distributor
221
+ */
222
+ unsetDatabaseDistributorRaw(requestParameters, initOverrides) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ if (requestParameters.databaseUuid === null || requestParameters.databaseUuid === undefined) {
225
+ throw new runtime.RequiredError('databaseUuid', 'Required parameter requestParameters.databaseUuid was null or undefined when calling unsetDatabaseDistributor.');
226
+ }
227
+ const queryParameters = {};
228
+ const headerParameters = {};
229
+ if (this.configuration && this.configuration.accessToken) {
230
+ // oauth required
231
+ const token = this.configuration.accessToken;
232
+ const tokenString = yield token("OAuth2", ["crm:database"]);
233
+ if (tokenString) {
234
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
235
+ }
236
+ }
237
+ const response = yield this.request({
238
+ path: `/crm/api/v1/databases/{databaseUuid}/distributor`.replace(`{${"databaseUuid"}}`, encodeURIComponent(String(requestParameters.databaseUuid))),
239
+ method: 'DELETE',
240
+ headers: headerParameters,
241
+ query: queryParameters,
242
+ }, initOverrides);
243
+ return new runtime.VoidApiResponse(response);
244
+ });
245
+ }
246
+ /**
247
+ * Unset the database\'s distributor
248
+ */
249
+ unsetDatabaseDistributor(requestParameters, initOverrides) {
250
+ return __awaiter(this, void 0, void 0, function* () {
251
+ yield this.unsetDatabaseDistributorRaw(requestParameters, initOverrides);
252
+ });
253
+ }
179
254
  /**
180
255
  * Update a database\'s state
181
256
  */
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Equisoft /connect API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface DatabaseSetDistributorPayload
16
+ */
17
+ export interface DatabaseSetDistributorPayload {
18
+ /**
19
+ * Distributor code
20
+ * @type {string}
21
+ * @memberof DatabaseSetDistributorPayload
22
+ */
23
+ distributorCode: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the DatabaseSetDistributorPayload interface.
27
+ */
28
+ export declare function instanceOfDatabaseSetDistributorPayload(value: object): boolean;
29
+ export declare function DatabaseSetDistributorPayloadFromJSON(json: any): DatabaseSetDistributorPayload;
30
+ export declare function DatabaseSetDistributorPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatabaseSetDistributorPayload;
31
+ export declare function DatabaseSetDistributorPayloadToJSON(value?: DatabaseSetDistributorPayload | null): any;
@@ -0,0 +1,43 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Equisoft /connect API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: latest
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the DatabaseSetDistributorPayload interface.
16
+ */
17
+ export function instanceOfDatabaseSetDistributorPayload(value) {
18
+ let isInstance = true;
19
+ isInstance = isInstance && "distributorCode" in value;
20
+ return isInstance;
21
+ }
22
+ export function DatabaseSetDistributorPayloadFromJSON(json) {
23
+ return DatabaseSetDistributorPayloadFromJSONTyped(json, false);
24
+ }
25
+ export function DatabaseSetDistributorPayloadFromJSONTyped(json, ignoreDiscriminator) {
26
+ if ((json === undefined) || (json === null)) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'distributorCode': json['distributorCode'],
31
+ };
32
+ }
33
+ export function DatabaseSetDistributorPayloadToJSON(value) {
34
+ if (value === undefined) {
35
+ return undefined;
36
+ }
37
+ if (value === null) {
38
+ return null;
39
+ }
40
+ return {
41
+ 'distributorCode': value.distributorCode,
42
+ };
43
+ }
@@ -25,6 +25,7 @@ export * from './ContextUser';
25
25
  export * from './ContextUserContext';
26
26
  export * from './CredentialDto';
27
27
  export * from './CredentialsResponse';
28
+ export * from './DatabaseSetDistributorPayload';
28
29
  export * from './DatabaseState';
29
30
  export * from './DatabaseUpdateStatePayload';
30
31
  export * from './DatabasesDatabase';
@@ -27,6 +27,7 @@ export * from './ContextUser';
27
27
  export * from './ContextUserContext';
28
28
  export * from './CredentialDto';
29
29
  export * from './CredentialsResponse';
30
+ export * from './DatabaseSetDistributorPayload';
30
31
  export * from './DatabaseState';
31
32
  export * from './DatabaseUpdateStatePayload';
32
33
  export * from './DatabasesDatabase';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Equisoft /connect API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface DatabaseSetDistributorPayload
16
+ */
17
+ export interface DatabaseSetDistributorPayload {
18
+ /**
19
+ * Distributor code
20
+ * @type {string}
21
+ * @memberof DatabaseSetDistributorPayload
22
+ */
23
+ distributorCode: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the DatabaseSetDistributorPayload interface.
27
+ */
28
+ export declare function instanceOfDatabaseSetDistributorPayload(value: object): boolean;
29
+ export declare function DatabaseSetDistributorPayloadFromJSON(json: any): DatabaseSetDistributorPayload;
30
+ export declare function DatabaseSetDistributorPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatabaseSetDistributorPayload;
31
+ export declare function DatabaseSetDistributorPayloadToJSON(value?: DatabaseSetDistributorPayload | null): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Equisoft /connect API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: latest
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.DatabaseSetDistributorPayloadToJSON = exports.DatabaseSetDistributorPayloadFromJSONTyped = exports.DatabaseSetDistributorPayloadFromJSON = exports.instanceOfDatabaseSetDistributorPayload = void 0;
17
+ /**
18
+ * Check if a given object implements the DatabaseSetDistributorPayload interface.
19
+ */
20
+ function instanceOfDatabaseSetDistributorPayload(value) {
21
+ let isInstance = true;
22
+ isInstance = isInstance && "distributorCode" in value;
23
+ return isInstance;
24
+ }
25
+ exports.instanceOfDatabaseSetDistributorPayload = instanceOfDatabaseSetDistributorPayload;
26
+ function DatabaseSetDistributorPayloadFromJSON(json) {
27
+ return DatabaseSetDistributorPayloadFromJSONTyped(json, false);
28
+ }
29
+ exports.DatabaseSetDistributorPayloadFromJSON = DatabaseSetDistributorPayloadFromJSON;
30
+ function DatabaseSetDistributorPayloadFromJSONTyped(json, ignoreDiscriminator) {
31
+ if ((json === undefined) || (json === null)) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'distributorCode': json['distributorCode'],
36
+ };
37
+ }
38
+ exports.DatabaseSetDistributorPayloadFromJSONTyped = DatabaseSetDistributorPayloadFromJSONTyped;
39
+ function DatabaseSetDistributorPayloadToJSON(value) {
40
+ if (value === undefined) {
41
+ return undefined;
42
+ }
43
+ if (value === null) {
44
+ return null;
45
+ }
46
+ return {
47
+ 'distributorCode': value.distributorCode,
48
+ };
49
+ }
50
+ exports.DatabaseSetDistributorPayloadToJSON = DatabaseSetDistributorPayloadToJSON;
@@ -25,6 +25,7 @@ export * from './ContextUser';
25
25
  export * from './ContextUserContext';
26
26
  export * from './CredentialDto';
27
27
  export * from './CredentialsResponse';
28
+ export * from './DatabaseSetDistributorPayload';
28
29
  export * from './DatabaseState';
29
30
  export * from './DatabaseUpdateStatePayload';
30
31
  export * from './DatabasesDatabase';
@@ -43,6 +43,7 @@ __exportStar(require("./ContextUser"), exports);
43
43
  __exportStar(require("./ContextUserContext"), exports);
44
44
  __exportStar(require("./CredentialDto"), exports);
45
45
  __exportStar(require("./CredentialsResponse"), exports);
46
+ __exportStar(require("./DatabaseSetDistributorPayload"), exports);
46
47
  __exportStar(require("./DatabaseState"), exports);
47
48
  __exportStar(require("./DatabaseUpdateStatePayload"), exports);
48
49
  __exportStar(require("./DatabasesDatabase"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equisoft/equisoft-connect-sdk-typescript",
3
- "version": "13.6.1-snapshot.20240604202446",
3
+ "version": "13.7.0",
4
4
  "description": "OpenAPI client for @equisoft/equisoft-connect-sdk-typescript",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -15,6 +15,7 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ DatabaseSetDistributorPayload,
18
19
  DatabaseUpdateStatePayload,
19
20
  DatabasesDatabase,
20
21
  DatabasesListDatabasesResponse,
@@ -24,6 +25,8 @@ import type {
24
25
  UsersUser,
25
26
  } from '../models/index';
26
27
  import {
28
+ DatabaseSetDistributorPayloadFromJSON,
29
+ DatabaseSetDistributorPayloadToJSON,
27
30
  DatabaseUpdateStatePayloadFromJSON,
28
31
  DatabaseUpdateStatePayloadToJSON,
29
32
  DatabasesDatabaseFromJSON,
@@ -58,6 +61,15 @@ export interface ListUsersRequest {
58
61
  databaseUuid: string;
59
62
  }
60
63
 
64
+ export interface SetDatabaseDistributorRequest {
65
+ databaseUuid: string;
66
+ databaseSetDistributorPayload: DatabaseSetDistributorPayload;
67
+ }
68
+
69
+ export interface UnsetDatabaseDistributorRequest {
70
+ databaseUuid: string;
71
+ }
72
+
61
73
  export interface UpdateStateRequest {
62
74
  databaseUuid: string;
63
75
  databaseUpdateStatePayload: DatabaseUpdateStatePayload;
@@ -238,6 +250,89 @@ export class DatabasesApi extends runtime.BaseAPI {
238
250
  return await response.value();
239
251
  }
240
252
 
253
+ /**
254
+ * Set the database\'s distributor
255
+ */
256
+ async setDatabaseDistributorRaw(requestParameters: SetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
257
+ if (requestParameters.databaseUuid === null || requestParameters.databaseUuid === undefined) {
258
+ throw new runtime.RequiredError('databaseUuid','Required parameter requestParameters.databaseUuid was null or undefined when calling setDatabaseDistributor.');
259
+ }
260
+
261
+ if (requestParameters.databaseSetDistributorPayload === null || requestParameters.databaseSetDistributorPayload === undefined) {
262
+ throw new runtime.RequiredError('databaseSetDistributorPayload','Required parameter requestParameters.databaseSetDistributorPayload was null or undefined when calling setDatabaseDistributor.');
263
+ }
264
+
265
+ const queryParameters: any = {};
266
+
267
+ const headerParameters: runtime.HTTPHeaders = {};
268
+
269
+ headerParameters['Content-Type'] = 'application/json';
270
+
271
+ if (this.configuration && this.configuration.accessToken) {
272
+ // oauth required
273
+ const token = this.configuration.accessToken;
274
+ const tokenString = await token("OAuth2", ["crm:database"]);
275
+ if (tokenString) {
276
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
277
+ }
278
+ }
279
+
280
+ const response = await this.request({
281
+ path: `/crm/api/v1/databases/{databaseUuid}/distributor`.replace(`{${"databaseUuid"}}`, encodeURIComponent(String(requestParameters.databaseUuid))),
282
+ method: 'PUT',
283
+ headers: headerParameters,
284
+ query: queryParameters,
285
+ body: DatabaseSetDistributorPayloadToJSON(requestParameters.databaseSetDistributorPayload),
286
+ }, initOverrides);
287
+
288
+ return new runtime.VoidApiResponse(response);
289
+ }
290
+
291
+ /**
292
+ * Set the database\'s distributor
293
+ */
294
+ async setDatabaseDistributor(requestParameters: SetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
295
+ await this.setDatabaseDistributorRaw(requestParameters, initOverrides);
296
+ }
297
+
298
+ /**
299
+ * Unset the database\'s distributor
300
+ */
301
+ async unsetDatabaseDistributorRaw(requestParameters: UnsetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
302
+ if (requestParameters.databaseUuid === null || requestParameters.databaseUuid === undefined) {
303
+ throw new runtime.RequiredError('databaseUuid','Required parameter requestParameters.databaseUuid was null or undefined when calling unsetDatabaseDistributor.');
304
+ }
305
+
306
+ const queryParameters: any = {};
307
+
308
+ const headerParameters: runtime.HTTPHeaders = {};
309
+
310
+ if (this.configuration && this.configuration.accessToken) {
311
+ // oauth required
312
+ const token = this.configuration.accessToken;
313
+ const tokenString = await token("OAuth2", ["crm:database"]);
314
+ if (tokenString) {
315
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
316
+ }
317
+ }
318
+
319
+ const response = await this.request({
320
+ path: `/crm/api/v1/databases/{databaseUuid}/distributor`.replace(`{${"databaseUuid"}}`, encodeURIComponent(String(requestParameters.databaseUuid))),
321
+ method: 'DELETE',
322
+ headers: headerParameters,
323
+ query: queryParameters,
324
+ }, initOverrides);
325
+
326
+ return new runtime.VoidApiResponse(response);
327
+ }
328
+
329
+ /**
330
+ * Unset the database\'s distributor
331
+ */
332
+ async unsetDatabaseDistributor(requestParameters: UnsetDatabaseDistributorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
333
+ await this.unsetDatabaseDistributorRaw(requestParameters, initOverrides);
334
+ }
335
+
241
336
  /**
242
337
  * Update a database\'s state
243
338
  */
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Equisoft /connect API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: latest
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface DatabaseSetDistributorPayload
20
+ */
21
+ export interface DatabaseSetDistributorPayload {
22
+ /**
23
+ * Distributor code
24
+ * @type {string}
25
+ * @memberof DatabaseSetDistributorPayload
26
+ */
27
+ distributorCode: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the DatabaseSetDistributorPayload interface.
32
+ */
33
+ export function instanceOfDatabaseSetDistributorPayload(value: object): boolean {
34
+ let isInstance = true;
35
+ isInstance = isInstance && "distributorCode" in value;
36
+
37
+ return isInstance;
38
+ }
39
+
40
+ export function DatabaseSetDistributorPayloadFromJSON(json: any): DatabaseSetDistributorPayload {
41
+ return DatabaseSetDistributorPayloadFromJSONTyped(json, false);
42
+ }
43
+
44
+ export function DatabaseSetDistributorPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatabaseSetDistributorPayload {
45
+ if ((json === undefined) || (json === null)) {
46
+ return json;
47
+ }
48
+ return {
49
+
50
+ 'distributorCode': json['distributorCode'],
51
+ };
52
+ }
53
+
54
+ export function DatabaseSetDistributorPayloadToJSON(value?: DatabaseSetDistributorPayload | null): any {
55
+ if (value === undefined) {
56
+ return undefined;
57
+ }
58
+ if (value === null) {
59
+ return null;
60
+ }
61
+ return {
62
+
63
+ 'distributorCode': value.distributorCode,
64
+ };
65
+ }
66
+
@@ -27,6 +27,7 @@ export * from './ContextUser';
27
27
  export * from './ContextUserContext';
28
28
  export * from './CredentialDto';
29
29
  export * from './CredentialsResponse';
30
+ export * from './DatabaseSetDistributorPayload';
30
31
  export * from './DatabaseState';
31
32
  export * from './DatabaseUpdateStatePayload';
32
33
  export * from './DatabasesDatabase';