@superoffice/webapi 11.7.727 → 11.8.788

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.
Files changed (147) hide show
  1. package/LICENSE.md +15 -15
  2. package/README.md +184 -184
  3. package/__tests__/Appointment63-notz.json +1925 -1925
  4. package/__tests__/Appointment63-utctz.json +1925 -1925
  5. package/__tests__/Appointment63.json +1925 -1925
  6. package/__tests__/AppointmentTzTest.ts +115 -115
  7. package/__tests__/AxiosNockTest.ts +28 -28
  8. package/__tests__/ContactDefault.json +699 -699
  9. package/__tests__/ContactEntity.json +272 -272
  10. package/__tests__/ContactRestTest.ts +144 -144
  11. package/__tests__/ContactTest.ts +395 -395
  12. package/__tests__/ConvertersTest.ts +97 -97
  13. package/__tests__/DocumentTest.ts +101 -101
  14. package/__tests__/Person210-notz.json +1932 -1932
  15. package/__tests__/Person210-utctz.json +1932 -1932
  16. package/__tests__/Person210.json +1932 -1932
  17. package/__tests__/PersonImageData.nock +22 -22
  18. package/__tests__/PersonTest.ts +41 -41
  19. package/__tests__/PersonTzTest.ts +113 -113
  20. package/__tests__/RecurrenceInfo.json +55 -55
  21. package/__tests__/ResponseCallbackTest.ts +23 -23
  22. package/__tests__/TableRights.json +441 -441
  23. package/__tests__/WebapiTest.ts +264 -264
  24. package/__tests__/Webhook.json +16 -16
  25. package/__tests__/WebhookTest.ts +209 -209
  26. package/dist/cjs/Carriers.d.ts +367 -4
  27. package/dist/cjs/Carriers.d.ts.map +1 -1
  28. package/dist/cjs/Converters.d.ts +9 -0
  29. package/dist/cjs/Converters.d.ts.map +1 -1
  30. package/dist/cjs/Converters.js +185 -17
  31. package/dist/cjs/Converters.js.map +1 -1
  32. package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
  33. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  34. package/dist/cjs/DiagnosticsAgent.js +91 -0
  35. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  36. package/dist/cjs/Enums.d.ts +18 -0
  37. package/dist/cjs/Enums.d.ts.map +1 -1
  38. package/dist/cjs/Enums.js +20 -1
  39. package/dist/cjs/Enums.js.map +1 -1
  40. package/dist/cjs/ListAgent.d.ts +71 -6
  41. package/dist/cjs/ListAgent.d.ts.map +1 -1
  42. package/dist/cjs/ListAgent.js +157 -0
  43. package/dist/cjs/ListAgent.js.map +1 -1
  44. package/dist/cjs/TicketAgent.d.ts +23 -0
  45. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  46. package/dist/cjs/TicketAgent.js +65 -0
  47. package/dist/cjs/TicketAgent.js.map +1 -1
  48. package/dist/esm/Carriers.d.ts +367 -4
  49. package/dist/esm/Carriers.d.ts.map +1 -1
  50. package/dist/esm/Converters.d.ts +9 -0
  51. package/dist/esm/Converters.d.ts.map +1 -1
  52. package/dist/esm/Converters.js +159 -0
  53. package/dist/esm/Converters.js.map +1 -1
  54. package/dist/esm/DiagnosticsAgent.d.ts +38 -0
  55. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  56. package/dist/esm/DiagnosticsAgent.js +91 -0
  57. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  58. package/dist/esm/Enums.d.ts +18 -0
  59. package/dist/esm/Enums.d.ts.map +1 -1
  60. package/dist/esm/Enums.js +19 -0
  61. package/dist/esm/Enums.js.map +1 -1
  62. package/dist/esm/ListAgent.d.ts +71 -6
  63. package/dist/esm/ListAgent.d.ts.map +1 -1
  64. package/dist/esm/ListAgent.js +157 -0
  65. package/dist/esm/ListAgent.js.map +1 -1
  66. package/dist/esm/TicketAgent.d.ts +23 -0
  67. package/dist/esm/TicketAgent.d.ts.map +1 -1
  68. package/dist/esm/TicketAgent.js +65 -0
  69. package/dist/esm/TicketAgent.js.map +1 -1
  70. package/examples-js/hello.js +12 -12
  71. package/examples-ts/hello.ts +8 -8
  72. package/package.json +93 -93
  73. package/scripts/postbuild.js +22 -22
  74. package/scripts/setVersion.js +44 -44
  75. package/src/AIAgent.ts +1992 -1992
  76. package/src/AppointmentAgent.ts +6263 -6263
  77. package/src/AppointmentRestApi.ts +225 -225
  78. package/src/ArchiveAgent.ts +1950 -1950
  79. package/src/AssociateAgent.ts +422 -422
  80. package/src/AxiosCacheHandler.ts +74 -74
  81. package/src/BLOBAgent.ts +2100 -2100
  82. package/src/Base64.ts +285 -285
  83. package/src/BatchAgent.ts +910 -910
  84. package/src/BulkUpdateAgent.ts +504 -504
  85. package/src/CRMScriptAgent.ts +1390 -1390
  86. package/src/Carriers.ts +52750 -52274
  87. package/src/ChatAgent.ts +1422 -1422
  88. package/src/ConfigurationAgent.ts +2228 -2228
  89. package/src/ContactAgent.ts +1756 -1756
  90. package/src/ContactRestApi.ts +237 -237
  91. package/src/Converters.ts +23271 -23090
  92. package/src/CustomerServiceAgent.ts +1799 -1799
  93. package/src/DashAgent.ts +1674 -1674
  94. package/src/DatabaseAgent.ts +120 -120
  95. package/src/DatabaseTableAgent.ts +534 -534
  96. package/src/Day_js.ts +41 -41
  97. package/src/DiagnosticsAgent.ts +1384 -1240
  98. package/src/DocumentAgent.ts +5079 -5079
  99. package/src/DocumentMigrationAgent.ts +524 -524
  100. package/src/DocumentRestApi.ts +259 -259
  101. package/src/EMailAgent.ts +5328 -5328
  102. package/src/Enums.ts +6936 -6916
  103. package/src/ErpSyncAgent.ts +2658 -2658
  104. package/src/FavouriteAgent.ts +720 -720
  105. package/src/FindAgent.ts +2330 -2330
  106. package/src/ForeignSystemAgent.ts +1710 -1710
  107. package/src/FreeTextAgent.ts +372 -372
  108. package/src/ImportAgent.ts +304 -304
  109. package/src/LicenseAgent.ts +1230 -1230
  110. package/src/ListAgent.ts +11451 -11237
  111. package/src/MDOAgent.ts +748 -748
  112. package/src/MarketingAgent.ts +890 -890
  113. package/src/MessagingAgent.ts +384 -384
  114. package/src/NavigatorAgent.ts +140 -140
  115. package/src/NumberAllocationAgent.ts +296 -296
  116. package/src/PersonAgent.ts +3287 -3287
  117. package/src/PersonRestApi.ts +241 -241
  118. package/src/PhoneListAgent.ts +458 -458
  119. package/src/PocketAgent.ts +780 -780
  120. package/src/PreferenceAgent.ts +1900 -1900
  121. package/src/PreviewsAgent.ts +116 -116
  122. package/src/ProjectAgent.ts +2391 -2391
  123. package/src/ProjectRestApi.ts +239 -239
  124. package/src/QuoteAgent.ts +5159 -5159
  125. package/src/RelationAgent.ts +220 -220
  126. package/src/ReportAgent.ts +154 -154
  127. package/src/ResourceAgent.ts +358 -358
  128. package/src/SaintAgent.ts +601 -601
  129. package/src/SaleAgent.ts +2034 -2034
  130. package/src/SaleRestApi.ts +233 -233
  131. package/src/SelectionAgent.ts +3195 -3195
  132. package/src/SentryAgent.ts +462 -462
  133. package/src/SoApiConstants.ts +8 -8
  134. package/src/TargetsAgent.ts +1104 -1104
  135. package/src/TicketAgent.ts +3708 -3638
  136. package/src/TimeZoneAgent.ts +528 -528
  137. package/src/TooltipsAgent.ts +116 -116
  138. package/src/UserAgent.ts +4856 -4856
  139. package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
  140. package/src/ViewStateAgent.ts +858 -858
  141. package/src/WebApi.ts +872 -872
  142. package/src/WebApiBase.ts +565 -565
  143. package/src/WebhookAgent.ts +388 -388
  144. package/src/WorkflowAgent.ts +1338 -1338
  145. package/tsconfig.esm.json +8 -8
  146. package/tsconfig.jest.json +8 -8
  147. package/tsconfig.json +34 -34
