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

uber-go / cadence-client / 018eaea0-b222-4287-a51a-c1213bebd6f4

05 Apr 2024 02:18PM UTC coverage: 64.687% (-0.06%) from 64.75%
018eaea0-b222-4287-a51a-c1213bebd6f4

Pull #1324

buildkite

ketsiambaku
v1.2.10-rc3 changelog
Pull Request #1324: [WIP] V1.2.10

13376 of 20678 relevant lines covered (64.69%)

311.6 hits per line

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

48.42
/internal/compatibility/thrift/types.go
1
// Copyright (c) 2021 Uber Technologies, Inc.
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20

21
package thrift
22

23
import (
24
        "go.uber.org/cadence/.gen/go/shared"
25
        "go.uber.org/cadence/internal/common"
26

27
        apiv1 "github.com/uber/cadence-idl/go/proto/api/v1"
28
)
29

30
func Payload(p *apiv1.Payload) []byte {
411✔
31
        if p == nil {
665✔
32
                return nil
254✔
33
        }
254✔
34
        if p.Data == nil {
157✔
35
                // protoPayload will not generate this case
×
36
                // however, Data field will be dropped by the encoding if it's empty
×
37
                // and receiver side will see nil for the Data field
×
38
                // since we already know p is not nil, Data field must be an empty byte array
×
39
                return []byte{}
×
40
        }
×
41
        return p.Data
157✔
42
}
43

44
func FailureReason(failure *apiv1.Failure) *string {
111✔
45
        if failure == nil {
178✔
46
                return nil
67✔
47
        }
67✔
48
        return &failure.Reason
44✔
49
}
50

51
func FailureDetails(failure *apiv1.Failure) []byte {
111✔
52
        if failure == nil {
178✔
53
                return nil
67✔
54
        }
67✔
55
        return failure.Details
44✔
56
}
57

58
func WorkflowExecution(t *apiv1.WorkflowExecution) *shared.WorkflowExecution {
295✔
59
        if t == nil {
423✔
60
                return nil
128✔
61
        }
128✔
62
        return &shared.WorkflowExecution{
167✔
63
                WorkflowId: &t.WorkflowId,
167✔
64
                RunId:      &t.RunId,
167✔
65
        }
167✔
66
}
67

68
func WorkflowId(t *apiv1.WorkflowExecution) *string {
×
69
        if t == nil {
×
70
                return nil
×
71
        }
×
72
        return &t.WorkflowId
×
73
}
74

75
func RunId(t *apiv1.WorkflowExecution) *string {
×
76
        if t == nil {
×
77
                return nil
×
78
        }
×
79
        return &t.RunId
×
80
}
81

82
func ActivityType(t *apiv1.ActivityType) *shared.ActivityType {
103✔
83
        if t == nil {
167✔
84
                return nil
64✔
85
        }
64✔
86
        return &shared.ActivityType{
39✔
87
                Name: &t.Name,
39✔
88
        }
39✔
89
}
90

91
func WorkflowType(t *apiv1.WorkflowType) *shared.WorkflowType {
357✔
92
        if t == nil {
485✔
93
                return nil
128✔
94
        }
128✔
95
        return &shared.WorkflowType{
229✔
96
                Name: &t.Name,
229✔
97
        }
229✔
98
}
99

100
func TaskList(t *apiv1.TaskList) *shared.TaskList {
408✔
101
        if t == nil {
472✔
102
                return nil
64✔
103
        }
64✔
104
        return &shared.TaskList{
344✔
105
                Name: &t.Name,
344✔
106
                Kind: TaskListKind(t.Kind),
344✔
107
        }
344✔
108
}
109

110
func TaskListMetadata(t *apiv1.TaskListMetadata) *shared.TaskListMetadata {
×
111
        if t == nil {
×
112
                return nil
×
113
        }
×
114
        return &shared.TaskListMetadata{
×
115
                MaxTasksPerSecond: toDoubleValue(t.MaxTasksPerSecond),
×
116
        }
×
117
}
118

