@targetprocess/shared-data-model-client 0.14.0 → 0.16.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.
@@ -19,6 +19,15 @@ export interface CopyCurrentProfileRequestDto extends Parsable {
19
19
  export function createCopyCurrentProfileRequestDtoFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
20
20
  return deserializeIntoCopyCurrentProfileRequestDto;
21
21
  }
22
+ /**
23
+ * Creates a new instance of the appropriate class based on discriminator value
24
+ * @param parseNode The parse node to use to read the discriminator value and create the object
25
+ * @returns {DeleteProfileRequestDto}
26
+ */
27
+ // @ts-ignore
28
+ export function createDeleteProfileRequestDtoFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
29
+ return deserializeIntoDeleteProfileRequestDto;
30
+ }
22
31
  /**
23
32
  * Creates a new instance of the appropriate class based on discriminator value
24
33
  * @param parseNode The parse node to use to read the discriminator value and create the object
@@ -156,6 +165,15 @@ export function createSharedDataCreateAttachmentResponseDtoFromDiscriminatorValu
156
165
  export function createSharedDataCreateAttachmentResponseItemDtoFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
157
166
  return deserializeIntoSharedDataCreateAttachmentResponseItemDto;
158
167
  }
168
+ /**
169
+ * Creates a new instance of the appropriate class based on discriminator value
170
+ * @param parseNode The parse node to use to read the discriminator value and create the object
171
+ * @returns {SharedDataDeleteDto}
172
+ */
173
+ // @ts-ignore
174
+ export function createSharedDataDeleteDtoFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
175
+ return deserializeIntoSharedDataDeleteDto;
176
+ }
159
177
  /**
160
178
  * Creates a new instance of the appropriate class based on discriminator value
161
179
  * @param parseNode The parse node to use to read the discriminator value and create the object
@@ -230,6 +248,16 @@ export function createValidatedProfileDtoFromDiscriminatorValue(parseNode: Parse
230
248
  export function createValidatedTypeMappingDtoFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record<string, (node: ParseNode) => void>) {
231
249
  return deserializeIntoValidatedTypeMappingDto;
232
250
  }
251
+ export interface DeleteProfileRequestDto extends Parsable {
252
+ /**
253
+ * The forceDelete property
254
+ */
255
+ forceDelete?: boolean | null;
256
+ /**
257
+ * The profileId property
258
+ */
259
+ profileId?: string | null;
260
+ }
233
261
  /**
234
262
  * The deserialization information for the current model
235
263
  * @returns {Record<string, (node: ParseNode) => void>}
@@ -245,6 +273,17 @@ export function deserializeIntoCopyCurrentProfileRequestDto(copyCurrentProfileRe
245
273
  * @returns {Record<string, (node: ParseNode) => void>}
246
274
  */
247
275
  // @ts-ignore
