File: mock_api.go

package info (click to toggle)
gh 2.23.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,040 kB
  • sloc: asm: 6,813; ansic: 258; sh: 100; makefile: 96
file content (863 lines) | stat: -rw-r--r-- 29,365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package codespace

import (
	"context"
	"sync"

	"github.com/cli/cli/v2/internal/codespaces/api"
)

// apiClientMock is a mock implementation of apiClient.
//
//	func TestSomethingThatUsesapiClient(t *testing.T) {
//
//		// make and configure a mocked apiClient
//		mockedapiClient := &apiClientMock{
//			CreateCodespaceFunc: func(ctx context.Context, params *api.CreateCodespaceParams) (*api.Codespace, error) {
//				panic("mock out the CreateCodespace method")
//			},
//			DeleteCodespaceFunc: func(ctx context.Context, name string, orgName string, userName string) error {
//				panic("mock out the DeleteCodespace method")
//			},
//			EditCodespaceFunc: func(ctx context.Context, codespaceName string, params *api.EditCodespaceParams) (*api.Codespace, error) {
//				panic("mock out the EditCodespace method")
//			},
//			GetCodespaceFunc: func(ctx context.Context, name string, includeConnection bool) (*api.Codespace, error) {
//				panic("mock out the GetCodespace method")
//			},
//			GetCodespaceBillableOwnerFunc: func(ctx context.Context, nwo string) (*api.User, error) {
//				panic("mock out the GetCodespaceBillableOwner method")
//			},
//			GetCodespaceRepoSuggestionsFunc: func(ctx context.Context, partialSearch string, params api.RepoSearchParameters) ([]string, error) {
//				panic("mock out the GetCodespaceRepoSuggestions method")
//			},
//			GetCodespaceRepositoryContentsFunc: func(ctx context.Context, codespace *api.Codespace, path string) ([]byte, error) {
//				panic("mock out the GetCodespaceRepositoryContents method")
//			},
//			GetCodespacesMachinesFunc: func(ctx context.Context, repoID int, branch string, location string, devcontainerPath string) ([]*api.Machine, error) {
//				panic("mock out the GetCodespacesMachines method")
//			},
//			GetOrgMemberCodespaceFunc: func(ctx context.Context, orgName string, userName string, codespaceName string) (*api.Codespace, error) {
//				panic("mock out the GetOrgMemberCodespace method")
//			},
//			GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) {
//				panic("mock out the GetRepository method")
//			},
//			GetUserFunc: func(ctx context.Context) (*api.User, error) {
//				panic("mock out the GetUser method")
//			},
//			ListCodespacesFunc: func(ctx context.Context, opts api.ListCodespacesOptions) ([]*api.Codespace, error) {
//				panic("mock out the ListCodespaces method")
//			},
//			ListDevContainersFunc: func(ctx context.Context, repoID int, branch string, limit int) ([]api.DevContainerEntry, error) {
//				panic("mock out the ListDevContainers method")
//			},
//			StartCodespaceFunc: func(ctx context.Context, name string) error {
//				panic("mock out the StartCodespace method")
//			},
//			StopCodespaceFunc: func(ctx context.Context, name string, orgName string, userName string) error {
//				panic("mock out the StopCodespace method")
//			},
//		}
//
//		// use mockedapiClient in code that requires apiClient
//		// and then make assertions.
//
//	}
type apiClientMock struct {
	// CreateCodespaceFunc mocks the CreateCodespace method.
	CreateCodespaceFunc func(ctx context.Context, params *api.CreateCodespaceParams) (*api.Codespace, error)

	// DeleteCodespaceFunc mocks the DeleteCodespace method.
	DeleteCodespaceFunc func(ctx context.Context, name string, orgName string, userName string) error

	// EditCodespaceFunc mocks the EditCodespace method.
	EditCodespaceFunc func(ctx context.Context, codespaceName string, params *api.EditCodespaceParams) (*api.Codespace, error)

	// GetCodespaceFunc mocks the GetCodespace method.
	GetCodespaceFunc func(ctx context.Context, name string, includeConnection bool) (*api.Codespace, error)

	// GetCodespaceBillableOwnerFunc mocks the GetCodespaceBillableOwner method.
	GetCodespaceBillableOwnerFunc func(ctx context.Context, nwo string) (*api.User, error)

	// GetCodespaceRepoSuggestionsFunc mocks the GetCodespaceRepoSuggestions method.
	GetCodespaceRepoSuggestionsFunc func(ctx context.Context, partialSearch string, params api.RepoSearchParameters) ([]string, error)

	// GetCodespaceRepositoryContentsFunc mocks the GetCodespaceRepositoryContents method.
	GetCodespaceRepositoryContentsFunc func(ctx context.Context, codespace *api.Codespace, path string) ([]byte, error)

	// GetCodespacesMachinesFunc mocks the GetCodespacesMachines method.
	GetCodespacesMachinesFunc func(ctx context.Context, repoID int, branch string, location string, devcontainerPath string) ([]*api.Machine, error)

	// GetOrgMemberCodespaceFunc mocks the GetOrgMemberCodespace method.
	GetOrgMemberCodespaceFunc func(ctx context.Context, orgName string, userName string, codespaceName string) (*api.Codespace, error)

	// GetRepositoryFunc mocks the GetRepository method.
	GetRepositoryFunc func(ctx context.Context, nwo string) (*api.Repository, error)

	// GetUserFunc mocks the GetUser method.
	GetUserFunc func(ctx context.Context) (*api.User, error)

	// ListCodespacesFunc mocks the ListCodespaces method.
	ListCodespacesFunc func(ctx context.Context, opts api.ListCodespacesOptions) ([]*api.Codespace, error)

	// ListDevContainersFunc mocks the ListDevContainers method.
	ListDevContainersFunc func(ctx context.Context, repoID int, branch string, limit int) ([]api.DevContainerEntry, error)

	// StartCodespaceFunc mocks the StartCodespace method.
	StartCodespaceFunc func(ctx context.Context, name string) error

	// StopCodespaceFunc mocks the StopCodespace method.
	StopCodespaceFunc func(ctx context.Context, name string, orgName string, userName string) error

	// calls tracks calls to the methods.
	calls struct {
		// CreateCodespace holds details about calls to the CreateCodespace method.
		CreateCodespace []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Params is the params argument value.
			Params *api.CreateCodespaceParams
		}
		// DeleteCodespace holds details about calls to the DeleteCodespace method.
		DeleteCodespace []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Name is the name argument value.
			Name string
			// OrgName is the orgName argument value.
			OrgName string
			// UserName is the userName argument value.
			UserName string
		}
		// EditCodespace holds details about calls to the EditCodespace method.
		EditCodespace []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// CodespaceName is the codespaceName argument value.
			CodespaceName string
			// Params is the params argument value.
			Params *api.EditCodespaceParams
		}
		// GetCodespace holds details about calls to the GetCodespace method.
		GetCodespace []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Name is the name argument value.
			Name string
			// IncludeConnection is the includeConnection argument value.
			IncludeConnection bool
		}
		// GetCodespaceBillableOwner holds details about calls to the GetCodespaceBillableOwner method.
		GetCodespaceBillableOwner []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Nwo is the nwo argument value.
			Nwo string
		}
		// GetCodespaceRepoSuggestions holds details about calls to the GetCodespaceRepoSuggestions method.
		GetCodespaceRepoSuggestions []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// PartialSearch is the partialSearch argument value.
			PartialSearch string
			// Params is the params argument value.
			Params api.RepoSearchParameters
		}
		// GetCodespaceRepositoryContents holds details about calls to the GetCodespaceRepositoryContents method.
		GetCodespaceRepositoryContents []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Codespace is the codespace argument value.
			Codespace *api.Codespace
			// Path is the path argument value.
			Path string
		}
		// GetCodespacesMachines holds details about calls to the GetCodespacesMachines method.
		GetCodespacesMachines []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// RepoID is the repoID argument value.
			RepoID int
			// Branch is the branch argument value.
			Branch string
			// Location is the location argument value.
			Location string
			// DevcontainerPath is the devcontainerPath argument value.
			DevcontainerPath string
		}
		// GetOrgMemberCodespace holds details about calls to the GetOrgMemberCodespace method.
		GetOrgMemberCodespace []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// OrgName is the orgName argument value.
			OrgName string
			// UserName is the userName argument value.
			UserName string
			// CodespaceName is the codespaceName argument value.
			CodespaceName string
		}
		// GetRepository holds details about calls to the GetRepository method.
		GetRepository []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Nwo is the nwo argument value.
			Nwo string
		}
		// GetUser holds details about calls to the GetUser method.
		GetUser []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
		}
		// ListCodespaces holds details about calls to the ListCodespaces method.
		ListCodespaces []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Opts is the opts argument value.
			Opts api.ListCodespacesOptions
		}
		// ListDevContainers holds details about calls to the ListDevContainers method.
		ListDevContainers []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// RepoID is the repoID argument value.
			RepoID int
			// Branch is the branch argument value.
			Branch string
			// Limit is the limit argument value.
			Limit int
		}
		// StartCodespace holds details about calls to the StartCodespace method.
		StartCodespace []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Name is the name argument value.
			Name string
		}
		// StopCodespace holds details about calls to the StopCodespace method.
		StopCodespace []struct {
			// Ctx is the ctx argument value.
			Ctx context.Context
			// Name is the name argument value.
			Name string
			// OrgName is the orgName argument value.
			OrgName string
			// UserName is the userName argument value.
			UserName string
		}
	}
	lockCreateCodespace                sync.RWMutex
	lockDeleteCodespace                sync.RWMutex
	lockEditCodespace                  sync.RWMutex
	lockGetCodespace                   sync.RWMutex
	lockGetCodespaceBillableOwner      sync.RWMutex
	lockGetCodespaceRepoSuggestions    sync.RWMutex
	lockGetCodespaceRepositoryContents sync.RWMutex
	lockGetCodespacesMachines          sync.RWMutex
	lockGetOrgMemberCodespace          sync.RWMutex
	lockGetRepository                  sync.RWMutex
	lockGetUser                        sync.RWMutex
	lockListCodespaces                 sync.RWMutex
	lockListDevContainers              sync.RWMutex
	lockStartCodespace                 sync.RWMutex
	lockStopCodespace                  sync.RWMutex
}

