-
Notifications
You must be signed in to change notification settings - Fork 37
/
impl.go
executable file
·518 lines (455 loc) · 24.9 KB
/
impl.go
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
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
package marketplace
import (
"context"
"fmt"
"net/http"
"github.com/databricks/databricks-sdk-go/client"
)
// unexported type that holds implementations of just ConsumerFulfillments API methods
type consumerFulfillmentsImpl struct {
client *client.DatabricksClient
}
func (a *consumerFulfillmentsImpl) Get(ctx context.Context, request GetListingContentMetadataRequest) (*GetListingContentMetadataResponse, error) {
var getListingContentMetadataResponse GetListingContentMetadataResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/content", request.ListingId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingContentMetadataResponse)
return &getListingContentMetadataResponse, err
}
func (a *consumerFulfillmentsImpl) List(ctx context.Context, request ListFulfillmentsRequest) (*ListFulfillmentsResponse, error) {
var listFulfillmentsResponse ListFulfillmentsResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/fulfillments", request.ListingId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFulfillmentsResponse)
return &listFulfillmentsResponse, err
}
// unexported type that holds implementations of just ConsumerInstallations API methods
type consumerInstallationsImpl struct {
client *client.DatabricksClient
}
func (a *consumerInstallationsImpl) Create(ctx context.Context, request CreateInstallationRequest) (*Installation, error) {
var installation Installation
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &installation)
return &installation, err
}
func (a *consumerInstallationsImpl) Delete(ctx context.Context, request DeleteInstallationRequest) error {
var deleteInstallationResponse DeleteInstallationResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteInstallationResponse)
return err
}
func (a *consumerInstallationsImpl) List(ctx context.Context, request ListAllInstallationsRequest) (*ListAllInstallationsResponse, error) {
var listAllInstallationsResponse ListAllInstallationsResponse
path := "/api/2.1/marketplace-consumer/installations"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllInstallationsResponse)
return &listAllInstallationsResponse, err
}
func (a *consumerInstallationsImpl) ListListingInstallations(ctx context.Context, request ListInstallationsRequest) (*ListInstallationsResponse, error) {
var listInstallationsResponse ListInstallationsResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations", request.ListingId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listInstallationsResponse)
return &listInstallationsResponse, err
}
func (a *consumerInstallationsImpl) Update(ctx context.Context, request UpdateInstallationRequest) (*UpdateInstallationResponse, error) {
var updateInstallationResponse UpdateInstallationResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/installations/%v", request.ListingId, request.InstallationId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateInstallationResponse)
return &updateInstallationResponse, err
}
// unexported type that holds implementations of just ConsumerListings API methods
type consumerListingsImpl struct {
client *client.DatabricksClient
}
func (a *consumerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) {
var getListingResponse GetListingResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingResponse)
return &getListingResponse, err
}
func (a *consumerListingsImpl) List(ctx context.Context, request ListListingsRequest) (*ListListingsResponse, error) {
var listListingsResponse ListListingsResponse
path := "/api/2.1/marketplace-consumer/listings"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listListingsResponse)
return &listListingsResponse, err
}
func (a *consumerListingsImpl) Search(ctx context.Context, request SearchListingsRequest) (*SearchListingsResponse, error) {
var searchListingsResponse SearchListingsResponse
path := "/api/2.1/marketplace-consumer/search-listings"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &searchListingsResponse)
return &searchListingsResponse, err
}
// unexported type that holds implementations of just ConsumerPersonalizationRequests API methods
type consumerPersonalizationRequestsImpl struct {
client *client.DatabricksClient
}
func (a *consumerPersonalizationRequestsImpl) Create(ctx context.Context, request CreatePersonalizationRequest) (*CreatePersonalizationRequestResponse, error) {
var createPersonalizationRequestResponse CreatePersonalizationRequestResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createPersonalizationRequestResponse)
return &createPersonalizationRequestResponse, err
}
func (a *consumerPersonalizationRequestsImpl) Get(ctx context.Context, request GetPersonalizationRequestRequest) (*GetPersonalizationRequestResponse, error) {
var getPersonalizationRequestResponse GetPersonalizationRequestResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v/personalization-requests", request.ListingId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getPersonalizationRequestResponse)
return &getPersonalizationRequestResponse, err
}
func (a *consumerPersonalizationRequestsImpl) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) {
var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse
path := "/api/2.1/marketplace-consumer/personalization-requests"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllPersonalizationRequestsResponse)
return &listAllPersonalizationRequestsResponse, err
}
// unexported type that holds implementations of just ConsumerProviders API methods
type consumerProvidersImpl struct {
client *client.DatabricksClient
}
func (a *consumerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) {
var getProviderResponse GetProviderResponse
path := fmt.Sprintf("/api/2.1/marketplace-consumer/providers/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getProviderResponse)
return &getProviderResponse, err
}
func (a *consumerProvidersImpl) List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) {
var listProvidersResponse ListProvidersResponse
path := "/api/2.1/marketplace-consumer/providers"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProvidersResponse)
return &listProvidersResponse, err
}
// unexported type that holds implementations of just ProviderExchangeFilters API methods
type providerExchangeFiltersImpl struct {
client *client.DatabricksClient
}
func (a *providerExchangeFiltersImpl) Create(ctx context.Context, request CreateExchangeFilterRequest) (*CreateExchangeFilterResponse, error) {
var createExchangeFilterResponse CreateExchangeFilterResponse
path := "/api/2.0/marketplace-exchange/filters"
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createExchangeFilterResponse)
return &createExchangeFilterResponse, err
}
func (a *providerExchangeFiltersImpl) Delete(ctx context.Context, request DeleteExchangeFilterRequest) error {
var deleteExchangeFilterResponse DeleteExchangeFilterResponse
path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteExchangeFilterResponse)
return err
}
func (a *providerExchangeFiltersImpl) List(ctx context.Context, request ListExchangeFiltersRequest) (*ListExchangeFiltersResponse, error) {
var listExchangeFiltersResponse ListExchangeFiltersResponse
path := "/api/2.0/marketplace-exchange/filters"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangeFiltersResponse)
return &listExchangeFiltersResponse, err
}
func (a *providerExchangeFiltersImpl) Update(ctx context.Context, request UpdateExchangeFilterRequest) (*UpdateExchangeFilterResponse, error) {
var updateExchangeFilterResponse UpdateExchangeFilterResponse
path := fmt.Sprintf("/api/2.0/marketplace-exchange/filters/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateExchangeFilterResponse)
return &updateExchangeFilterResponse, err
}
// unexported type that holds implementations of just ProviderExchanges API methods
type providerExchangesImpl struct {
client *client.DatabricksClient
}
func (a *providerExchangesImpl) AddListingToExchange(ctx context.Context, request AddExchangeForListingRequest) (*AddExchangeForListingResponse, error) {
var addExchangeForListingResponse AddExchangeForListingResponse
path := "/api/2.0/marketplace-exchange/exchanges-for-listing"
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &addExchangeForListingResponse)
return &addExchangeForListingResponse, err
}
func (a *providerExchangesImpl) Create(ctx context.Context, request CreateExchangeRequest) (*CreateExchangeResponse, error) {
var createExchangeResponse CreateExchangeResponse
path := "/api/2.0/marketplace-exchange/exchanges"
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createExchangeResponse)
return &createExchangeResponse, err
}
func (a *providerExchangesImpl) Delete(ctx context.Context, request DeleteExchangeRequest) error {
var deleteExchangeResponse DeleteExchangeResponse
path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteExchangeResponse)
return err
}
func (a *providerExchangesImpl) DeleteListingFromExchange(ctx context.Context, request RemoveExchangeForListingRequest) error {
var removeExchangeForListingResponse RemoveExchangeForListingResponse
path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges-for-listing/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &removeExchangeForListingResponse)
return err
}
func (a *providerExchangesImpl) Get(ctx context.Context, request GetExchangeRequest) (*GetExchangeResponse, error) {
var getExchangeResponse GetExchangeResponse
path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getExchangeResponse)
return &getExchangeResponse, err
}
func (a *providerExchangesImpl) List(ctx context.Context, request ListExchangesRequest) (*ListExchangesResponse, error) {
var listExchangesResponse ListExchangesResponse
path := "/api/2.0/marketplace-exchange/exchanges"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangesResponse)
return &listExchangesResponse, err
}
func (a *providerExchangesImpl) ListExchangesForListing(ctx context.Context, request ListExchangesForListingRequest) (*ListExchangesForListingResponse, error) {
var listExchangesForListingResponse ListExchangesForListingResponse
path := "/api/2.0/marketplace-exchange/exchanges-for-listing"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listExchangesForListingResponse)
return &listExchangesForListingResponse, err
}
func (a *providerExchangesImpl) ListListingsForExchange(ctx context.Context, request ListListingsForExchangeRequest) (*ListListingsForExchangeResponse, error) {
var listListingsForExchangeResponse ListListingsForExchangeResponse
path := "/api/2.0/marketplace-exchange/listings-for-exchange"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listListingsForExchangeResponse)
return &listListingsForExchangeResponse, err
}
func (a *providerExchangesImpl) Update(ctx context.Context, request UpdateExchangeRequest) (*UpdateExchangeResponse, error) {
var updateExchangeResponse UpdateExchangeResponse
path := fmt.Sprintf("/api/2.0/marketplace-exchange/exchanges/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateExchangeResponse)
return &updateExchangeResponse, err
}
// unexported type that holds implementations of just ProviderFiles API methods
type providerFilesImpl struct {
client *client.DatabricksClient
}
func (a *providerFilesImpl) Create(ctx context.Context, request CreateFileRequest) (*CreateFileResponse, error) {
var createFileResponse CreateFileResponse
path := "/api/2.0/marketplace-provider/files"
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createFileResponse)
return &createFileResponse, err
}
func (a *providerFilesImpl) Delete(ctx context.Context, request DeleteFileRequest) error {
var deleteFileResponse DeleteFileResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteFileResponse)
return err
}
func (a *providerFilesImpl) Get(ctx context.Context, request GetFileRequest) (*GetFileResponse, error) {
var getFileResponse GetFileResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/files/%v", request.FileId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getFileResponse)
return &getFileResponse, err
}
func (a *providerFilesImpl) List(ctx context.Context, request ListFilesRequest) (*ListFilesResponse, error) {
var listFilesResponse ListFilesResponse
path := "/api/2.0/marketplace-provider/files"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listFilesResponse)
return &listFilesResponse, err
}
// unexported type that holds implementations of just ProviderListings API methods
type providerListingsImpl struct {
client *client.DatabricksClient
}
func (a *providerListingsImpl) Create(ctx context.Context, request CreateListingRequest) (*CreateListingResponse, error) {
var createListingResponse CreateListingResponse
path := "/api/2.0/marketplace-provider/listing"
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createListingResponse)
return &createListingResponse, err
}
func (a *providerListingsImpl) Delete(ctx context.Context, request DeleteListingRequest) error {
var deleteListingResponse DeleteListingResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteListingResponse)
return err
}
func (a *providerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) {
var getListingResponse GetListingResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingResponse)
return &getListingResponse, err
}
func (a *providerListingsImpl) List(ctx context.Context, request GetListingsRequest) (*GetListingsResponse, error) {
var getListingsResponse GetListingsResponse
path := "/api/2.0/marketplace-provider/listings"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getListingsResponse)
return &getListingsResponse, err
}
func (a *providerListingsImpl) Update(ctx context.Context, request UpdateListingRequest) (*UpdateListingResponse, error) {
var updateListingResponse UpdateListingResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateListingResponse)
return &updateListingResponse, err
}
// unexported type that holds implementations of just ProviderPersonalizationRequests API methods
type providerPersonalizationRequestsImpl struct {
client *client.DatabricksClient
}
func (a *providerPersonalizationRequestsImpl) List(ctx context.Context, request ListAllPersonalizationRequestsRequest) (*ListAllPersonalizationRequestsResponse, error) {
var listAllPersonalizationRequestsResponse ListAllPersonalizationRequestsResponse
path := "/api/2.0/marketplace-provider/personalization-requests"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAllPersonalizationRequestsResponse)
return &listAllPersonalizationRequestsResponse, err
}
func (a *providerPersonalizationRequestsImpl) Update(ctx context.Context, request UpdatePersonalizationRequestRequest) (*UpdatePersonalizationRequestResponse, error) {
var updatePersonalizationRequestResponse UpdatePersonalizationRequestResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/listings/%v/personalization-requests/%v/request-status", request.ListingId, request.RequestId)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updatePersonalizationRequestResponse)
return &updatePersonalizationRequestResponse, err
}
// unexported type that holds implementations of just ProviderProviderAnalyticsDashboards API methods
type providerProviderAnalyticsDashboardsImpl struct {
client *client.DatabricksClient
}
func (a *providerProviderAnalyticsDashboardsImpl) Create(ctx context.Context) (*ProviderAnalyticsDashboard, error) {
var providerAnalyticsDashboard ProviderAnalyticsDashboard
path := "/api/2.0/marketplace-provider/analytics_dashboard"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, nil, &providerAnalyticsDashboard)
return &providerAnalyticsDashboard, err
}
func (a *providerProviderAnalyticsDashboardsImpl) Get(ctx context.Context) (*ListProviderAnalyticsDashboardResponse, error) {
var listProviderAnalyticsDashboardResponse ListProviderAnalyticsDashboardResponse
path := "/api/2.0/marketplace-provider/analytics_dashboard"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &listProviderAnalyticsDashboardResponse)
return &listProviderAnalyticsDashboardResponse, err
}
func (a *providerProviderAnalyticsDashboardsImpl) GetLatestVersion(ctx context.Context) (*GetLatestVersionProviderAnalyticsDashboardResponse, error) {
var getLatestVersionProviderAnalyticsDashboardResponse GetLatestVersionProviderAnalyticsDashboardResponse
path := "/api/2.0/marketplace-provider/analytics_dashboard/latest"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, nil, &getLatestVersionProviderAnalyticsDashboardResponse)
return &getLatestVersionProviderAnalyticsDashboardResponse, err
}
func (a *providerProviderAnalyticsDashboardsImpl) Update(ctx context.Context, request UpdateProviderAnalyticsDashboardRequest) (*UpdateProviderAnalyticsDashboardResponse, error) {
var updateProviderAnalyticsDashboardResponse UpdateProviderAnalyticsDashboardResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/analytics_dashboard/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateProviderAnalyticsDashboardResponse)
return &updateProviderAnalyticsDashboardResponse, err
}
// unexported type that holds implementations of just ProviderProviders API methods
type providerProvidersImpl struct {
client *client.DatabricksClient
}
func (a *providerProvidersImpl) Create(ctx context.Context, request CreateProviderRequest) (*CreateProviderResponse, error) {
var createProviderResponse CreateProviderResponse
path := "/api/2.0/marketplace-provider/provider"
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPost, path, headers, request, &createProviderResponse)
return &createProviderResponse, err
}
func (a *providerProvidersImpl) Delete(ctx context.Context, request DeleteProviderRequest) error {
var deleteProviderResponse DeleteProviderResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteProviderResponse)
return err
}
func (a *providerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) {
var getProviderResponse GetProviderResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &getProviderResponse)
return &getProviderResponse, err
}
func (a *providerProvidersImpl) List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error) {
var listProvidersResponse ListProvidersResponse
path := "/api/2.0/marketplace-provider/providers"
headers := make(map[string]string)
headers["Accept"] = "application/json"
err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listProvidersResponse)
return &listProvidersResponse, err
}
func (a *providerProvidersImpl) Update(ctx context.Context, request UpdateProviderRequest) (*UpdateProviderResponse, error) {
var updateProviderResponse UpdateProviderResponse
path := fmt.Sprintf("/api/2.0/marketplace-provider/providers/%v", request.Id)
headers := make(map[string]string)
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"
err := a.client.Do(ctx, http.MethodPut, path, headers, request, &updateProviderResponse)
return &updateProviderResponse, err
}