-
Notifications
You must be signed in to change notification settings - Fork 5
/
eligibilities.go
62 lines (55 loc) · 2.51 KB
/
eligibilities.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
// 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 legal
import (
"github.com/AccelByte/accelbyte-go-sdk/legal-sdk/pkg/legalclient"
"github.com/AccelByte/accelbyte-go-sdk/legal-sdk/pkg/legalclient/eligibilities"
"github.com/AccelByte/accelbyte-go-sdk/legal-sdk/pkg/legalclientmodels"
"github.com/AccelByte/accelbyte-go-sdk/services-api/pkg/repository"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/client"
)
type EligibilitiesService struct {
Client *legalclient.JusticeLegalService
TokenRepository repository.TokenRepository
}
// Deprecated: Use RetrieveEligibilitiesPublicShort instead
func (e *EligibilitiesService) RetrieveEligibilitiesPublic(input *eligibilities.RetrieveEligibilitiesPublicParams) ([]*legalclientmodels.RetrieveUserEligibilitiesResponse, error) {
accessToken, err := e.TokenRepository.GetToken()
if err != nil {
return nil, err
}
ok, err := e.Client.Eligibilities.RetrieveEligibilitiesPublic(input, client.BearerToken(*accessToken.AccessToken))
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}
// Deprecated: Use RetrieveEligibilitiesPublicIndirectShort instead
func (e *EligibilitiesService) RetrieveEligibilitiesPublicIndirect(input *eligibilities.RetrieveEligibilitiesPublicIndirectParams) (*legalclientmodels.RetrieveUserEligibilitiesIndirectResponse, error) {
accessToken, err := e.TokenRepository.GetToken()
if err != nil {
return nil, err
}
ok, err := e.Client.Eligibilities.RetrieveEligibilitiesPublicIndirect(input, client.BearerToken(*accessToken.AccessToken))
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}
func (e *EligibilitiesService) RetrieveEligibilitiesPublicShort(input *eligibilities.RetrieveEligibilitiesPublicParams, authInfo runtime.ClientAuthInfoWriter) ([]*legalclientmodels.RetrieveUserEligibilitiesResponse, error) {
ok, err := e.Client.Eligibilities.RetrieveEligibilitiesPublicShort(input, authInfo)
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}
func (e *EligibilitiesService) RetrieveEligibilitiesPublicIndirectShort(input *eligibilities.RetrieveEligibilitiesPublicIndirectParams, authInfo runtime.ClientAuthInfoWriter) (*legalclientmodels.RetrieveUserEligibilitiesIndirectResponse, error) {
ok, err := e.Client.Eligibilities.RetrieveEligibilitiesPublicIndirectShort(input, authInfo)
if err != nil {
return nil, err
}
return ok.GetPayload(), nil
}