-
Notifications
You must be signed in to change notification settings - Fork 1
/
marketplace.go
executable file
·96 lines (76 loc) · 4.85 KB
/
marketplace.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
package gqlclient
// Generated by ./cmd/service-client-gen
import (
"context"
"github.com/Khan/genqlient/graphql"
"github.com/lifeomic/terraform-provider-lifeomic/internal/client"
)
const (
marketplaceServiceName = "marketplace-service"
marketplaceDefaultEndpoint = "https://marketplace.us.lifeomic.com/v1/marketplace/authenticated/graphql"
)
type MarketplaceService interface {
GetPublishedModule(ctx context.Context, id string, version string) (*GetPublishedModuleResponse, error)
CreateDraftModule(ctx context.Context, input CreateDraftModuleInput) (*CreateDraftModuleResponse, error)
DeleteModule(ctx context.Context, input DeleteModuleInput) (*DeleteModuleResponse, error)
SetAppTile(ctx context.Context, input SetPublicAppTileDraftModuleSourceInput) (*SetAppTileResponse, error)
PublishModule(ctx context.Context, input PublishDraftModuleInputV2) (*PublishModuleResponse, error)
PublishModuleV3(ctx context.Context, input PublishDraftModuleInputV3) (*PublishModuleV3Response, error)
AssignModuleReviewToSelf(ctx context.Context, moduleId string) (*AssignModuleReviewToSelfResponse, error)
ApproveModule(ctx context.Context, input ApproveModulePublishInput) (*ApproveModuleResponse, error)
StartImageUpload(ctx context.Context, input StartUploadInput) (*StartImageUploadResponse, error)
FinalizeImageUpload(ctx context.Context, input FinalizeUploadInput) (*FinalizeImageUploadResponse, error)
SetWellnessOfferingDraftModuleSource(ctx context.Context, input SetDraftModuleWellnessOfferingSourceInput) (*SetWellnessOfferingDraftModuleSourceResponse, error)
GetWellnessOfferingModule(ctx context.Context, moduleId string) (*GetWellnessOfferingModuleResponse, error)
UpdateDraftModule(ctx context.Context, input UpdateDraftModuleInput) (*UpdateDraftModuleResponse, error)
GetDraftWellnessOfferingModule(ctx context.Context, moduleId string) (*GetDraftWellnessOfferingModuleResponse, error)
}
type marketplaceClient struct {
client graphql.Client
}
func (m *marketplaceClient) GetPublishedModule(ctx context.Context, id string, version string) (*GetPublishedModuleResponse, error) {
return GetPublishedModule(ctx, m.client, id, version)
}
func (m *marketplaceClient) CreateDraftModule(ctx context.Context, input CreateDraftModuleInput) (*CreateDraftModuleResponse, error) {
return CreateDraftModule(ctx, m.client, input)
}
func (m *marketplaceClient) DeleteModule(ctx context.Context, input DeleteModuleInput) (*DeleteModuleResponse, error) {
return DeleteModule(ctx, m.client, input)
}
func (m *marketplaceClient) SetAppTile(ctx context.Context, input SetPublicAppTileDraftModuleSourceInput) (*SetAppTileResponse, error) {
return SetAppTile(ctx, m.client, input)
}
func (m *marketplaceClient) PublishModule(ctx context.Context, input PublishDraftModuleInputV2) (*PublishModuleResponse, error) {
return PublishModule(ctx, m.client, input)
}
func (m *marketplaceClient) PublishModuleV3(ctx context.Context, input PublishDraftModuleInputV3) (*PublishModuleV3Response, error) {
return PublishModuleV3(ctx, m.client, input)
}
func (m *marketplaceClient) AssignModuleReviewToSelf(ctx context.Context, moduleId string) (*AssignModuleReviewToSelfResponse, error) {
return AssignModuleReviewToSelf(ctx, m.client, moduleId)
}
func (m *marketplaceClient) ApproveModule(ctx context.Context, input ApproveModulePublishInput) (*ApproveModuleResponse, error) {
return ApproveModule(ctx, m.client, input)
}
func (m *marketplaceClient) StartImageUpload(ctx context.Context, input StartUploadInput) (*StartImageUploadResponse, error) {
return StartImageUpload(ctx, m.client, input)
}
func (m *marketplaceClient) FinalizeImageUpload(ctx context.Context, input FinalizeUploadInput) (*FinalizeImageUploadResponse, error) {
return FinalizeImageUpload(ctx, m.client, input)
}
func (m *marketplaceClient) SetWellnessOfferingDraftModuleSource(ctx context.Context, input SetDraftModuleWellnessOfferingSourceInput) (*SetWellnessOfferingDraftModuleSourceResponse, error) {
return SetWellnessOfferingDraftModuleSource(ctx, m.client, input)
}
func (m *marketplaceClient) GetWellnessOfferingModule(ctx context.Context, moduleId string) (*GetWellnessOfferingModuleResponse, error) {
return GetWellnessOfferingModule(ctx, m.client, moduleId)
}
func (m *marketplaceClient) UpdateDraftModule(ctx context.Context, input UpdateDraftModuleInput) (*UpdateDraftModuleResponse, error) {
return UpdateDraftModule(ctx, m.client, input)
}
func (m *marketplaceClient) GetDraftWellnessOfferingModule(ctx context.Context, moduleId string) (*GetDraftWellnessOfferingModuleResponse, error) {
return GetDraftWellnessOfferingModule(ctx, m.client, moduleId)
}
func NewMarketplaceClient(authToken string, accountID string, header map[string]string) MarketplaceService {
transport := client.NewAuthedTransport(authToken, accountID, marketplaceServiceName, header)
return &marketplaceClient{client: graphql.NewClient(marketplaceDefaultEndpoint, transport)}
}