-
Notifications
You must be signed in to change notification settings - Fork 8
/
destination_revoke.go
34 lines (28 loc) · 1.06 KB
/
destination_revoke.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
package certificates
import (
"context"
"fmt"
"github.com/fivetran/go-fivetran/common"
httputils "github.com/fivetran/go-fivetran/http_utils"
)
// CertificateConnectorCertificateApproveService implements the Certificate Management, Revoke certificate for destination API.
// Ref. https://fivetran.com/docs/rest-api/certificates#revokeadestinationcertificate
type DestinationCertificateRevokeService struct {
httputils.HttpService
destinationID *string
hash *string
}
func (s *DestinationCertificateRevokeService) DestinationID(value string) *DestinationCertificateRevokeService {
s.destinationID = &value
return s
}
func (s *DestinationCertificateRevokeService) Hash(value string) *DestinationCertificateRevokeService {
s.hash = &value
return s
}
func (s *DestinationCertificateRevokeService) Do(ctx context.Context) (common.CommonResponse, error) {
var response common.CommonResponse
url := fmt.Sprintf("/destinations/%v/certificates/%v", *s.destinationID, *s.hash)
err := s.HttpService.Do(ctx, "DELETE", url, nil, nil, 200, &response)
return response, err
}