• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-node-sdk / 20629997903

31 Dec 2025 02:57PM UTC coverage: 40.466% (-0.4%) from 40.85%
20629997903

push

github

web-flow
test: Remove integration mappings tests (box/box-codegen#912) (#1303)

4612 of 20093 branches covered (22.95%)

Branch coverage included in aggregate %.

17135 of 33648 relevant lines covered (50.92%)

145.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.24
/src/schemas/integrationMappingBoxItemSlack.ts
1
import { BoxSdkError } from '../box/errors';
237✔
2
import { SerializedData } from '../serialization/json';
3
import { sdIsEmpty } from '../serialization/json';
4
import { sdIsBoolean } from '../serialization/json';
5
import { sdIsNumber } from '../serialization/json';
6
import { sdIsString } from '../serialization/json';
237✔
7
import { sdIsList } from '../serialization/json';
8
import { sdIsMap } from '../serialization/json';
237✔
9
export type IntegrationMappingBoxItemSlackTypeField = 'folder';
10
export class IntegrationMappingBoxItemSlack {
237✔
11
  /**
12
   * Type of the mapped item referenced in `id`. */
13
  readonly type: IntegrationMappingBoxItemSlackTypeField =
×
14
    'folder' as IntegrationMappingBoxItemSlackTypeField;
15
  /**
16
   * ID of the mapped item (of type referenced in `type`). */
17
  readonly id!: string;
18
  readonly rawData?: SerializedData;
19
  constructor(
20
    fields: Omit<IntegrationMappingBoxItemSlack, 'type'> &
21
      Partial<Pick<IntegrationMappingBoxItemSlack, 'type'>>,
22
  ) {
23
    if (fields.type !== undefined) {
×
24
      this.type = fields.type;
×
25
    }
26
    if (fields.id !== undefined) {
×
27
      this.id = fields.id;
×
28
    }
29
    if (fields.rawData !== undefined) {
×
30
      this.rawData = fields.rawData;
×
31
    }
32
  }
33
}
34
export interface IntegrationMappingBoxItemSlackInput {
35
  /**
36
   * Type of the mapped item referenced in `id`. */
37
  readonly type?: IntegrationMappingBoxItemSlackTypeField;
38
  /**
39
   * ID of the mapped item (of type referenced in `type`). */
40
  readonly id: string;
41
  readonly rawData?: SerializedData;
42
}
43
export function serializeIntegrationMappingBoxItemSlackTypeField(
237✔
44
  val: IntegrationMappingBoxItemSlackTypeField,
45
): SerializedData {
46
  return val;
×
47
}
48
export function deserializeIntegrationMappingBoxItemSlackTypeField(
237✔
49
  val: SerializedData,
50
): IntegrationMappingBoxItemSlackTypeField {
51
  if (val == 'folder') {
×
52
    return val;
×
53
  }
54
  throw new BoxSdkError({
×
55
    message: "Can't deserialize IntegrationMappingBoxItemSlackTypeField",
56
  });
57
}
58
export function serializeIntegrationMappingBoxItemSlack(
237✔
59
  val: IntegrationMappingBoxItemSlack,
60
): SerializedData {
61
  return {
×
62
    ['type']: serializeIntegrationMappingBoxItemSlackTypeField(val.type),
63
    ['id']: val.id,
64
  };
65
}
66
export function deserializeIntegrationMappingBoxItemSlack(
237✔
67
  val: SerializedData,
68
): IntegrationMappingBoxItemSlack {
69
  if (!sdIsMap(val)) {
×
70
    throw new BoxSdkError({
×
71
      message: 'Expecting a map for "IntegrationMappingBoxItemSlack"',
72
    });
73
  }
74
  if (val.type == void 0) {
×
75
    throw new BoxSdkError({
×
76
      message:
77
        'Expecting "type" of type "IntegrationMappingBoxItemSlack" to be defined',
78
    });
79
  }
80
  const type: IntegrationMappingBoxItemSlackTypeField =
81
    deserializeIntegrationMappingBoxItemSlackTypeField(val.type);
×
82
  if (val.id == void 0) {
×
83
    throw new BoxSdkError({
×
84
      message:
85
        'Expecting "id" of type "IntegrationMappingBoxItemSlack" to be defined',
86
    });
87
  }
88
  if (!sdIsString(val.id)) {
×
89
    throw new BoxSdkError({
×
90
      message:
91
        'Expecting string for "id" of type "IntegrationMappingBoxItemSlack"',
92
    });
93
  }
94
  const id: string = val.id;
×
95
  return { type: type, id: id } satisfies IntegrationMappingBoxItemSlack;
×
96
}
97
export function serializeIntegrationMappingBoxItemSlackInput(
237✔
98
  val: IntegrationMappingBoxItemSlackInput,
99
): SerializedData {
100
  return {
×
101
    ['type']:
102
      val.type == void 0
×
103
        ? val.type
104
        : serializeIntegrationMappingBoxItemSlackTypeField(val.type),
105
    ['id']: val.id,
106
  };
107
}
108
export function deserializeIntegrationMappingBoxItemSlackInput(
237✔
109
  val: SerializedData,
110
): IntegrationMappingBoxItemSlackInput {
111
  if (!sdIsMap(val)) {
×
112
    throw new BoxSdkError({
×
113
      message: 'Expecting a map for "IntegrationMappingBoxItemSlackInput"',
114
    });
115
  }
116
  const type: undefined | IntegrationMappingBoxItemSlackTypeField =
117
    val.type == void 0
×
118
      ? void 0
119
      : deserializeIntegrationMappingBoxItemSlackTypeField(val.type);
120
  if (val.id == void 0) {
×
121
    throw new BoxSdkError({
×
122
      message:
123
        'Expecting "id" of type "IntegrationMappingBoxItemSlackInput" to be defined',
124
    });
125
  }
126
  if (!sdIsString(val.id)) {
×
127
    throw new BoxSdkError({
×
128
      message:
129
        'Expecting string for "id" of type "IntegrationMappingBoxItemSlackInput"',
130
    });
131
  }
132
  const id: string = val.id;
×
133
  return { type: type, id: id } satisfies IntegrationMappingBoxItemSlackInput;
×
134
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc