Skip to content

Commit 88a823e

Browse files
authored
chore: convert visit method to an arrow function (#1132)
1 parent 4b16f7c commit 88a823e

File tree

6 files changed

+36
-33
lines changed

6 files changed

+36
-33
lines changed

clients/client-app-mesh/models/index.ts

+17-14
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ export namespace AccessLog {
2828
file: (value: FileAccessLog) => T;
2929
_: (name: string, value: any) => T;
3030
}
31-
export function visit<T>(value: AccessLog, visitor: Visitor<T>): T {
31+
export const visit = <T>(value: AccessLog, visitor: Visitor<T>): T => {
3232
if (value.file !== undefined) return visitor.file(value.file);
3333
return visitor._(value.$unknown[0], value.$unknown[1]);
34-
}
34+
};
3535
}
3636

3737
/**
@@ -112,11 +112,11 @@ export namespace Backend {
112112
virtualService: (value: VirtualServiceBackend) => T;
113113
_: (name: string, value: any) => T;
114114
}
115-
export function visit<T>(value: Backend, visitor: Visitor<T>): T {
115+
export const visit = <T>(value: Backend, visitor: Visitor<T>): T => {
116116
if (value.virtualService !== undefined)
117117
return visitor.virtualService(value.virtualService);
118118
return visitor._(value.$unknown[0], value.$unknown[1]);
119-
}
119+
};
120120
}
121121

122122
/**
@@ -1147,17 +1147,17 @@ export namespace GrpcRouteMetadataMatchMethod {
11471147
suffix: (value: string) => T;
11481148
_: (name: string, value: any) => T;
11491149
}
1150-
export function visit<T>(
1150+
export const visit = <T>(
11511151
value: GrpcRouteMetadataMatchMethod,
11521152
visitor: Visitor<T>
1153-
): T {
1153+
): T => {
11541154
if (value.exact !== undefined) return visitor.exact(value.exact);
11551155
if (value.prefix !== undefined) return visitor.prefix(value.prefix);
11561156
if (value.range !== undefined) return visitor.range(value.range);
11571157
if (value.regex !== undefined) return visitor.regex(value.regex);
11581158
if (value.suffix !== undefined) return visitor.suffix(value.suffix);
11591159
return visitor._(value.$unknown[0], value.$unknown[1]);
1160-
}
1160+
};
11611161
}
11621162

11631163
/**
@@ -1247,14 +1247,17 @@ export namespace HeaderMatchMethod {
12471247
suffix: (value: string) => T;
12481248
_: (name: string, value: any) => T;
12491249
}
1250-
export function visit<T>(value: HeaderMatchMethod, visitor: Visitor<T>): T {
1250+
export const visit = <T>(
1251+
value: HeaderMatchMethod,
1252+
visitor: Visitor<T>
1253+
): T => {
12511254
if (value.exact !== undefined) return visitor.exact(value.exact);
12521255
if (value.prefix !== undefined) return visitor.prefix(value.prefix);
12531256
if (value.range !== undefined) return visitor.range(value.range);
12541257
if (value.regex !== undefined) return visitor.regex(value.regex);
12551258
if (value.suffix !== undefined) return visitor.suffix(value.suffix);
12561259
return visitor._(value.$unknown[0], value.$unknown[1]);
1257-
}
1260+
};
12581261
}
12591262

12601263
/**
@@ -2280,12 +2283,12 @@ export namespace ServiceDiscovery {
22802283
dns: (value: DnsServiceDiscovery) => T;
22812284
_: (name: string, value: any) => T;
22822285
}
2283-
export function visit<T>(value: ServiceDiscovery, visitor: Visitor<T>): T {
2286+
export const visit = <T>(value: ServiceDiscovery, visitor: Visitor<T>): T => {
22842287
if (value.awsCloudMap !== undefined)
22852288
return visitor.awsCloudMap(value.awsCloudMap);
22862289
if (value.dns !== undefined) return visitor.dns(value.dns);
22872290
return visitor._(value.$unknown[0], value.$unknown[1]);
2288-
}
2291+
};
22892292
}
22902293

22912294
/**
@@ -3065,16 +3068,16 @@ export namespace VirtualServiceProvider {
30653068
virtualRouter: (value: VirtualRouterServiceProvider) => T;
30663069
_: (name: string, value: any) => T;
30673070
}
3068-
export function visit<T>(
3071+
export const visit = <T>(
30693072
value: VirtualServiceProvider,
30703073
visitor: Visitor<T>
3071-
): T {
3074+
): T => {
30723075
if (value.virtualNode !== undefined)
30733076
return visitor.virtualNode(value.virtualNode);
30743077
if (value.virtualRouter !== undefined)
30753078
return visitor.virtualRouter(value.virtualRouter);
30763079
return visitor._(value.$unknown[0], value.$unknown[1]);
3077-
}
3080+
};
30783081
}
30793082

30803083
/**

clients/client-groundstation/models/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export namespace ConfigTypeData {
251251
uplinkEchoConfig: (value: UplinkEchoConfig) => T;
252252
_: (name: string, value: any) => T;
253253
}
254-
export function visit<T>(value: ConfigTypeData, visitor: Visitor<T>): T {
254+
export const visit = <T>(value: ConfigTypeData, visitor: Visitor<T>): T => {
255255
if (value.antennaDownlinkConfig !== undefined)
256256
return visitor.antennaDownlinkConfig(value.antennaDownlinkConfig);
257257
if (value.antennaDownlinkDemodDecodeConfig !== undefined)
@@ -267,7 +267,7 @@ export namespace ConfigTypeData {
267267
if (value.uplinkEchoConfig !== undefined)
268268
return visitor.uplinkEchoConfig(value.uplinkEchoConfig);
269269
return visitor._(value.$unknown[0], value.$unknown[1]);
270-
}
270+
};
271271
}
272272

273273
/**

clients/client-kinesis/models/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2355,10 +2355,10 @@ export namespace SubscribeToShardEventStream {
23552355
SubscribeToShardEvent: (value: SubscribeToShardEvent) => T;
23562356
_: (name: string, value: any) => T;
23572357
}
2358-
export function visit<T>(
2358+
export const visit = <T>(
23592359
value: SubscribeToShardEventStream,
23602360
visitor: Visitor<T>
2361-
): T {
2361+
): T => {
23622362
if (value.InternalFailureException !== undefined)
23632363
return visitor.InternalFailureException(value.InternalFailureException);
23642364
if (value.KMSAccessDeniedException !== undefined)
@@ -2380,7 +2380,7 @@ export namespace SubscribeToShardEventStream {
23802380
if (value.SubscribeToShardEvent !== undefined)
23812381
return visitor.SubscribeToShardEvent(value.SubscribeToShardEvent);
23822382
return visitor._(value.$unknown[0], value.$unknown[1]);
2383-
}
2383+
};
23842384
}
23852385

23862386
export interface SubscribeToShardInput {

clients/client-rds-data/models/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export namespace ArrayValue {
9090
stringValues: (value: string[]) => T;
9191
_: (name: string, value: any) => T;
9292
}
93-
export function visit<T>(value: ArrayValue, visitor: Visitor<T>): T {
93+
export const visit = <T>(value: ArrayValue, visitor: Visitor<T>): T => {
9494
if (value.arrayValues !== undefined)
9595
return visitor.arrayValues(value.arrayValues);
9696
if (value.booleanValues !== undefined)
@@ -102,7 +102,7 @@ export namespace ArrayValue {
102102
if (value.stringValues !== undefined)
103103
return visitor.stringValues(value.stringValues);
104104
return visitor._(value.$unknown[0], value.$unknown[1]);
105-
}
105+
};
106106
}
107107

108108
/**
@@ -648,7 +648,7 @@ export namespace Field {
648648
stringValue: (value: string) => T;
649649
_: (name: string, value: any) => T;
650650
}
651-
export function visit<T>(value: Field, visitor: Visitor<T>): T {
651+
export const visit = <T>(value: Field, visitor: Visitor<T>): T => {
652652
if (value.arrayValue !== undefined)
653653
return visitor.arrayValue(value.arrayValue);
654654
if (value.blobValue !== undefined)
@@ -663,7 +663,7 @@ export namespace Field {
663663
if (value.stringValue !== undefined)
664664
return visitor.stringValue(value.stringValue);
665665
return visitor._(value.$unknown[0], value.$unknown[1]);
666-
}
666+
};
667667
}
668668

669669
/**
@@ -1132,7 +1132,7 @@ export namespace Value {
11321132
structValue: (value: StructValue) => T;
11331133
_: (name: string, value: any) => T;
11341134
}
1135-
export function visit<T>(value: Value, visitor: Visitor<T>): T {
1135+
export const visit = <T>(value: Value, visitor: Visitor<T>): T => {
11361136
if (value.arrayValues !== undefined)
11371137
return visitor.arrayValues(value.arrayValues);
11381138
if (value.bigIntValue !== undefined)
@@ -1151,5 +1151,5 @@ export namespace Value {
11511151
if (value.structValue !== undefined)
11521152
return visitor.structValue(value.structValue);
11531153
return visitor._(value.$unknown[0], value.$unknown[1]);
1154-
}
1154+
};
11551155
}

clients/client-s3/models/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9121,17 +9121,17 @@ export namespace SelectObjectContentEventStream {
91219121
Stats: (value: StatsEvent) => T;
91229122
_: (name: string, value: any) => T;
91239123
}
9124-
export function visit<T>(
9124+
export const visit = <T>(
91259125
value: SelectObjectContentEventStream,
91269126
visitor: Visitor<T>
9127-
): T {
9127+
): T => {
91289128
if (value.Cont !== undefined) return visitor.Cont(value.Cont);
91299129
if (value.End !== undefined) return visitor.End(value.End);
91309130
if (value.Progress !== undefined) return visitor.Progress(value.Progress);
91319131
if (value.Records !== undefined) return visitor.Records(value.Records);
91329132
if (value.Stats !== undefined) return visitor.Stats(value.Stats);
91339133
return visitor._(value.$unknown[0], value.$unknown[1]);
9134-
}
9134+
};
91359135
}
91369136

91379137
export interface SelectObjectContentOutput {

clients/client-transcribe-streaming/models/index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ export namespace AudioStream {
6666
AudioEvent: (value: AudioEvent) => T;
6767
_: (name: string, value: any) => T;
6868
}
69-
export function visit<T>(value: AudioStream, visitor: Visitor<T>): T {
69+
export const visit = <T>(value: AudioStream, visitor: Visitor<T>): T => {
7070
if (value.AudioEvent !== undefined)
7171
return visitor.AudioEvent(value.AudioEvent);
7272
return visitor._(value.$unknown[0], value.$unknown[1]);
73-
}
73+
};
7474
}
7575

7676
/**
@@ -446,10 +446,10 @@ export namespace TranscriptResultStream {
446446
TranscriptEvent: (value: TranscriptEvent) => T;
447447
_: (name: string, value: any) => T;
448448
}
449-
export function visit<T>(
449+
export const visit = <T>(
450450
value: TranscriptResultStream,
451451
visitor: Visitor<T>
452-
): T {
452+
): T => {
453453
if (value.BadRequestException !== undefined)
454454
return visitor.BadRequestException(value.BadRequestException);
455455
if (value.ConflictException !== undefined)
@@ -461,7 +461,7 @@ export namespace TranscriptResultStream {
461461
if (value.TranscriptEvent !== undefined)
462462
return visitor.TranscriptEvent(value.TranscriptEvent);
463463
return visitor._(value.$unknown[0], value.$unknown[1]);
464-
}
464+
};
465465
}
466466

467467
export enum MediaEncoding {

0 commit comments

Comments
 (0)