119
func RetryPolicy(t *apiv1.RetryPolicy) *shared.RetryPolicy {
102✔
120
        if t == nil {
191✔
121
                return nil
89✔
122
        }
89✔
123
        return &shared.RetryPolicy{
13✔
124
                InitialIntervalInSeconds:    durationToSeconds(t.InitialInterval),
13✔
125
                BackoffCoefficient:          &t.BackoffCoefficient,
13✔
126
                MaximumIntervalInSeconds:    durationToSeconds(t.MaximumInterval),
13✔
127
                MaximumAttempts:             &t.MaximumAttempts,
13✔
128
                NonRetriableErrorReasons:    t.NonRetryableErrorReasons,
13✔
129
                ExpirationIntervalInSeconds: durationToSeconds(t.ExpirationInterval),
13✔
130
        }
13✔
131
}
132

133
func Header(t *apiv1.Header) *shared.Header {
194✔
134
        if t == nil {
258✔
135
                return nil
64✔
136
        }
64✔
137
        return &shared.Header{
130✔
138
                Fields: PayloadMap(t.Fields),
130✔
139
        }
130✔
140
}
141

142
func Memo(t *apiv1.Memo) *shared.Memo {
85✔
143
        if t == nil {
156✔
144
                return nil
71✔
145
        }
71✔
146
        return &shared.Memo{
14✔
147
                Fields: PayloadMap(t.Fields),
14✔
148
        }
14✔
149
}
150

151
func SearchAttributes(t *apiv1.SearchAttributes) *shared.SearchAttributes {
85✔
152
        if t == nil {
156✔
153
                return nil
71✔
154
        }
71✔
155
        return &shared.SearchAttributes{
14✔
156
                IndexedFields: PayloadMap(t.IndexedFields),
14✔
157
        }
14✔
158
}
159

160
func BadBinaries(t *apiv1.BadBinaries) *shared.BadBinaries {
98✔
161
        if t == nil {
98✔
162
                return nil
×
163
        }
×
164
        return &shared.BadBinaries{
98✔
165
                Binaries: BadBinaryInfoMap(t.Binaries),
98✔
166
        }
98✔
167
}
168

169
func BadBinaryInfo(t *apiv1.BadBinaryInfo) *shared.BadBinaryInfo {
×
170
        if t == nil {
×
171
                return nil
×
172
        }
×
173
        return &shared.BadBinaryInfo{
×
174
                Reason:          &t.Reason,
×
175
                Operator:        &t.Operator,
×
176
                CreatedTimeNano: timeToUnixNano(t.CreatedTime),
×
177
        }
×
178
}
179

180
func ClusterReplicationConfiguration(t *apiv1.ClusterReplicationConfiguration) *shared.ClusterReplicationConfiguration {
98✔
181
        if t == nil {
98✔
182
                return nil
×
183
        }
×
184
        return &shared.ClusterReplicationConfiguration{
98✔
185
                ClusterName: &t.ClusterName,
98✔
186
        }
98✔
187
}
188

189
func WorkflowQuery(t *apiv1.WorkflowQuery) *shared.WorkflowQuery {
177✔
190
        if t == nil {
350✔
191
                return nil
173✔
192
        }
173✔
193
        return &shared.WorkflowQuery{
4✔
194
                QueryType: &t.QueryType,
4✔
195
                QueryArgs: Payload(t.QueryArgs),
4✔
196
        }
4✔
197
}
198

199
func WorkflowQueryResult(t *apiv1.WorkflowQueryResult) *shared.WorkflowQueryResult {
×
200
        if t == nil {
×
201
                return nil
×
202
        }
×
203
        return &shared.WorkflowQueryResult{
×
204
                ResultType:   QueryResultType(t.ResultType),
×
205
                Answer:       Payload(t.Answer),
×
206
                ErrorMessage: &t.ErrorMessage,
×
207
        }
×
208
}
209

210
func StickyExecutionAttributes(t *apiv1.StickyExecutionAttributes) *shared.StickyExecutionAttributes {
×
211
        if t == nil {
×
212
                return nil
×
213
        }
×
214
        return &shared.StickyExecutionAttributes{
×
215
                WorkerTaskList:                TaskList(t.WorkerTaskList),
×
216
                ScheduleToStartTimeoutSeconds: durationToSeconds(t.ScheduleToStartTimeout),
×
217
        }
×
218
}
219

220
func WorkerVersionInfo(t *apiv1.WorkerVersionInfo) *shared.WorkerVersionInfo {
×
221
        if t == nil {
×
222
                return nil
×
223
        }
×
224
        return &shared.WorkerVersionInfo{
×
225
                Impl:           &t.Impl,
×
226
                FeatureVersion: &t.FeatureVersion,
×
227
        }
×
228
}
229

