-
Notifications
You must be signed in to change notification settings - Fork 5
/
equ8Config.go
95 lines (86 loc) · 2.99 KB
/
equ8Config.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
// Copyright (c) 2018 - 2021
// AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
package basic
import (
"github.com/AccelByte/accelbyte-go-sdk/basic-sdk/pkg/basicclient"
"github.com/AccelByte/accelbyte-go-sdk/basic-sdk/pkg/basicclient/e_q_u8_config"
"github.com/AccelByte/accelbyte-go-sdk/basic-sdk/pkg/basicclientmodels"
"github.com/AccelByte/accelbyte-go-sdk/services-api/pkg/repository"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/client"
)
type EQU8ConfigService struct {
Client *basicclient.JusticeBasicService
TokenRepository repository.TokenRepository
}
// Deprecated: Use GetConfigShort instead
func (e *EQU8ConfigService) GetConfig(input *e_q_u8_config.GetConfigParams) (*basicclientmodels.Equ8Config, error) {
accessToken, err := e.TokenRepository.GetToken()
if err != nil {
return nil, err
}
ok, notFound, internalServerError, err := e.Client.EqU8Config.GetConfig(input, client.BearerToken(*accessToken.AccessToken))
if notFound != nil {
return nil, notFound
}
if internalServerError != nil {
return nil, internalServerError
}
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}
// Deprecated: Use DeleteConfigShort instead
func (e *EQU8ConfigService) DeleteConfig(input *e_q_u8_config.DeleteConfigParams) error {
accessToken, err := e.TokenRepository.GetToken()
if err != nil {
return err
}
_, err = e.Client.EqU8Config.DeleteConfig(input, client.BearerToken(*accessToken.AccessToken))
if err != nil {
return err
}
return nil
}
// Deprecated: Use UpdateConfigShort instead
func (e *EQU8ConfigService) UpdateConfig(input *e_q_u8_config.UpdateConfigParams) (*basicclientmodels.Equ8Config, error) {
accessToken, err := e.TokenRepository.GetToken()
if err != nil {
return nil, err
}
ok, badRequest, internalServerError, err := e.Client.EqU8Config.UpdateConfig(input, client.BearerToken(*accessToken.AccessToken))
if badRequest != nil {
return nil, badRequest
}
if internalServerError != nil {
return nil, internalServerError
}
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}
func (e *EQU8ConfigService) GetConfigShort(input *e_q_u8_config.GetConfigParams, authInfo runtime.ClientAuthInfoWriter) (*basicclientmodels.Equ8Config, error) {
ok, err := e.Client.EqU8Config.GetConfigShort(input, authInfo)
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}
func (e *EQU8ConfigService) DeleteConfigShort(input *e_q_u8_config.DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter) error {
_, err := e.Client.EqU8Config.DeleteConfigShort(input, authInfo)
if err != nil {
return err
}
return nil
}
func (e *EQU8ConfigService) UpdateConfigShort(input *e_q_u8_config.UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter) (*basicclientmodels.Equ8Config, error) {
ok, err := e.Client.EqU8Config.UpdateConfigShort(input, authInfo)
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}