-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathapi_default.go
More file actions
3496 lines (3102 loc) · 143 KB
/
api_default.go
File metadata and controls
3496 lines (3102 loc) · 143 KB
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
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
CDN API
API used to create and manage your CDN distributions.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
package cdn
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"time"
"github.com/stackitcloud/stackit-sdk-go/core/config"
"github.com/stackitcloud/stackit-sdk-go/core/oapierror"
)
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type DefaultApi interface {
/*
CreateDistribution Create new distribution
CreateDistribution will create a new CDN distribution
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@return ApiCreateDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest
/*
CreateDistributionExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@return CreateDistributionResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
CreateDistributionExecute(ctx context.Context, projectId string) (*CreateDistributionResponse, error)
/*
DeleteCustomDomain Delete a custom domain
Removes a custom domain
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@param domain
@return ApiDeleteCustomDomainRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest
/*
DeleteCustomDomainExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@param domain
@return DeleteCustomDomainResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
DeleteCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*DeleteCustomDomainResponse, error)
/*
DeleteDistribution Delete distribution
DeleteDistribution accepts a project- and distribution-Id and will delete a distribution.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return ApiDeleteDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest
/*
DeleteDistributionExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return DeleteDistributionResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
DeleteDistributionExecute(ctx context.Context, projectId string, distributionId string) (*DeleteDistributionResponse, error)
/*
FindCachePaths Return Paths that were purged
This returns paths that are present in the cache purging history.
Only substrings of the provided input are returned.
The response is sorted in descending order by the most recent purge.
So, assuming you have have the following purged for a distribution
- `/test/1` at `2025-01-01`
- `/test/2` at `2025-01-02`
- `/someOtherPath/1` at `2025-01-03`
- `/test/1` at `2025-01-04`
- `/test/3` at `2025-01-05`,
this would return the following paths, in the following order, assuming `/te` was the search parameter:
- `/test/3`
- `/test/1`
- `/test/2`
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return ApiFindCachePathsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest
/*
FindCachePathsExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return FindCachePathsResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
FindCachePathsExecute(ctx context.Context, projectId string, distributionId string) (*FindCachePathsResponse, error)
/*
GetCacheInfo Get Infos about the Caching State
Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges.
If (and only if) you provide the path query parameter, the history will also contain granular cache purges.
The request will not fail if no data about a path is found.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return ApiGetCacheInfoRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest
/*
GetCacheInfoExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return GetCacheInfoResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetCacheInfoExecute(ctx context.Context, projectId string, distributionId string) (*GetCacheInfoResponse, error)
/*
GetCustomDomain Retrieve a specific custom domain
Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@param domain
@return ApiGetCustomDomainRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest
/*
GetCustomDomainExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@param domain
@return GetCustomDomainResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*GetCustomDomainResponse, error)
/*
GetDistribution Get distribution by Id
This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return ApiGetDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest
/*
GetDistributionExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return GetDistributionResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetDistributionExecute(ctx context.Context, projectId string, distributionId string) (*GetDistributionResponse, error)
/*
GetLogs Retrieve distribution logs
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId Your CDN distribution Id
@return ApiGetLogsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest
/*
GetLogsExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId Your CDN distribution Id
@return GetLogsResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetLogsExecute(ctx context.Context, projectId string, distributionId string) (*GetLogsResponse, error)
/*
GetLogsSearchFilters Get relevant search filters for this distribution based on user input.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project ID.
@param distributionId Your CDN distribution ID.
@return ApiGetLogsSearchFiltersRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest
/*
GetLogsSearchFiltersExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project ID.
@param distributionId Your CDN distribution ID.
@return GetLogsSearchFiltersResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetLogsSearchFiltersExecute(ctx context.Context, projectId string, distributionId string) (*GetLogsSearchFiltersResponse, error)
/*
GetStatistics Retrieve the statistics of a distribution
Returns the statistics of the distribution in the given
time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval.
In case no statistics for a time interval exist, no record is returned.
The time range for which statistics should be returned can be configured using query parameters.
Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z.
**Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound.
The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound.
Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return ApiGetStatisticsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest
/*
GetStatisticsExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return GetStatisticsResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
GetStatisticsExecute(ctx context.Context, projectId string, distributionId string) (*GetStatisticsResponse, error)
/*
ListDistributions List all distributions belonging to a specific project
ListDistributions returns a list of all CDN distributions associated with
a given project, ordered by their distribution Id.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@return ApiListDistributionsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest
/*
ListDistributionsExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@return ListDistributionsResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
ListDistributionsExecute(ctx context.Context, projectId string) (*ListDistributionsResponse, error)
/*
ListWafCollections List all WAF rule collections of the project
Returns all WAF rule collections available to the project
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@return ApiListWafCollectionsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest
/*
ListWafCollectionsExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@return ListWafCollectionsResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
ListWafCollectionsExecute(ctx context.Context, projectId string) (*ListWafCollectionsResponse, error)
/*
PatchDistribution Update existing distribution
Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return ApiPatchDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest
/*
PatchDistributionExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return PatchDistributionResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
PatchDistributionExecute(ctx context.Context, projectId string, distributionId string) (*PatchDistributionResponse, error)
/*
PurgeCache Clear distribution cache
Clear the cache for this distribution.
All content, regardless of its staleness, will get refetched from the host.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return ApiPurgeCacheRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest
/*
PurgeCacheExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@return map[string]interface{}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
PurgeCacheExecute(ctx context.Context, projectId string, distributionId string) (map[string]interface{}, error)
/*
PutCustomDomain Create or update a custom domain
Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@param domain
@return ApiPutCustomDomainRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest
/*
PutCustomDomainExecute executes the request
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@param domain
@return PutCustomDomainResponse
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
*/
PutCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*PutCustomDomainResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiCreateDistributionRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*CreateDistributionResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiDeleteCustomDomainRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
IntentId(intentId string) ApiDeleteCustomDomainRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*DeleteCustomDomainResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiDeleteDistributionRequest interface {
// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
IntentId(intentId string) ApiDeleteDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*DeleteDistributionResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiFindCachePathsRequest interface {
// A substring of the search query.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Path(path string) ApiFindCachePathsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*FindCachePathsResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiGetCacheInfoRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PurgePath(purgePath string) ApiGetCacheInfoRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*GetCacheInfoResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiGetCustomDomainRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*GetCustomDomainResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiGetDistributionRequest interface {
// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
WithWafStatus(withWafStatus bool) ApiGetDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*GetDistributionResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiGetLogsRequest interface {
// the start of the time range for which logs should be returned
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
From(from time.Time) ApiGetLogsRequest
// the end of the time range for which logs should be returned. If not specified, \"now\" is used.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
To(to time.Time) ApiGetLogsRequest
// Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive)
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PageSize(pageSize int32) ApiGetLogsRequest
// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PageIdentifier(pageIdentifier string) ApiGetLogsRequest
// Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host`
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
SortBy(sortBy string) ApiGetLogsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
SortOrder(sortOrder string) ApiGetLogsRequest
// If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
WafAction(wafAction WAFRuleAction) ApiGetLogsRequest
// Filters by the CDN data center region that served the request. Can be combined with other filters
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest
// Filters by the originating country of the user request. Can be combined with other filters
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
RequestCountryCode(requestCountryCode string) ApiGetLogsRequest
// Filters by the HTTP status code returned to the client. Can be combined with other filters
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
StatusCode(statusCode int32) ApiGetLogsRequest
// Filters based on whether the request was served from the CDN cache. Can be combined with other filters
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
CacheHit(cacheHit bool) ApiGetLogsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*GetLogsResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiGetLogsSearchFiltersRequest interface {
// Optional search string. Will search the **values** for the text input.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Filter(filter string) ApiGetLogsSearchFiltersRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*GetLogsSearchFiltersResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiGetStatisticsRequest interface {
// the start of the time range for which statistics should be returned
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
From(from time.Time) ApiGetStatisticsRequest
// the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
To(to time.Time) ApiGetStatisticsRequest
// Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z`
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Interval(interval string) ApiGetStatisticsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*GetStatisticsResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiListDistributionsRequest interface {
// Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive)
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PageSize(pageSize int32) ApiListDistributionsRequest
// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
WithWafStatus(withWafStatus bool) ApiListDistributionsRequest
// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PageIdentifier(pageIdentifier string) ApiListDistributionsRequest
// The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
SortBy(sortBy string) ApiListDistributionsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
SortOrder(sortOrder string) ApiListDistributionsRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*ListDistributionsResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiListWafCollectionsRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*ListWafCollectionsResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiPatchDistributionRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*PatchDistributionResponse, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiPurgeCacheRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (map[string]interface{}, error)
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type ApiPutCustomDomainRequest interface {
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
Execute() (*PutCustomDomainResponse, error)
}
// DefaultApiService DefaultApi service
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type DefaultApiService service
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type CreateDistributionRequest struct {
ctx context.Context
apiService *DefaultApiService
projectId string
createDistributionPayload *CreateDistributionPayload
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (r CreateDistributionRequest) CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest {
r.createDistributionPayload = &createDistributionPayload
return r
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (r CreateDistributionRequest) Execute() (*CreateDistributionResponse, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CreateDistributionResponse
)
a := r.apiService
client, ok := a.client.(*APIClient)
if !ok {
return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient")
}
localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateDistribution")
if err != nil {
return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()}
}
localVarPath := localBasePath + "/v1/projects/{projectId}/distributions"
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.createDistributionPayload == nil {
return localVarReturnValue, fmt.Errorf("createDistributionPayload is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.createDistributionPayload
req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, err
}
contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request)
if ok {
*contextHTTPRequest = req
}
localVarHTTPResponse, err := client.callAPI(req)
contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response)
if ok {
*contextHTTPResponse = localVarHTTPResponse
}
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &oapierror.GenericOpenAPIError{
StatusCode: localVarHTTPResponse.StatusCode,
Body: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v GenericJsonResponse
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
if localVarHTTPResponse.StatusCode == 422 {
var v GenericJsonResponse
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v GenericJsonResponse
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
var v GenericJsonResponse
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &oapierror.GenericOpenAPIError{
StatusCode: localVarHTTPResponse.StatusCode,
Body: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, newErr
}
return localVarReturnValue, nil
}
/*
CreateDistribution: Create new distribution
Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@return ApiCreateDistributionRequest
*/
func (a *APIClient) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest {
return CreateDistributionRequest{
apiService: a.defaultApi,
ctx: ctx,
projectId: projectId,
}
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (a *APIClient) CreateDistributionExecute(ctx context.Context, projectId string) (*CreateDistributionResponse, error) {
r := CreateDistributionRequest{
apiService: a.defaultApi,
ctx: ctx,
projectId: projectId,
}
return r.Execute()
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type DeleteCustomDomainRequest struct {
ctx context.Context
apiService *DefaultApiService
projectId string
distributionId string
domain string
intentId *string
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (r DeleteCustomDomainRequest) IntentId(intentId string) ApiDeleteCustomDomainRequest {
r.intentId = &intentId
return r
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (r DeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DeleteCustomDomainResponse
)
a := r.apiService
client, ok := a.client.(*APIClient)
if !ok {
return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient")
}
localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteCustomDomain")
if err != nil {
return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()}
}
localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}"
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(ParameterValueToString(r.distributionId, "distributionId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(ParameterValueToString(r.domain, "domain")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if strlen(r.domain) > 72 {
return localVarReturnValue, fmt.Errorf("domain must have less than 72 elements")
}
if r.intentId != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, err
}
contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request)
if ok {
*contextHTTPRequest = req
}
localVarHTTPResponse, err := client.callAPI(req)
contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response)
if ok {
*contextHTTPResponse = localVarHTTPResponse
}
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &oapierror.GenericOpenAPIError{
StatusCode: localVarHTTPResponse.StatusCode,
Body: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
if localVarHTTPResponse.StatusCode == 422 {
var v GenericJsonResponse
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v GenericJsonResponse
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
var v GenericJsonResponse
err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.ErrorMessage = err.Error()
return localVarReturnValue, newErr
}
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
return localVarReturnValue, newErr
}
err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &oapierror.GenericOpenAPIError{
StatusCode: localVarHTTPResponse.StatusCode,
Body: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, newErr
}
return localVarReturnValue, nil
}
/*
DeleteCustomDomain: Delete a custom domain
Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param projectId Your STACKIT Project Id
@param distributionId
@param domain
@return ApiDeleteCustomDomainRequest
*/
func (a *APIClient) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest {
return DeleteCustomDomainRequest{
apiService: a.defaultApi,
ctx: ctx,
projectId: projectId,
distributionId: distributionId,
domain: domain,
}
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (a *APIClient) DeleteCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*DeleteCustomDomainResponse, error) {
r := DeleteCustomDomainRequest{
apiService: a.defaultApi,
ctx: ctx,
projectId: projectId,
distributionId: distributionId,
domain: domain,
}
return r.Execute()
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
type DeleteDistributionRequest struct {
ctx context.Context
apiService *DefaultApiService
projectId string
distributionId string
intentId *string
}
// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped.
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (r DeleteDistributionRequest) IntentId(intentId string) ApiDeleteDistributionRequest {
r.intentId = &intentId
return r
}
// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead
func (r DeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DeleteDistributionResponse
)
a := r.apiService
client, ok := a.client.(*APIClient)
if !ok {
return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient")
}
localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteDistribution")
if err != nil {
return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()}
}
localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}"
localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(ParameterValueToString(r.distributionId, "distributionId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}