276
+ export function deserializeIntoDeleteProfileRequestDto(deleteProfileRequestDto: Partial<DeleteProfileRequestDto> | undefined = {}) : Record<string, (node: ParseNode) => void> {
277
+ return {
278
+ "forceDelete": n => { deleteProfileRequestDto.forceDelete = n.getBooleanValue(); },
279
+ "profileId": n => { deleteProfileRequestDto.profileId = n.getStringValue(); },
280
+ }
281
+ }
282
+ /**
283
+ * The deserialization information for the current model
284
+ * @returns {Record<string, (node: ParseNode) => void>}
285
+ */
286
+ // @ts-ignore
248
287
  export function deserializeIntoFieldDefDto(fieldDefDto: Partial<FieldDefDto> | undefined = {}) : Record<string, (node: ParseNode) => void> {
249
288
  return {
250
289
  "expression": n => { fieldDefDto.expression = n.getStringValue(); },
@@ -261,6 +300,7 @@ export function deserializeIntoFieldDefDto(fieldDefDto: Partial<FieldDefDto> | u
261
300
  export function deserializeIntoFieldMappingDto(fieldMappingDto: Partial<FieldMappingDto> | undefined = {}) : Record<string, (node: ParseNode) => void> {
262
301
  return {
263
302
  "id": n => { fieldMappingDto.id = n.getStringValue(); },
303
+ "kind": n => { fieldMappingDto.kind = n.getEnumValue<FieldMappingKind>(FieldMappingKindObject); },
264
304
  "source": n => { fieldMappingDto.source = n.getObjectValue<MappingFieldDefDto>(createMappingFieldDefDtoFromDiscriminatorValue); },
265
305
  "target": n => { fieldMappingDto.target = n.getObjectValue<MappingFieldDefDto>(createMappingFieldDefDtoFromDiscriminatorValue); },
266
306
  "$type": n => { fieldMappingDto.type = n.getStringValue(); },
@@ -401,6 +441,16 @@ export function deserializeIntoSharedDataCreateAttachmentResponseItemDto(sharedD
401
441
  * @returns {Record<string, (node: ParseNode) => void>}
402
442
  */
403
443
  // @ts-ignore
444
+ export function deserializeIntoSharedDataDeleteDto(sharedDataDeleteDto: Partial<SharedDataDeleteDto> | undefined = {}) : Record<string, (node: ParseNode) => void> {
445
+ return {
446
+ "id": n => { sharedDataDeleteDto.id = n.getNumberValue(); },
447
+ }
448
+ }
449
+ /**
450
+ * The deserialization information for the current model
451
+ * @returns {Record<string, (node: ParseNode) => void>}
452
+ */
453
+ // @ts-ignore
404
454
  export function deserializeIntoTestTypeMappingDto(testTypeMappingDto: Partial<TestTypeMappingDto> | undefined = {}) : Record<string, (node: ParseNode) => void> {
405
455
  return {
406
456
  "entityType": n => { testTypeMappingDto.entityType = n.getStringValue(); },
@@ -507,6 +557,10 @@ export interface FieldMappingDto extends Parsable {
507
557
  * The id property
508
558
  */
509
559
  id?: string | null;
560
+ /**
561
+ * The kind property
562
+ */
563
+ kind?: FieldMappingKind | null;
510
564
  /**
511
565
  * The source property
512
566
  */
@@ -520,6 +574,7 @@ export interface FieldMappingDto extends Parsable {
520
574
  */
521
575
  type?: string | null;
522
576
  }
577
+ export type FieldMappingKind = (typeof FieldMappingKindObject)[keyof typeof FieldMappingKindObject];
523
578
  export interface GetEntityTypesDto extends Parsable {
524
579
  /**
525
580
  * The sdmTypes property
@@ -626,6 +681,17 @@ export function serializeCopyCurrentProfileRequestDto(writer: SerializationWrite
626
681
  * @param writer Serialization writer to use to serialize this model
627
682
  */
628
683
  // @ts-ignore
684
+ export function serializeDeleteProfileRequestDto(writer: SerializationWriter, deleteProfileRequestDto: Partial<DeleteProfileRequestDto> | undefined | null = {}) : void {
685
+ if (deleteProfileRequestDto) {
686
+ writer.writeBooleanValue("forceDelete", deleteProfileRequestDto.forceDelete);
687
+ writer.writeStringValue("profileId", deleteProfileRequestDto.profileId);
688
+ }
689
+ }
690
+ /**
691
+ * Serializes information the current object
692
+ * @param writer Serialization writer to use to serialize this model
693
+ */
694
+ // @ts-ignore
629
695
  export function serializeFieldDefDto(writer: SerializationWriter, fieldDefDto: Partial<FieldDefDto> | undefined | null = {}) : void {
630
696
  if (fieldDefDto) {
631
697
  writer.writeStringValue("expression", fieldDefDto.expression);
@@ -642,6 +708,7 @@ export function serializeFieldDefDto(writer: SerializationWriter, fieldDefDto: P
642
708
  export function serializeFieldMappingDto(writer: SerializationWriter, fieldMappingDto: Partial<FieldMappingDto> | undefined | null = {}) : void {
643
709
  if (fieldMappingDto) {
644
710
  writer.writeStringValue("id", fieldMappingDto.id);
711
+ writer.writeEnumValue<FieldMappingKind>("kind", fieldMappingDto.kind);
645
712
  writer.writeObjectValue<MappingFieldDefDto>("source", fieldMappingDto.source, serializeMappingFieldDefDto);
646
713
  writer.writeObjectValue<MappingFieldDefDto>("target", fieldMappingDto.target, serializeMappingFieldDefDto);
647
714
  writer.writeStringValue("$type", fieldMappingDto.type);
@@ -785,6 +852,16 @@ export function serializeSharedDataCreateAttachmentResponseItemDto(writer: Seria
785
852
  * @param writer Serialization writer to use to serialize this model
786
853
  */
787
854
  // @ts-ignore
855
+ export function serializeSharedDataDeleteDto(writer: SerializationWriter, sharedDataDeleteDto: Partial<SharedDataDeleteDto> | undefined | null = {}) : void {
856
+ if (sharedDataDeleteDto) {
857
+ writer.writeNumberValue("id", sharedDataDeleteDto.id);
858
+ }
859
+ }
860
+ /**
861
+ * Serializes information the current object
862
+ * @param writer Serialization writer to use to serialize this model
863
+ */
864
+ // @ts-ignore
788
865
  export function serializeTestTypeMappingDto(writer: SerializationWriter, testTypeMappingDto: Partial<TestTypeMappingDto> | undefined | null = {}) : void {
789
866
  if (testTypeMappingDto) {
790
867
  writer.writeStringValue("entityType", testTypeMappingDto.entityType);
@@ -897,6 +974,12 @@ export interface SharedDataCreateAttachmentResponseItemDto extends Parsable {
897
974
  */
898
975
  uri?: string | null;
899
976
  }
977
+ export interface SharedDataDeleteDto extends Parsable {
978
+ /**
979
+ * The id property
980
+ */
981
+ id?: number | null;
982
+ }
900
983
  export interface TestTypeMappingDto extends Parsable {
901
984
  /**
902
985
  * The entityType property
@@ -1012,6 +1095,11 @@ export interface ValidatedTypeMappingDto extends AdditionalDataHolder, Parsable,
1012
1095
  validationState?: ValidationState | null;
1013
1096
  }
1014
1097
  export type ValidationState = (typeof ValidationStateObject)[keyof typeof ValidationStateObject];
1098
+ export const FieldMappingKindObject = {
1099
+ DefaultEscaped: "Default",
1100
+ Custom: "Custom",
1101
+ Empty: "Empty",
1102
+ } as const;
1015
1103
  export const RefKindObject = {
1016
1104
  Single: "Single",
1017
1105
  Collection: "Collection",
@@ -4,7 +4,7 @@
4
4
  // @ts-ignore
5
5
  import { ApiRequestBuilderNavigationMetadata, type ApiRequestBuilder } from './api/index.js';
6
6
  // @ts-ignore
7
- import { apiClientProxifier, registerDefaultDeserializer, registerDefaultSerializer, type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestAdapter } from '@microsoft/kiota-abstractions';
7
+ import { apiClientProxifier, ParseNodeFactoryRegistry, SerializationWriterFactoryRegistry, type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestAdapter } from '@microsoft/kiota-abstractions';
8
8
  // @ts-ignore
9
9
  import { FormParseNodeFactory, FormSerializationWriterFactory } from '@microsoft/kiota-serialization-form';
10
10
  // @ts-ignore
@@ -20,13 +20,26 @@ import { TextParseNodeFactory, TextSerializationWriterFactory } from '@microsoft
20
20
  */
21
21
  // @ts-ignore
22
22
  export function createTpSharedDataModelClient(requestAdapter: RequestAdapter) {
23
- registerDefaultSerializer(JsonSerializationWriterFactory);
24
- registerDefaultSerializer(TextSerializationWriterFactory);
25
- registerDefaultSerializer(FormSerializationWriterFactory);
26
- registerDefaultSerializer(MultipartSerializationWriterFactory);
27
- registerDefaultDeserializer(JsonParseNodeFactory);
28
- registerDefaultDeserializer(TextParseNodeFactory);
29
- registerDefaultDeserializer(FormParseNodeFactory);
23
+ if (requestAdapter === undefined) {
24
+ throw new Error("requestAdapter cannot be undefined");
25
+ }
26
+ const serializationWriterFactory = requestAdapter.getSerializationWriterFactory() as SerializationWriterFactoryRegistry;
27
+ const parseNodeFactoryRegistry = requestAdapter.getParseNodeFactory() as ParseNodeFactoryRegistry;
28
+ const backingStoreFactory = requestAdapter.getBackingStoreFactory();
29
+
30
+ if (parseNodeFactoryRegistry.registerDefaultDeserializer) {
31
+ parseNodeFactoryRegistry.registerDefaultDeserializer(JsonParseNodeFactory, backingStoreFactory);
32
+ parseNodeFactoryRegistry.registerDefaultDeserializer(TextParseNodeFactory, backingStoreFactory);
33
+ parseNodeFactoryRegistry.registerDefaultDeserializer(FormParseNodeFactory, backingStoreFactory);
34
+ }
35
+
36
+ if (serializationWriterFactory.registerDefaultSerializer) {
37
+ serializationWriterFactory.registerDefaultSerializer(JsonSerializationWriterFactory);
38
+ serializationWriterFactory.registerDefaultSerializer(TextSerializationWriterFactory);
39
+ serializationWriterFactory.registerDefaultSerializer(FormSerializationWriterFactory);
40
+ serializationWriterFactory.registerDefaultSerializer(MultipartSerializationWriterFactory);
41
+ }
42
+
30
43
  const pathParameters: Record<string, unknown> = {
31
44
  "baseurl": requestAdapter.baseUrl,
32
45
  };