// CreateCodespace calls CreateCodespaceFunc.
func (mock *apiClientMock) CreateCodespace(ctx context.Context, params *api.CreateCodespaceParams) (*api.Codespace, error) {
	if mock.CreateCodespaceFunc == nil {
		panic("apiClientMock.CreateCodespaceFunc: method is nil but apiClient.CreateCodespace was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		Params *api.CreateCodespaceParams
	}{
		Ctx:    ctx,
		Params: params,
	}
	mock.lockCreateCodespace.Lock()
	mock.calls.CreateCodespace = append(mock.calls.CreateCodespace, callInfo)
	mock.lockCreateCodespace.Unlock()
	return mock.CreateCodespaceFunc(ctx, params)
}

// CreateCodespaceCalls gets all the calls that were made to CreateCodespace.
// Check the length with:
//
//	len(mockedapiClient.CreateCodespaceCalls())
func (mock *apiClientMock) CreateCodespaceCalls() []struct {
	Ctx    context.Context
	Params *api.CreateCodespaceParams
} {
	var calls []struct {
		Ctx    context.Context
		Params *api.CreateCodespaceParams
	}
	mock.lockCreateCodespace.RLock()
	calls = mock.calls.CreateCodespace
	mock.lockCreateCodespace.RUnlock()
	return calls
}

// DeleteCodespace calls DeleteCodespaceFunc.
func (mock *apiClientMock) DeleteCodespace(ctx context.Context, name string, orgName string, userName string) error {
	if mock.DeleteCodespaceFunc == nil {
		panic("apiClientMock.DeleteCodespaceFunc: method is nil but apiClient.DeleteCodespace was just called")
	}
	callInfo := struct {
		Ctx      context.Context
		Name     string
		OrgName  string
		UserName string
	}{
		Ctx:      ctx,
		Name:     name,
		OrgName:  orgName,
		UserName: userName,
	}
	mock.lockDeleteCodespace.Lock()
	mock.calls.DeleteCodespace = append(mock.calls.DeleteCodespace, callInfo)
	mock.lockDeleteCodespace.Unlock()
	return mock.DeleteCodespaceFunc(ctx, name, orgName, userName)
}

// DeleteCodespaceCalls gets all the calls that were made to DeleteCodespace.
// Check the length with:
//
//	len(mockedapiClient.DeleteCodespaceCalls())
func (mock *apiClientMock) DeleteCodespaceCalls() []struct {
	Ctx      context.Context
	Name     string
	OrgName  string
	UserName string
} {
	var calls []struct {
		Ctx      context.Context
		Name     string
		OrgName  string
		UserName string
	}
	mock.lockDeleteCodespace.RLock()
	calls = mock.calls.DeleteCodespace
	mock.lockDeleteCodespace.RUnlock()
	return calls
}

// EditCodespace calls EditCodespaceFunc.
func (mock *apiClientMock) EditCodespace(ctx context.Context, codespaceName string, params *api.EditCodespaceParams) (*api.Codespace, error) {
	if mock.EditCodespaceFunc == nil {
		panic("apiClientMock.EditCodespaceFunc: method is nil but apiClient.EditCodespace was just called")
	}
	callInfo := struct {
		Ctx           context.Context
		CodespaceName string
		Params        *api.EditCodespaceParams
	}{
		Ctx:           ctx,
		CodespaceName: codespaceName,
		Params:        params,
	}
	mock.lockEditCodespace.Lock()
	mock.calls.EditCodespace = append(mock.calls.EditCodespace, callInfo)
	mock.lockEditCodespace.Unlock()
	return mock.EditCodespaceFunc(ctx, codespaceName, params)
}

// EditCodespaceCalls gets all the calls that were made to EditCodespace.
// Check the length with:
//
//	len(mockedapiClient.EditCodespaceCalls())
func (mock *apiClientMock) EditCodespaceCalls() []struct {
	Ctx           context.Context
	CodespaceName string
	Params        *api.EditCodespaceParams
} {
	var calls []struct {
		Ctx           context.Context
		CodespaceName string
		Params        *api.EditCodespaceParams
	}
	mock.lockEditCodespace.RLock()
	calls = mock.calls.EditCodespace
	mock.lockEditCodespace.RUnlock()
	return calls
}

// GetCodespace calls GetCodespaceFunc.
func (mock *apiClientMock) GetCodespace(ctx context.Context, name string, includeConnection bool) (*api.Codespace, error) {
	if mock.GetCodespaceFunc == nil {
		panic("apiClientMock.GetCodespaceFunc: method is nil but apiClient.GetCodespace was just called")
	}
	callInfo := struct {
		Ctx               context.Context
		Name              string
		IncludeConnection bool
	}{
		Ctx:               ctx,
		Name:              name,
		IncludeConnection: includeConnection,
	}
	mock.lockGetCodespace.Lock()
	mock.calls.GetCodespace = append(mock.calls.GetCodespace, callInfo)
	mock.lockGetCodespace.Unlock()
	return mock.GetCodespaceFunc(ctx, name, includeConnection)
}

// GetCodespaceCalls gets all the calls that were made to GetCodespace.
// Check the length with:
//
//	len(mockedapiClient.GetCodespaceCalls())
func (mock *apiClientMock) GetCodespaceCalls() []struct {
	Ctx               context.Context
	Name              string
	IncludeConnection bool
} {
	var calls []struct {
		Ctx               context.Context
		Name              string
		IncludeConnection bool
	}
	mock.lockGetCodespace.RLock()
	calls = mock.calls.GetCodespace
	mock.lockGetCodespace.RUnlock()
	return calls
}

// GetCodespaceBillableOwner calls GetCodespaceBillableOwnerFunc.
func (mock *apiClientMock) GetCodespaceBillableOwner(ctx context.Context, nwo string) (*api.User, error) {
	if mock.GetCodespaceBillableOwnerFunc == nil {
		panic("apiClientMock.GetCodespaceBillableOwnerFunc: method is nil but apiClient.GetCodespaceBillableOwner was just called")
	}
	callInfo := struct {
		Ctx context.Context
		Nwo string
	}{
		Ctx: ctx,
		Nwo: nwo,
	}
	mock.lockGetCodespaceBillableOwner.Lock()
	mock.calls.GetCodespaceBillableOwner = append(mock.calls.GetCodespaceBillableOwner, callInfo)
	mock.lockGetCodespaceBillableOwner.Unlock()
	return mock.GetCodespaceBillableOwnerFunc(ctx, nwo)
}

// GetCodespaceBillableOwnerCalls gets all the calls that were made to GetCodespaceBillableOwner.
// Check the length with:
//
//	len(mockedapiClient.GetCodespaceBillableOwnerCalls())
func (mock *apiClientMock) GetCodespaceBillableOwnerCalls() []struct {
	Ctx context.Context
	Nwo string
} {
	var calls []struct {
		Ctx context.Context
		Nwo string
	}
	mock.lockGetCodespaceBillableOwner.RLock()
	calls = mock.calls.GetCodespaceBillableOwner
	mock.lockGetCodespaceBillableOwner.RUnlock()
	return calls
}

// GetCodespaceRepoSuggestions calls GetCodespaceRepoSuggestionsFunc.
func (mock *apiClientMock) GetCodespaceRepoSuggestions(ctx context.Context, partialSearch string, params api.RepoSearchParameters) ([]string, error) {
	if mock.GetCodespaceRepoSuggestionsFunc == nil {
		panic("apiClientMock.GetCodespaceRepoSuggestionsFunc: method is nil but apiClient.GetCodespaceRepoSuggestions was just called")
	}
	callInfo := struct {
		Ctx           context.Context
		PartialSearch string
		Params        api.RepoSearchParameters
	}{
		Ctx:           ctx,
		PartialSearch: partialSearch,
		Params:        params,
	}
	mock.lockGetCodespaceRepoSuggestions.Lock()
	mock.calls.GetCodespaceRepoSuggestions = append(mock.calls.GetCodespaceRepoSuggestions, callInfo)
	mock.lockGetCodespaceRepoSuggestions.Unlock()
	return mock.GetCodespaceRepoSuggestionsFunc(ctx, partialSearch, params)
}

// GetCodespaceRepoSuggestionsCalls gets all the calls that were made to GetCodespaceRepoSuggestions.
// Check the length with:
//
//	len(mockedapiClient.GetCodespaceRepoSuggestionsCalls())
func (mock *apiClientMock) GetCodespaceRepoSuggestionsCalls() []struct {
	Ctx           context.Context
	PartialSearch string
	Params        api.RepoSearchParameters
} {
	var calls []struct {
		Ctx           context.Context
		PartialSearch string
		Params        api.RepoSearchParameters
	}
	mock.lockGetCodespaceRepoSuggestions.RLock()
	calls = mock.calls.GetCodespaceRepoSuggestions
	mock.lockGetCodespaceRepoSuggestions.RUnlock()
	return calls
}

// GetCodespaceRepositoryContents calls GetCodespaceRepositoryContentsFunc.
func (mock *apiClientMock) GetCodespaceRepositoryContents(ctx context.Context, codespace *api.Codespace, path string) ([]byte, error) {
	if mock.GetCodespaceRepositoryContentsFunc == nil {
		panic("apiClientMock.GetCodespaceRepositoryContentsFunc: method is nil but apiClient.GetCodespaceRepositoryContents was just called")
	}
	callInfo := struct {
		Ctx       context.Context
		Codespace *api.Codespace
		Path      string
	}{
		Ctx:       ctx,
		Codespace: codespace,
		Path:      path,
	}
	mock.lockGetCodespaceRepositoryContents.Lock()
	mock.calls.GetCodespaceRepositoryContents = append(mock.calls.GetCodespaceRepositoryContents, callInfo)
	mock.lockGetCodespaceRepositoryContents.Unlock()
	return mock.GetCodespaceRepositoryContentsFunc(ctx, codespace, path)
}

// GetCodespaceRepositoryContentsCalls gets all the calls that were made to GetCodespaceRepositoryContents.
// Check the length with:
//
//	len(mockedapiClient.GetCodespaceRepositoryContentsCalls())
func (mock *apiClientMock) GetCodespaceRepositoryContentsCalls() []struct {
	Ctx       context.Context
	Codespace *api.Codespace
	Path      string
} {
	var calls []struct {
		Ctx       context.Context
		Codespace *api.Codespace
		Path      string
	}
	mock.lockGetCodespaceRepositoryContents.RLock()
	calls = mock.calls.GetCodespaceRepositoryContents
	mock.lockGetCodespaceRepositoryContents.RUnlock()
	return calls
}

// GetCodespacesMachines calls GetCodespacesMachinesFunc.
func (mock *apiClientMock) GetCodespacesMachines(ctx context.Context, repoID int, branch string, location string, devcontainerPath string) ([]*api.Machine, error) {
	if mock.GetCodespacesMachinesFunc == nil {
		panic("apiClientMock.GetCodespacesMachinesFunc: method is nil but apiClient.GetCodespacesMachines was just called")
	}
	callInfo := struct {
		Ctx              context.Context
		RepoID           int
		Branch           string
		Location         string
		DevcontainerPath string
	}{
		Ctx:              ctx,
		RepoID:           repoID,
		Branch:           branch,
		Location:         location,
		DevcontainerPath: devcontainerPath,
	}
	mock.lockGetCodespacesMachines.Lock()
	mock.calls.GetCodespacesMachines = append(mock.calls.GetCodespacesMachines, callInfo)
	mock.lockGetCodespacesMachines.Unlock()
	return mock.GetCodespacesMachinesFunc(ctx, repoID, branch, location, devcontainerPath)
}

// GetCodespacesMachinesCalls gets all the calls that were made to GetCodespacesMachines.
// Check the length with:
//
//	len(mockedapiClient.GetCodespacesMachinesCalls())
func (mock *apiClientMock) GetCodespacesMachinesCalls() []struct {
	Ctx              context.Context
	RepoID           int
	Branch           string
	Location         string
	DevcontainerPath string
} {
	var calls []struct {
		Ctx              context.Context
		RepoID           int
		Branch           string
		Location         string
		DevcontainerPath string
	}
	mock.lockGetCodespacesMachines.RLock()
	calls = mock.calls.GetCodespacesMachines
	mock.lockGetCodespacesMachines.RUnlock()
	return calls
}

// GetOrgMemberCodespace calls GetOrgMemberCodespaceFunc.
func (mock *apiClientMock) GetOrgMemberCodespace(ctx context.Context, orgName string, userName string, codespaceName string) (*api.Codespace, error) {
	if mock.GetOrgMemberCodespaceFunc == nil {
		panic("apiClientMock.GetOrgMemberCodespaceFunc: method is nil but apiClient.GetOrgMemberCodespace was just called")
	}
	callInfo := struct {
		Ctx           context.Context
		OrgName       string
		UserName      string
		CodespaceName string
	}{
		Ctx:           ctx,
		OrgName:       orgName,
		UserName:      userName,
		CodespaceName: codespaceName,
	}
	mock.lockGetOrgMemberCodespace.Lock()
	mock.calls.GetOrgMemberCodespace = append(mock.calls.GetOrgMemberCodespace, callInfo)
	mock.lockGetOrgMemberCodespace.Unlock()
	return mock.GetOrgMemberCodespaceFunc(ctx, orgName, userName, codespaceName)
}

// GetOrgMemberCodespaceCalls gets all the calls that were made to GetOrgMemberCodespace.
// Check the length with:
//
//	len(mockedapiClient.GetOrgMemberCodespaceCalls())
func (mock *apiClientMock) GetOrgMemberCodespaceCalls() []struct {
	Ctx           context.Context
	OrgName       string
	UserName      string
	CodespaceName string
} {
	var calls []struct {
		Ctx           context.Context
		OrgName       string
		UserName      string
		CodespaceName string
	}
	mock.lockGetOrgMemberCodespace.RLock()
	calls = mock.calls.GetOrgMemberCodespace
	mock.lockGetOrgMemberCodespace.RUnlock()
	return calls
}

// GetRepository calls GetRepositoryFunc.
func (mock *apiClientMock) GetRepository(ctx context.Context, nwo string) (*api.Repository, error) {
	if mock.GetRepositoryFunc == nil {
		panic("apiClientMock.GetRepositoryFunc: method is nil but apiClient.GetRepository was just called")
	}
	callInfo := struct {
		Ctx context.Context
		Nwo string
	}{
		Ctx: ctx,
		Nwo: nwo,
	}
	mock.lockGetRepository.Lock()
	mock.calls.GetRepository = append(mock.calls.GetRepository, callInfo)
	mock.lockGetRepository.Unlock()
	return mock.GetRepositoryFunc(ctx, nwo)
}

// GetRepositoryCalls gets all the calls that were made to GetRepository.
// Check the length with:
//
//	len(mockedapiClient.GetRepositoryCalls())
func (mock *apiClientMock) GetRepositoryCalls() []struct {
	Ctx context.Context
	Nwo string
} {
	var calls []struct {
		Ctx context.Context
		Nwo string
	}
	mock.lockGetRepository.RLock()
	calls = mock.calls.GetRepository
	mock.lockGetRepository.RUnlock()
	return calls
}

// GetUser calls GetUserFunc.
func (mock *apiClientMock) GetUser(ctx context.Context) (*api.User, error) {
	if mock.GetUserFunc == nil {
		panic("apiClientMock.GetUserFunc: method is nil but apiClient.GetUser was just called")
	}
	callInfo := struct {
		Ctx context.Context
	}{
		Ctx: ctx,
	}
	mock.lockGetUser.Lock()
	mock.calls.GetUser = append(mock.calls.GetUser, callInfo)
	mock.lockGetUser.Unlock()
	return mock.GetUserFunc(ctx)
}

// GetUserCalls gets all the calls that were made to GetUser.
// Check the length with:
//
//	len(mockedapiClient.GetUserCalls())
func (mock *apiClientMock) GetUserCalls() []struct {
	Ctx context.Context
} {
	var calls []struct {
		Ctx context.Context
	}
	mock.lockGetUser.RLock()
	calls = mock.calls.GetUser
	mock.lockGetUser.RUnlock()
	return calls
}

// ListCodespaces calls ListCodespacesFunc.
func (mock *apiClientMock) ListCodespaces(ctx context.Context, opts api.ListCodespacesOptions) ([]*api.Codespace, error) {
	if mock.ListCodespacesFunc == nil {
		panic("apiClientMock.ListCodespacesFunc: method is nil but apiClient.ListCodespaces was just called")
	}
	callInfo := struct {
		Ctx  context.Context
		Opts api.ListCodespacesOptions
	}{
		Ctx:  ctx,
		Opts: opts,
	}
	mock.lockListCodespaces.Lock()
	mock.calls.ListCodespaces = append(mock.calls.ListCodespaces, callInfo)
	mock.lockListCodespaces.Unlock()
	return mock.ListCodespacesFunc(ctx, opts)
}

// ListCodespacesCalls gets all the calls that were made to ListCodespaces.
// Check the length with:
//
//	len(mockedapiClient.ListCodespacesCalls())
func (mock *apiClientMock) ListCodespacesCalls() []struct {
	Ctx  context.Context
	Opts api.ListCodespacesOptions
} {
	var calls []struct {
		Ctx  context.Context
		Opts api.ListCodespacesOptions
	}
	mock.lockListCodespaces.RLock()
	calls = mock.calls.ListCodespaces
	mock.lockListCodespaces.RUnlock()
	return calls
}

// ListDevContainers calls ListDevContainersFunc.
func (mock *apiClientMock) ListDevContainers(ctx context.Context, repoID int, branch string, limit int) ([]api.DevContainerEntry, error) {
	if mock.ListDevContainersFunc == nil {
		panic("apiClientMock.ListDevContainersFunc: method is nil but apiClient.ListDevContainers was just called")
	}
	callInfo := struct {
		Ctx    context.Context
		RepoID int
		Branch string
		Limit  int
	}{
		Ctx:    ctx,
		RepoID: repoID,
		Branch: branch,
		Limit:  limit,
	}
	mock.lockListDevContainers.Lock()
	mock.calls.ListDevContainers = append(mock.calls.ListDevContainers, callInfo)
	mock.lockListDevContainers.Unlock()
	return mock.ListDevContainersFunc(ctx, repoID, branch, limit)
}

// ListDevContainersCalls gets all the calls that were made to ListDevContainers.
// Check the length with:
//
//	len(mockedapiClient.ListDevContainersCalls())
func (mock *apiClientMock) ListDevContainersCalls() []struct {
	Ctx    context.Context
	RepoID int
	Branch string
	Limit  int
} {
	var calls []struct {
		Ctx    context.Context
		RepoID int
		Branch string
		Limit  int
	}
	mock.lockListDevContainers.RLock()
	calls = mock.calls.ListDevContainers
	mock.lockListDevContainers.RUnlock()
	return calls
}

// StartCodespace calls StartCodespaceFunc.
func (mock *apiClientMock) StartCodespace(ctx context.Context, name string) error {
	if mock.StartCodespaceFunc == nil {
		panic("apiClientMock.StartCodespaceFunc: method is nil but apiClient.StartCodespace was just called")
	}
	callInfo := struct {
		Ctx  context.Context
		Name string
	}{
		Ctx:  ctx,
		Name: name,
	}
	mock.lockStartCodespace.Lock()
	mock.calls.StartCodespace = append(mock.calls.StartCodespace, callInfo)
	mock.lockStartCodespace.Unlock()
	return mock.StartCodespaceFunc(ctx, name)
}

// StartCodespaceCalls gets all the calls that were made to StartCodespace.
// Check the length with:
//
//	len(mockedapiClient.StartCodespaceCalls())
func (mock *apiClientMock) StartCodespaceCalls() []struct {
	Ctx  context.Context
	Name string
} {
	var calls []struct {
		Ctx  context.Context
		Name string
	}
	mock.lockStartCodespace.RLock()
	calls = mock.calls.StartCodespace
	mock.lockStartCodespace.RUnlock()
	return calls
}

// StopCodespace calls StopCodespaceFunc.
func (mock *apiClientMock) StopCodespace(ctx context.Context, name string, orgName string, userName string) error {
	if mock.StopCodespaceFunc == nil {
		panic("apiClientMock.StopCodespaceFunc: method is nil but apiClient.StopCodespace was just called")
	}
	callInfo := struct {
		Ctx      context.Context
		Name     string
		OrgName  string
		UserName string
	}{
		Ctx:      ctx,
		Name:     name,
		OrgName:  orgName,
		UserName: userName,
	}
	mock.lockStopCodespace.Lock()
	mock.calls.StopCodespace = append(mock.calls.StopCodespace, callInfo)
	mock.lockStopCodespace.Unlock()
	return mock.StopCodespaceFunc(ctx, name, orgName, userName)
}

// StopCodespaceCalls gets all the calls that were made to StopCodespace.
// Check the length with:
//
//	len(mockedapiClient.StopCodespaceCalls())
func (mock *apiClientMock) StopCodespaceCalls() []struct {
	Ctx      context.Context
	Name     string
	OrgName  string
	UserName string
} {
	var calls []struct {
		Ctx      context.Context
		Name     string
		OrgName  string
		UserName string
	}
	mock.lockStopCodespace.RLock()
	calls = mock.calls.StopCodespace
	mock.lockStopCodespace.RUnlock()
	return calls
}