230
func StartTimeFilter(t *apiv1.StartTimeFilter) *shared.StartTimeFilter {
×
231
        if t == nil {
×
232
                return nil
×
233
        }
×
234
        return &shared.StartTimeFilter{
×
235
                EarliestTime: timeToUnixNano(t.EarliestTime),
×
236
                LatestTime:   timeToUnixNano(t.LatestTime),
×
237
        }
×
238
}
239

240
func WorkflowExecutionFilter(t *apiv1.WorkflowExecutionFilter) *shared.WorkflowExecutionFilter {
×
241
        if t == nil {
×
242
                return nil
×
243
        }
×
244
        return &shared.WorkflowExecutionFilter{
×
245
                WorkflowId: &t.WorkflowId,
×
246
                RunId:      &t.RunId,
×
247
        }
×
248
}
249

250
func WorkflowTypeFilter(t *apiv1.WorkflowTypeFilter) *shared.WorkflowTypeFilter {
×
251
        if t == nil {
×
252
                return nil
×
253
        }
×
254
        return &shared.WorkflowTypeFilter{
×
255
                Name: &t.Name,
×
256
        }
×
257
}
258

259
func StatusFilter(t *apiv1.StatusFilter) *shared.WorkflowExecutionCloseStatus {
×
260
        if t == nil {
×
261
                return nil
×
262
        }
×
263
        return WorkflowExecutionCloseStatus(t.Status)
×
264
}
265

266
func PayloadMap(t map[string]*apiv1.Payload) map[string][]byte {
158✔
267
        if t == nil {
291✔
268
                return nil
133✔
269
        }
133✔
270
        v := make(map[string][]byte, len(t))
25✔
271
        for key := range t {
50✔
272
                v[key] = Payload(t[key])
25✔
273
        }
25✔
274
        return v
25✔
275
}
276

277
func BadBinaryInfoMap(t map[string]*apiv1.BadBinaryInfo) map[string]*shared.BadBinaryInfo {
98✔
278
        if t == nil {
196✔
279
                return nil
98✔
280
        }
98✔
281
        v := make(map[string]*shared.BadBinaryInfo, len(t))
×
282
        for key := range t {
×
283
                v[key] = BadBinaryInfo(t[key])
×
284
        }
×
285
        return v
×
286
}
287

288
func ClusterReplicationConfigurationArray(t []*apiv1.ClusterReplicationConfiguration) []*shared.ClusterReplicationConfiguration {
98✔
289
        if t == nil {
98✔
290
                return nil
×
291
        }
×
292
        v := make([]*shared.ClusterReplicationConfiguration, len(t))
98✔
293
        for i := range t {
196✔
294
                v[i] = ClusterReplicationConfiguration(t[i])
98✔
295
        }
98✔
296
        return v
98✔
297
}
298

299
func WorkflowQueryResultMap(t map[string]*apiv1.WorkflowQueryResult) map[string]*shared.WorkflowQueryResult {
×
300
        if t == nil {
×
301
                return nil
×
302
        }
×
303
        v := make(map[string]*shared.WorkflowQueryResult, len(t))
×
304
        for key := range t {
×
305
                v[key] = WorkflowQueryResult(t[key])
×
306
        }
×
307
        return v
×
308
}
309

310
func DataBlob(t *apiv1.DataBlob) *shared.DataBlob {
×
311
        if t == nil {
×
312
                return nil
×
313
        }
×
314
        return &shared.DataBlob{
×
315
                EncodingType: EncodingType(t.EncodingType),
×
316
                Data:         t.Data,
×
317
        }
×
318
}
319

320
func ExternalInitiatedId(t *apiv1.ExternalExecutionInfo) *int64 {
2✔
321
        if t == nil {
3✔
322
                return nil
1✔
323
        }
1✔
324
        return &t.InitiatedId
1✔
325
}
326

327
func ExternalWorkflowExecution(t *apiv1.ExternalExecutionInfo) *shared.WorkflowExecution {
2✔
328
        if t == nil {
3✔
329
                return nil
1✔
330
        }
1✔
331
        return WorkflowExecution(t.WorkflowExecution)
1✔
332
}
333

334
func ResetPoints(t *apiv1.ResetPoints) *shared.ResetPoints {
63✔
335
        if t == nil {
111✔
336
                return nil
48✔
337
        }
48✔
338
        return &shared.ResetPoints{
15✔
339
                Points: ResetPointInfoArray(t.Points),
15✔
340
        }
15✔
341
}
342

343
func ResetPointInfo(t *apiv1.ResetPointInfo) *shared.ResetPointInfo {
15✔
344
        if t == nil {
15✔
345
                return nil
×
346
        }
×
347
        return &shared.ResetPointInfo{
15✔
348
                BinaryChecksum:           &t.BinaryChecksum,
15✔
349
                RunId:                    &t.RunId,
15✔
350
                FirstDecisionCompletedId: &t.FirstDecisionCompletedId,
15✔
351
                CreatedTimeNano:          timeToUnixNano(t.CreatedTime),
15✔
352
                ExpiringTimeNano:         timeToUnixNano(t.ExpiringTime),
15✔
353
                Resettable:               &t.Resettable,
15✔
354
        }
15✔
355
}
356

357
func PollerInfo(t *apiv1.PollerInfo) *shared.PollerInfo {
×
358
        if t == nil {
×
359
                return nil
×
360
        }
×
361
        return &shared.PollerInfo{
×
362
                LastAccessTime: timeToUnixNano(t.LastAccessTime),
×
363
                Identity:       &t.Identity,
×
364
                RatePerSecond:  &t.RatePerSecond,
×
365
        }
×
366
}
367

368
func TaskListStatus(t *apiv1.TaskListStatus) *shared.TaskListStatus {
×
369
        if t == nil {
×
370
                return nil
×
371
        }
×
372
        return &shared.TaskListStatus{
×
373
                BacklogCountHint: &t.BacklogCountHint,
×
374
                ReadLevel:        &t.ReadLevel,
×
375
                AckLevel:         &t.AckLevel,
×
376
                RatePerSecond:    &t.RatePerSecond,
×
377
                TaskIDBlock:      TaskIdBlock(t.TaskIdBlock),
×
378
        }
×
379
}
380

381
func TaskIdBlock(t *apiv1.TaskIDBlock) *shared.TaskIDBlock {
×
382
        if t == nil {
×
383
                return nil
×
384
        }
×
385
        return &shared.TaskIDBlock{
×
386
                StartID: &t.StartId,
×
387
                EndID:   &t.EndId,
×
388
        }
×
389
}
390

391
func WorkflowExecutionConfiguration(t *apiv1.WorkflowExecutionConfiguration) *shared.WorkflowExecutionConfiguration {
3✔
392
        if t == nil {
3✔
393
                return nil
×
394
        }
×
395
        return &shared.WorkflowExecutionConfiguration{
3✔
396
                TaskList:                            TaskList(t.TaskList),
3✔
397
                ExecutionStartToCloseTimeoutSeconds: durationToSeconds(t.ExecutionStartToCloseTimeout),
3✔
398
                TaskStartToCloseTimeoutSeconds:      durationToSeconds(t.TaskStartToCloseTimeout),
3✔
399
        }
3✔
400
}
401

402
func WorkflowExecutionInfo(t *apiv1.WorkflowExecutionInfo) *shared.WorkflowExecutionInfo {
3✔
403
        if t == nil {
3✔
404
                return nil
×
405
        }
×
406
        return &shared.WorkflowExecutionInfo{
3✔
407
                Execution:        WorkflowExecution(t.WorkflowExecution),
3✔
408
                Type:             WorkflowType(t.Type),
3✔
409
                StartTime:        timeToUnixNano(t.StartTime),
3✔
410
                CloseTime:        timeToUnixNano(t.CloseTime),
3✔
411
                CloseStatus:      WorkflowExecutionCloseStatus(t.CloseStatus),
3✔
412
                HistoryLength:    &t.HistoryLength,
3✔
413
                ParentDomainId:   ParentDomainId(t.ParentExecutionInfo),
3✔
414
                ParentExecution:  ParentWorkflowExecution(t.ParentExecutionInfo),
3✔
415
                ExecutionTime:    timeToUnixNano(t.ExecutionTime),
3✔
416
                Memo:             Memo(t.Memo),
3✔
417
                SearchAttributes: SearchAttributes(t.SearchAttributes),
3✔
418
                AutoResetPoints:  ResetPoints(t.AutoResetPoints),
3✔
419
                TaskList:         &t.TaskList,
3✔
420
                IsCron:           &t.IsCron,
3✔
421
        }
3✔
422
}
423

424
func ParentDomainId(pei *apiv1.ParentExecutionInfo) *string {
3✔
425
        if pei == nil {
3✔
426
                return nil
×
427
        }
×
428
        return &pei.DomainId
3✔
429
}
430

431
func ParentDomainName(pei *apiv1.ParentExecutionInfo) *string {
60✔
432
        if pei == nil {
104✔
433
                return nil
44✔
434
        }
44✔
435
        return &pei.DomainName
16✔
436
}
437

438
func ParentInitiatedId(pei *apiv1.ParentExecutionInfo) *int64 {
60✔
439
        if pei == nil {
104✔
440
                return nil
44✔
441
        }
44✔
442
        return &pei.InitiatedId
16✔
443
}
444

445
func ParentWorkflowExecution(pei *apiv1.ParentExecutionInfo) *shared.WorkflowExecution {
63✔
446
        if pei == nil {
107✔
447
                return nil
44✔
448
        }
44✔
449
        return WorkflowExecution(pei.WorkflowExecution)
19✔
450
}
451

452
func PendingActivityInfo(t *apiv1.PendingActivityInfo) *shared.PendingActivityInfo {
3✔
453
        if t == nil {
3✔
454
                return nil
×
455
        }
×
456
        return &shared.PendingActivityInfo{
3✔
457
                ActivityID:             &t.ActivityId,
3✔
458
                ActivityType:           ActivityType(t.ActivityType),
3✔
459
                State:                  PendingActivityState(t.State),
3✔
460
                HeartbeatDetails:       Payload(t.HeartbeatDetails),
3✔
461
                LastHeartbeatTimestamp: timeToUnixNano(t.LastHeartbeatTime),
3✔
462
                LastStartedTimestamp:   timeToUnixNano(t.LastStartedTime),
3✔
463
                Attempt:                &t.Attempt,
3✔
464
                MaximumAttempts:        &t.MaximumAttempts,
3✔
465
                ScheduledTimestamp:     timeToUnixNano(t.ScheduledTime),
3✔
466
                ExpirationTimestamp:    timeToUnixNano(t.ExpirationTime),
3✔
467
                LastFailureReason:      FailureReason(t.LastFailure),
3✔
468
                LastFailureDetails:     FailureDetails(t.LastFailure),
3✔
469
                LastWorkerIdentity:     &t.LastWorkerIdentity,
3✔
470
        }
3✔
471
}
472

473
func PendingChildExecutionInfo(t *apiv1.PendingChildExecutionInfo) *shared.PendingChildExecutionInfo {
×
474
        if t == nil {
×
475
                return nil
×
476
        }
×
477
        return &shared.PendingChildExecutionInfo{
×
478
                WorkflowID:        WorkflowId(t.WorkflowExecution),
×
479
                RunID:             RunId(t.WorkflowExecution),
×
480
                WorkflowTypName:   &t.WorkflowTypeName,
×
481
                InitiatedID:       &t.InitiatedId,
×
482
                ParentClosePolicy: ParentClosePolicy(t.ParentClosePolicy),
×
483
        }
×
484
}
485

486
func PendingDecisionInfo(t *apiv1.PendingDecisionInfo) *shared.PendingDecisionInfo {
3✔
487
        if t == nil {
6✔
488
                return nil
3✔
489
        }
3✔
490
        return &shared.PendingDecisionInfo{
×
491
                State:                      PendingDecisionState(t.State),
×
492
                ScheduledTimestamp:         timeToUnixNano(t.ScheduledTime),
×
493
                StartedTimestamp:           timeToUnixNano(t.StartedTime),
×
494
                Attempt:                    common.Int64Ptr(int64(t.Attempt)),
×
495
                OriginalScheduledTimestamp: timeToUnixNano(t.OriginalScheduledTime),
×
496
        }
×
497
}
498

499
func ActivityLocalDispatchInfo(t *apiv1.ActivityLocalDispatchInfo) *shared.ActivityLocalDispatchInfo {
29✔
500
        if t == nil {
29✔
501
                return nil
×
502
        }
×
503
        return &shared.ActivityLocalDispatchInfo{
29✔
504
                ActivityId:                      &t.ActivityId,
29✔
505
                ScheduledTimestamp:              timeToUnixNano(t.ScheduledTime),
29✔
506
                StartedTimestamp:                timeToUnixNano(t.StartedTime),
29✔
507
                ScheduledTimestampOfThisAttempt: timeToUnixNano(t.ScheduledTimeOfThisAttempt),
29✔
508
                TaskToken:                       t.TaskToken,
29✔
509
        }
29✔
510
}
511

512
func SupportedClientVersions(t *apiv1.SupportedClientVersions) *shared.SupportedClientVersions {
×
513
        if t == nil {
×
514
                return nil
×
515
        }
×
516
        return &shared.SupportedClientVersions{
×
517
                GoSdk:   &t.GoSdk,
×
518
                JavaSdk: &t.JavaSdk,
×
519
        }
×
520
}
521

522
func DescribeDomainResponseDomain(t *apiv1.Domain) *shared.DescribeDomainResponse {
×
523
        if t == nil {
×
524
                return nil
×
525
        }
×
526
        return &shared.DescribeDomainResponse{
×
527
                DomainInfo: &shared.DomainInfo{
×
528
                        Name:        &t.Name,
×
529
                        Status:      DomainStatus(t.Status),
×
530
                        Description: &t.Description,
×
531
                        OwnerEmail:  &t.OwnerEmail,
×
532
                        Data:        t.Data,
×
533
                        UUID:        &t.Id,
×
534
                },
×
535
                Configuration: &shared.DomainConfiguration{
×
536
                        WorkflowExecutionRetentionPeriodInDays: durationToDays(t.WorkflowExecutionRetentionPeriod),
×
537
                        EmitMetric:                             boolPtr(true),
×
538
                        BadBinaries:                            BadBinaries(t.BadBinaries),
×
539
                        HistoryArchivalStatus:                  ArchivalStatus(t.HistoryArchivalStatus),
×
540
                        HistoryArchivalURI:                     &t.HistoryArchivalUri,
×
541
                        VisibilityArchivalStatus:               ArchivalStatus(t.VisibilityArchivalStatus),
×
542
                        VisibilityArchivalURI:                  &t.VisibilityArchivalUri,
×
543
                },
×
544
                ReplicationConfiguration: &shared.DomainReplicationConfiguration{
×
545
                        ActiveClusterName: &t.ActiveClusterName,
×
546
                        Clusters:          ClusterReplicationConfigurationArray(t.Clusters),
×
547
                },
×
548
                FailoverVersion: &t.FailoverVersion,
×
549
                IsGlobalDomain:  &t.IsGlobalDomain,
×
550
        }
×
551
}
552

553
func TaskListPartitionMetadata(t *apiv1.TaskListPartitionMetadata) *shared.TaskListPartitionMetadata {
×
554
        if t == nil {
×
555
                return nil
×
556
        }
×
557
        return &shared.TaskListPartitionMetadata{
×
558
                Key:           &t.Key,
×
559
                OwnerHostName: &t.OwnerHostName,
×
560
        }
×
561
}
562

563
func QueryRejected(t *apiv1.QueryRejected) *shared.QueryRejected {
4✔
564
        if t == nil {
8✔
565
                return nil
4✔
566
        }
4✔
567
        return &shared.QueryRejected{
×
568
                CloseStatus: WorkflowExecutionCloseStatus(t.CloseStatus),
×
569
        }
×
570
}
571

572
func PollerInfoArray(t []*apiv1.PollerInfo) []*shared.PollerInfo {
×
573
        if t == nil {
×
574
                return nil
×
575
        }
×
576
        v := make([]*shared.PollerInfo, len(t))
×
577
        for i := range t {
×
578
                v[i] = PollerInfo(t[i])
×
579
        }
×
580
        return v
×
581
}
582

583
func ResetPointInfoArray(t []*apiv1.ResetPointInfo) []*shared.ResetPointInfo {
15✔
584
        if t == nil {
15✔
585
                return nil
×
586
        }
×
587
        v := make([]*shared.ResetPointInfo, len(t))
15✔
588
        for i := range t {
30✔
589
                v[i] = ResetPointInfo(t[i])
15✔
590
        }
15✔
591
        return v
15✔
592
}
593

