/
generated_client.go
41 lines (33 loc) · 1.01 KB
/
generated_client.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
package catalog
type KuladoClient struct {
KuladoBaseClient
ApiVersion ApiVersionOperations
Catalog CatalogOperations
Template TemplateOperations
Question QuestionOperations
TemplateVersion TemplateVersionOperations
Error ErrorOperations
}
func constructClient(kuladoBaseClient *KuladoBaseClientImpl) *KuladoClient {
client := &KuladoClient{
KuladoBaseClient: kuladoBaseClient,
}
client.ApiVersion = newApiVersionClient(client)
client.Catalog = newCatalogClient(client)
client.Template = newTemplateClient(client)
client.Question = newQuestionClient(client)
client.TemplateVersion = newTemplateVersionClient(client)
client.Error = newErrorClient(client)
return client
}
func NewKuladoClient(opts *ClientOpts) (*KuladoClient, error) {
kuladoBaseClient := &KuladoBaseClientImpl{
Types: map[string]Schema{},
}
client := constructClient(kuladoBaseClient)
err := setupKuladoBaseClient(kuladoBaseClient, opts)
if err != nil {
return nil, err
}
return client, nil
}