@@ -1,225 +1,225 @@
1
- // <auto-generated>
2
- // SuperOffice Code Generator
3
- // modelling\templates\servicestswebapi\tswebapirestentities.tt
4
- // </auto-generated>
5
-
6
-
7
- /* tslint:disable */
8
- //----------------------------------------------------------------------------
9
- // G E N E R A T E D F I L E ! D O N O T E D I T !
10
- //----------------------------------------------------------------------------
11
- //
12
- // File: AppointmentRestApi.ts
13
- //
14
- //----------------------------------------------------------------------------
15
- // Copyright (C) SuperOffice AS
16
- //----------------------------------------------------------------------------
17
-
18
- import { AxiosRequestConfig, AxiosError } from 'axios';
19
- import { Duration } from 'dayjs/plugin/duration';
20
- import * as enums from './Enums';
21
- import * as base from './WebApiBase';
22
- import * as carriers from './Carriers';
23
- import * as converters from './Converters';
24
- import { FromBase64ToString, ToBase64 } from './Base64';
25
-
26
- /**
27
- * Appointments appear in the diary, and have links to a Contact/Person and possibly a Project or Sale. They have start and end time+date.
28
- * Collection of all services that works with Appointment data.
29
- *
30
- * `api/v1/Appointment`
31
- */
32
- export interface IAppointmentRestApi {
33
-
34
- getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.AppointmentEntity >;
35
- postAsync(entity: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity >;
36
- putByIdAsync(id:number, entity: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity >;
37
- patchByIdAsync(id:number, entity: base.WebApiPatchOperation[] | carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity >;
38
- deleteByIdAsync(AppointmentEntityId: number, options?:base.WebApiPutRequestOptions) : Promise<void>;
39
- getByIdAsync(AppointmentEntityId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.AppointmentEntity >;
40
- // POST Validate Async( appointmentEntity ) = validateAppointmentEntity
41
-
42
-
43
- } // interface IAppointmentRestApi
44
-
45
-
46
-
47
-
48
- /**
49
- * Appointments appear in the diary, and have links to a Contact/Person and possibly a Project or Sale. They have start and end time+date.
50
- * Collection of all services that works with Appointment data.
51
- *
52
- * `api/v1/Appointment`
53
- */
54
- export class AppointmentRestApi extends base.WebApiBase implements IAppointmentRestApi {
55
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
56
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
57
- constructor(baseUrl: string, resourceManager:any);
58
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
59
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
60
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
61
- constructor(options: base.WebApiOptions);
62
-
63
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
64
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
65
- langOrResourceOrRM?:string|base.ResourceParsing|any,
66
- cultureCode?: string,
67
- ) {
68
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
69
- options.basePath = "v1/Appointment/";
70
- super(options);
71
- }
72
-
73
-
74
- /**
75
- * `GET /api/v1/Appointment/default`
76
- * Set default values into a new AppointmentEntity.
77
- * NetServer calculates default values on the entity, which is required when creating/storing a new instance
78
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
79
- * @returns A blank entity.
80
- */
81
- public async getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.AppointmentEntity > {
82
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
83
- base.WebApiBase.SetPending(options);
84
- return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
85
- try {
86
- const response = await this._axios.get("default", config);
87
- base.WebApiBase.SetCompleted(options, response);
88
- const res : carriers.AppointmentEntity = converters.Create_AppointmentEntity_From( response.data );
89
- resolve(res);
90
- }
91
- catch( err ) {
92
- base.WebApiBase.HandleError(options, config, err);
93
- reject(err);
94
- }
95
- });
96
- }
97
-
98
-
99
- /**
100
- * `POST /api/v1/Appointment/`
101
- * Creates a new AppointmentEntity
102
- * @param newAppointment - The AppointmentEntity to be saved.
103
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
104
- * @returns New AppointmentEntity
105
- */
106
- public async postAsync(newAppointment: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity > {
107
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
108
- base.WebApiBase.SetPending(options);
109
- return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
110
- try {
111
- const response = await this._axios.post("", newAppointment, config);
112
- base.WebApiBase.SetCompleted(options, response);
113
- const res : carriers.AppointmentEntity = converters.Create_AppointmentEntity_From( response.data );
114
- resolve(res);
115
- }
116
- catch( err ) {
117
- base.WebApiBase.HandleError(options, config, err);
118
- reject(err);
119
- }
120
- });
121
- }
122
-
123
-
124
- /**
125
- * `PUT /api/v1/Appointment/123`
126
- * Replace the existing AppointmentEntity
127
- * @param appointment - The AppointmentEntity to be saved.
128
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
129
- * @returns The updated AppointmentEntity
130
- */
131
- public async putByIdAsync(id:number, appointment: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity > {
132
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
133
- base.WebApiBase.SetPending(options);
134
- return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
135
- try {
136
- const response = await this._axios.put(id.toString(), appointment, config);
137
- base.WebApiBase.SetCompleted(options, response);
138
- let res : carriers.AppointmentEntity = null;
139
- if( response.status != 304 )
140
- res = converters.Create_AppointmentEntity_From( response.data );
141
- resolve(res);
142
- }
143
- catch( err ) {
144
- base.WebApiBase.HandleError(options, config, err);
145
- reject(err);
146
- }
147
- });
148
- }
149
-
150
- /**
151
- * `PATCH /api/v1/Appointment/123`
152
- * Updates an existing AppointmentEntity
153
- * @param appointment - The partial AppointmentEntity containing updated values, or an array of RFC6902 PATCH operations.
154
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
155
- * @returns The updated AppointmentEntity
156
- */
157
- public async patchByIdAsync(id:number, appointment: base.WebApiPatchOperation[] | carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity > {
158
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
159
- base.WebApiBase.SetPending(options);
160
- return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
161
- try {
162
- const response = await this._axios.patch(id.toString(), appointment, config);
163
- base.WebApiBase.SetCompleted(options, response);
164
- let res : carriers.AppointmentEntity = null;
165
- if( response.status != 304 )
166
- res = converters.Create_AppointmentEntity_From( response.data );
167
- resolve(res);
168
- }
169
- catch( err ) {
170
- base.WebApiBase.HandleError(options, config, err);
171
- reject(err);
172
- }
173
- });
174
- }
175
- /**
176
- * `DELETE /api/v1/Appointment/123`
177
- * Deletes the AppointmentEntity
178
- * @param appointmentId - The id of the AppointmentEntity to be deleted.
179
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
180
- */
181
- public async deleteByIdAsync(appointmentId: number, options?:base.WebApiPutRequestOptions) : Promise<void> {
182
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
183
- base.WebApiBase.SetPending(options);
184
- return new Promise< void >(async (resolve, reject) => {
185
- try {
186
- const response = await this._axios.delete( appointmentId.toString(), config );
187
- base.WebApiBase.SetCompleted(options, response);
188
- const res = response.data;
189
- resolve(res);
190
- }
191
- catch( err ) {
192
- base.WebApiBase.HandleError(options, config, err);
193
- reject(err);
194
- }
195
- });
196
- }
197
- /**
198
- * `GET /api/v1/Appointment/123`
199
- * Get an existing AppointmentEntity
200
- * @param appointmentId - The AppointmentEntity to be get.
201
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
202
- * @returns The AppointmentEntity
203
- */
204
- public async getByIdAsync( appointmentId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.AppointmentEntity > {
205
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
- base.WebApiBase.SetPending(options);
207
- return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
208
- try {
209
- const response = await this._axios.get( appointmentId.toString(), config);
210
- base.WebApiBase.SetCompleted(options, response);
211
- let res : carriers.AppointmentEntity = null;
212
- if( response.status != 304 )
213
- res = converters.Create_AppointmentEntity_From( response.data );
214
- resolve(res);
215
- }
216
- catch( err ) {
217
- base.WebApiBase.HandleError(options, config, err);
218
- reject(err);
219
- }
220
- });
221
- }
222
-
223
-
224
- } // class AppointmentRestApi
225
-
1
+ // <auto-generated>
2
+ // SuperOffice Code Generator
3
+ // modelling\templates\servicestswebapi\tswebapirestentities.tt
4
+ // </auto-generated>
5
+
6
+
7
+ /* tslint:disable */
8
+ //----------------------------------------------------------------------------
9
+ // G E N E R A T E D F I L E ! D O N O T E D I T !
10
+ //----------------------------------------------------------------------------
11
+ //
12
+ // File: AppointmentRestApi.ts
13
+ //
14
+ //----------------------------------------------------------------------------
15
+ // Copyright (C) SuperOffice AS
16
+ //----------------------------------------------------------------------------
17
+
18
+ import { AxiosRequestConfig, AxiosError } from 'axios';
19
+ import { Duration } from 'dayjs/plugin/duration';
20
+ import * as enums from './Enums';
21
+ import * as base from './WebApiBase';
22
+ import * as carriers from './Carriers';
23
+ import * as converters from './Converters';
24
+ import { FromBase64ToString, ToBase64 } from './Base64';
25
+
26
+ /**
27
+ * Appointments appear in the diary, and have links to a Contact/Person and possibly a Project or Sale. They have start and end time+date.
28
+ * Collection of all services that works with Appointment data.
29
+ *
30
+ * `api/v1/Appointment`
31
+ */
32
+ export interface IAppointmentRestApi {
33
+
34
+ getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.AppointmentEntity >;
35
+ postAsync(entity: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity >;
36
+ putByIdAsync(id:number, entity: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity >;
37
+ patchByIdAsync(id:number, entity: base.WebApiPatchOperation[] | carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity >;
38
+ deleteByIdAsync(AppointmentEntityId: number, options?:base.WebApiPutRequestOptions) : Promise<void>;
39
+ getByIdAsync(AppointmentEntityId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.AppointmentEntity >;
40
+ // POST Validate Async( appointmentEntity ) = validateAppointmentEntity
41
+
42
+
43
+ } // interface IAppointmentRestApi
44
+
45
+
46
+
47
+
48
+ /**
49
+ * Appointments appear in the diary, and have links to a Contact/Person and possibly a Project or Sale. They have start and end time+date.
50
+ * Collection of all services that works with Appointment data.
51
+ *
52
+ * `api/v1/Appointment`
53
+ */
54
+ export class AppointmentRestApi extends base.WebApiBase implements IAppointmentRestApi {
55
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
56
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
57
+ constructor(baseUrl: string, resourceManager:any);
58
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
59
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
60
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
61
+ constructor(options: base.WebApiOptions);
62
+
63
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
64
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
65
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
66
+ cultureCode?: string,
67
+ ) {
68
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
69
+ options.basePath = "v1/Appointment/";
70
+ super(options);
71
+ }
72
+
73
+
74
+ /**
75
+ * `GET /api/v1/Appointment/default`
76
+ * Set default values into a new AppointmentEntity.
77
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
78
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
79
+ * @returns A blank entity.
80
+ */
81
+ public async getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.AppointmentEntity > {
82
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
83
+ base.WebApiBase.SetPending(options);
84
+ return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
85
+ try {
86
+ const response = await this._axios.get("default", config);
87
+ base.WebApiBase.SetCompleted(options, response);
88
+ const res : carriers.AppointmentEntity = converters.Create_AppointmentEntity_From( response.data );
89
+ resolve(res);
90
+ }
91
+ catch( err ) {
92
+ base.WebApiBase.HandleError(options, config, err);
93
+ reject(err);
94
+ }
95
+ });
96
+ }
97
+
98
+
99
+ /**
100
+ * `POST /api/v1/Appointment/`
101
+ * Creates a new AppointmentEntity
102
+ * @param newAppointment - The AppointmentEntity to be saved.
103
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
104
+ * @returns New AppointmentEntity
105
+ */
106
+ public async postAsync(newAppointment: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity > {
107
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
108
+ base.WebApiBase.SetPending(options);
109
+ return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
110
+ try {
111
+ const response = await this._axios.post("", newAppointment, config);
112
+ base.WebApiBase.SetCompleted(options, response);
113
+ const res : carriers.AppointmentEntity = converters.Create_AppointmentEntity_From( response.data );
114
+ resolve(res);
115
+ }
116
+ catch( err ) {
117
+ base.WebApiBase.HandleError(options, config, err);
118
+ reject(err);
119
+ }
120
+ });
121
+ }
122
+
123
+
124
+ /**
125
+ * `PUT /api/v1/Appointment/123`
126
+ * Replace the existing AppointmentEntity
127
+ * @param appointment - The AppointmentEntity to be saved.
128
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
129
+ * @returns The updated AppointmentEntity
130
+ */
131
+ public async putByIdAsync(id:number, appointment: carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity > {
132
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
133
+ base.WebApiBase.SetPending(options);
134
+ return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
135
+ try {
136
+ const response = await this._axios.put(id.toString(), appointment, config);
137
+ base.WebApiBase.SetCompleted(options, response);
138
+ let res : carriers.AppointmentEntity = null;
139
+ if( response.status != 304 )
140
+ res = converters.Create_AppointmentEntity_From( response.data );
141
+ resolve(res);
142
+ }
143
+ catch( err ) {
144
+ base.WebApiBase.HandleError(options, config, err);
145
+ reject(err);
146
+ }
147
+ });
148
+ }
149
+
150
+ /**
151
+ * `PATCH /api/v1/Appointment/123`
152
+ * Updates an existing AppointmentEntity
153
+ * @param appointment - The partial AppointmentEntity containing updated values, or an array of RFC6902 PATCH operations.
154
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
155
+ * @returns The updated AppointmentEntity
156
+ */
157
+ public async patchByIdAsync(id:number, appointment: base.WebApiPatchOperation[] | carriers.AppointmentEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.AppointmentEntity > {
158
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
159
+ base.WebApiBase.SetPending(options);
160
+ return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
161
+ try {
162
+ const response = await this._axios.patch(id.toString(), appointment, config);
163
+ base.WebApiBase.SetCompleted(options, response);
164
+ let res : carriers.AppointmentEntity = null;
165
+ if( response.status != 304 )
166
+ res = converters.Create_AppointmentEntity_From( response.data );
167
+ resolve(res);
168
+ }
169
+ catch( err ) {
170
+ base.WebApiBase.HandleError(options, config, err);
171
+ reject(err);
172
+ }
173
+ });
174
+ }
175
+ /**
176
+ * `DELETE /api/v1/Appointment/123`
177
+ * Deletes the AppointmentEntity
178
+ * @param appointmentId - The id of the AppointmentEntity to be deleted.
179
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
180
+ */
181
+ public async deleteByIdAsync(appointmentId: number, options?:base.WebApiPutRequestOptions) : Promise<void> {
182
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
183
+ base.WebApiBase.SetPending(options);
184
+ return new Promise< void >(async (resolve, reject) => {
185
+ try {
186
+ const response = await this._axios.delete( appointmentId.toString(), config );
187
+ base.WebApiBase.SetCompleted(options, response);
188
+ const res = response.data;
189
+ resolve(res);
190
+ }
191
+ catch( err ) {
192
+ base.WebApiBase.HandleError(options, config, err);
193
+ reject(err);
194
+ }
195
+ });
196
+ }
197
+ /**
198
+ * `GET /api/v1/Appointment/123`
199
+ * Get an existing AppointmentEntity
200
+ * @param appointmentId - The AppointmentEntity to be get.
201
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
202
+ * @returns The AppointmentEntity
203
+ */
204
+ public async getByIdAsync( appointmentId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.AppointmentEntity > {
205
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
+ base.WebApiBase.SetPending(options);
207
+ return new Promise< carriers.AppointmentEntity >(async (resolve, reject) => {
208
+ try {
209
+ const response = await this._axios.get( appointmentId.toString(), config);
210
+ base.WebApiBase.SetCompleted(options, response);
211
+ let res : carriers.AppointmentEntity = null;
212
+ if( response.status != 304 )
213
+ res = converters.Create_AppointmentEntity_From( response.data );
214
+ resolve(res);
215
+ }
216
+ catch( err ) {
217
+ base.WebApiBase.HandleError(options, config, err);
218
+ reject(err);
219
+ }
220
+ });
221
+ }
222
+
223
+
224
+ } // class AppointmentRestApi
225
+