594
func PendingActivityInfoArray(t []*apiv1.PendingActivityInfo) []*shared.PendingActivityInfo {
3✔
595
        if t == nil {
3✔
596
                return nil
×
597
        }
×
598
        v := make([]*shared.PendingActivityInfo, len(t))
3✔
599
        for i := range t {
6✔
600
                v[i] = PendingActivityInfo(t[i])
3✔
601
        }
3✔
602
        return v
3✔
603
}
604

605
func PendingChildExecutionInfoArray(t []*apiv1.PendingChildExecutionInfo) []*shared.PendingChildExecutionInfo {
3✔
606
        if t == nil {
6✔
607
                return nil
3✔
608
        }
3✔
609
        v := make([]*shared.PendingChildExecutionInfo, len(t))
×
610
        for i := range t {
×
611
                v[i] = PendingChildExecutionInfo(t[i])
×
612
        }
×
613
        return v
×
614
}
615

616
func IndexedValueTypeMap(t map[string]apiv1.IndexedValueType) map[string]shared.IndexedValueType {
×
617
        if t == nil {
×
618
                return nil
×
619
        }
×
620
        v := make(map[string]shared.IndexedValueType, len(t))
×
621
        for key := range t {
×
622
                v[key] = IndexedValueType(t[key])
×
623
        }
×
624
        return v
×
625
}
626

627
func DataBlobArray(t []*apiv1.DataBlob) []*shared.DataBlob {
36✔
628
        if t == nil {
72✔
629
                return nil
36✔
630
        }
36✔
631
        v := make([]*shared.DataBlob, len(t))
×
632
        for i := range t {
×
633
                v[i] = DataBlob(t[i])
×
634
        }
×
635
        return v
×
636
}
637

638
func WorkflowExecutionInfoArray(t []*apiv1.WorkflowExecutionInfo) []*shared.WorkflowExecutionInfo {
×
639
        if t == nil {
×
640
                return nil
×
641
        }
×
642
        v := make([]*shared.WorkflowExecutionInfo, len(t))
×
643
        for i := range t {
×
644
                v[i] = WorkflowExecutionInfo(t[i])
×
645
        }
×
646
        return v
×
647
}
648

649
func DescribeDomainResponseArray(t []*apiv1.Domain) []*shared.DescribeDomainResponse {
×
650
        if t == nil {
×
651
                return nil
×
652
        }
×
653
        v := make([]*shared.DescribeDomainResponse, len(t))
×
654
        for i := range t {
×
655
                v[i] = DescribeDomainResponseDomain(t[i])
×
656
        }
×
657
        return v
×
658
}
659

660
func TaskListPartitionMetadataArray(t []*apiv1.TaskListPartitionMetadata) []*shared.TaskListPartitionMetadata {
×
661
        if t == nil {
×
662
                return nil
×
663
        }
×
664
        v := make([]*shared.TaskListPartitionMetadata, len(t))
×
665
        for i := range t {
×
666
                v[i] = TaskListPartitionMetadata(t[i])
×
667
        }
×
668
        return v
×
669
}
670

671
func WorkflowQueryMap(t map[string]*apiv1.WorkflowQuery) map[string]*shared.WorkflowQuery {
176✔
672
        if t == nil {
351✔
673
                return nil
175✔
674
        }
175✔
675
        v := make(map[string]*shared.WorkflowQuery, len(t))
1✔
676
        for key := range t {
2✔
677
                v[key] = WorkflowQuery(t[key])
1✔
678
        }
1✔
679
        return v
1✔
680
}
681

682
func ActivityLocalDispatchInfoMap(t map[string]*apiv1.ActivityLocalDispatchInfo) map[string]*shared.ActivityLocalDispatchInfo {
109✔
683
        if t == nil {
189✔
684
                return nil
80✔
685
        }
80✔
686
        v := make(map[string]*shared.ActivityLocalDispatchInfo, len(t))
29✔
687
        for key := range t {
58✔
688
                v[key] = ActivityLocalDispatchInfo(t[key])
29✔
689
        }
29✔
690
        return v
29✔
691
}
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

© 2025 Coveralls, Inc