• 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

10.42
/src/schemas/integrationMappingPartnerItemSlack.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 IntegrationMappingPartnerItemSlackTypeField = 'channel';
10
export class IntegrationMappingPartnerItemSlack {
237✔
11
  /**
12
   * Type of the mapped item referenced in `id`. */
13
  readonly type: IntegrationMappingPartnerItemSlackTypeField =
×
14
    'channel' as IntegrationMappingPartnerItemSlackTypeField;
15
  /**
16
   * ID of the mapped item (of type referenced in `type`). */
17
  readonly id!: string;
18
  /**
19
   * ID of the Slack workspace with which the item is associated. Use this parameter if Box for Slack is installed at a workspace level. Do not use `slack_org_id` at the same time. */
20
  readonly slackWorkspaceId?: string | null;
21
  /**
22
   * ID of the Slack org with which the item is associated. Use this parameter if Box for Slack is installed at the org level. Do not use `slack_workspace_id` at the same time. */
23
  readonly slackOrgId?: string | null;
24
  readonly rawData?: SerializedData;
25
  constructor(
26
    fields: Omit<IntegrationMappingPartnerItemSlack, 'type'> &
27
      Partial<Pick<IntegrationMappingPartnerItemSlack, 'type'>>,
28
  ) {
29
    if (fields.type !== undefined) {
×
30
      this.type = fields.type;
×
31
    }
32
    if (fields.id !== undefined) {
×
33
      this.id = fields.id;
×
34
    }
35
    if (fields.slackWorkspaceId !== undefined) {
×
36
      this.slackWorkspaceId = fields.slackWorkspaceId;
×
37
    }
38
    if (fields.slackOrgId !== undefined) {
×
39
      this.slackOrgId = fields.slackOrgId;
×
40
    }
41
    if (fields.rawData !== undefined) {
×
42
      this.rawData = fields.rawData;
×
43
    }
44
  }
45
}
46
export interface IntegrationMappingPartnerItemSlackInput {
47
  /**
48
   * Type of the mapped item referenced in `id`. */
49
  readonly type?: IntegrationMappingPartnerItemSlackTypeField;
50
  /**
51
   * ID of the mapped item (of type referenced in `type`). */
52
  readonly id: string;
53
  /**
54
   * ID of the Slack workspace with which the item is associated. Use this parameter if Box for Slack is installed at a workspace level. Do not use `slack_org_id` at the same time. */
55
  readonly slackWorkspaceId?: string | null;
56
  /**
57
   * ID of the Slack org with which the item is associated. Use this parameter if Box for Slack is installed at the org level. Do not use `slack_workspace_id` at the same time. */
58
  readonly slackOrgId?: string | null;
59
  readonly rawData?: SerializedData;
60
}
61
export function serializeIntegrationMappingPartnerItemSlackTypeField(
237✔
62
  val: IntegrationMappingPartnerItemSlackTypeField,
63
): SerializedData {
64
  return val;
×
65
}
66
export function deserializeIntegrationMappingPartnerItemSlackTypeField(
237✔
67
  val: SerializedData,
68
): IntegrationMappingPartnerItemSlackTypeField {
69
  if (val == 'channel') {
×
70
    return val;
×
71
  }
72
  throw new BoxSdkError({
×
73
    message: "Can't deserialize IntegrationMappingPartnerItemSlackTypeField",
74
  });
75
}
76
export function serializeIntegrationMappingPartnerItemSlack(
237✔
77
  val: IntegrationMappingPartnerItemSlack,
78
): SerializedData {
79
  return {
×
80
    ['type']: serializeIntegrationMappingPartnerItemSlackTypeField(val.type),
81
    ['id']: val.id,
82
    ['slack_workspace_id']: val.slackWorkspaceId,
83
    ['slack_org_id']: val.slackOrgId,
84
  };
85
}
86
export function deserializeIntegrationMappingPartnerItemSlack(
237✔
87
  val: SerializedData,
88
): IntegrationMappingPartnerItemSlack {
89
  if (!sdIsMap(val)) {
×
90
    throw new BoxSdkError({
×
91
      message: 'Expecting a map for "IntegrationMappingPartnerItemSlack"',
92
    });
93
  }
94
  if (val.type == void 0) {
×
95
    throw new BoxSdkError({
×
96
      message:
97
        'Expecting "type" of type "IntegrationMappingPartnerItemSlack" to be defined',
98
    });
99
  }
100
  const type: IntegrationMappingPartnerItemSlackTypeField =
101
    deserializeIntegrationMappingPartnerItemSlackTypeField(val.type);
×
102
  if (val.id == void 0) {
×
103
    throw new BoxSdkError({
×
104
      message:
105
        'Expecting "id" of type "IntegrationMappingPartnerItemSlack" to be defined',
106
    });
107
  }
108
  if (!sdIsString(val.id)) {
×
109
    throw new BoxSdkError({
×
110
      message:
111
        'Expecting string for "id" of type "IntegrationMappingPartnerItemSlack"',
112
    });
113
  }
114
  const id: string = val.id;
×
115
  if (
×
116
    !(val.slack_workspace_id == void 0) &&
×
117
    !sdIsString(val.slack_workspace_id)
118
  ) {
119
    throw new BoxSdkError({
×
120
      message:
121
        'Expecting string for "slack_workspace_id" of type "IntegrationMappingPartnerItemSlack"',
122
    });
123
  }
124
  const slackWorkspaceId: undefined | string =
125
    val.slack_workspace_id == void 0 ? void 0 : val.slack_workspace_id;
×
126
  if (!(val.slack_org_id == void 0) && !sdIsString(val.slack_org_id)) {
×
127
    throw new BoxSdkError({
×
128
      message:
129
        'Expecting string for "slack_org_id" of type "IntegrationMappingPartnerItemSlack"',
130
    });
131
  }
132
  const slackOrgId: undefined | string =
133
    val.slack_org_id == void 0 ? void 0 : val.slack_org_id;
×
134
  return {
×
135
    type: type,
136
    id: id,
137
    slackWorkspaceId: slackWorkspaceId,
138
    slackOrgId: slackOrgId,
139
  } satisfies IntegrationMappingPartnerItemSlack;
140
}
141
export function serializeIntegrationMappingPartnerItemSlackInput(
237✔
142
  val: IntegrationMappingPartnerItemSlackInput,
143
): SerializedData {
144
  return {
×
145
    ['type']:
146
      val.type == void 0
×
147
        ? val.type
148
        : serializeIntegrationMappingPartnerItemSlackTypeField(val.type),
149
    ['id']: val.id,
150
    ['slack_workspace_id']: val.slackWorkspaceId,
151
    ['slack_org_id']: val.slackOrgId,
152
  };
153
}
154
export function deserializeIntegrationMappingPartnerItemSlackInput(
237✔
155
  val: SerializedData,
156
): IntegrationMappingPartnerItemSlackInput {
157
  if (!sdIsMap(val)) {
×
158
    throw new BoxSdkError({
×
159
      message: 'Expecting a map for "IntegrationMappingPartnerItemSlackInput"',
160
    });
161
  }
162
  const type: undefined | IntegrationMappingPartnerItemSlackTypeField =
163
    val.type == void 0
×
164
      ? void 0
165
      : deserializeIntegrationMappingPartnerItemSlackTypeField(val.type);
166
  if (val.id == void 0) {
×
167
    throw new BoxSdkError({
×
168
      message:
169
        'Expecting "id" of type "IntegrationMappingPartnerItemSlackInput" to be defined',
170
    });
171
  }
172
  if (!sdIsString(val.id)) {
×
173
    throw new BoxSdkError({
×
174
      message:
175
        'Expecting string for "id" of type "IntegrationMappingPartnerItemSlackInput"',
176
    });
177
  }
178
  const id: string = val.id;
×
179
  if (
×
180
    !(val.slack_workspace_id == void 0) &&
×
181
    !sdIsString(val.slack_workspace_id)
182
  ) {
183
    throw new BoxSdkError({
×
184
      message:
185
        'Expecting string for "slack_workspace_id" of type "IntegrationMappingPartnerItemSlackInput"',
186
    });
187
  }
188
  const slackWorkspaceId: undefined | string =
189
    val.slack_workspace_id == void 0 ? void 0 : val.slack_workspace_id;
×
190
  if (!(val.slack_org_id == void 0) && !sdIsString(val.slack_org_id)) {
×
191
    throw new BoxSdkError({
×
192
      message:
193
        'Expecting string for "slack_org_id" of type "IntegrationMappingPartnerItemSlackInput"',
194
    });
195
  }
196
  const slackOrgId: undefined | string =
197
    val.slack_org_id == void 0 ? void 0 : val.slack_org_id;
×
198
  return {
×
199
    type: type,
200
    id: id,
201
    slackWorkspaceId: slackWorkspaceId,
202
    slackOrgId: slackOrgId,
203
  } satisfies IntegrationMappingPartnerItemSlackInput;
204
}
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