blob: 3448520acf2f6443d09a0286abaf8372c5774e63 [file] [log] [blame]
// Code generated by svcdec; DO NOT EDIT.
package admin
import (
"context"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
)
type DecoratedAdmin struct {
// Service is the service to decorate.
Service AdminServer
// Prelude is called for each method before forwarding the call to Service.
// If Prelude returns an error, then the call is skipped and the error is
// processed via the Postlude (if one is defined), or it is returned directly.
Prelude func(c context.Context, methodName string, req proto.Message) (context.Context, error)
// Postlude is called for each method after Service has processed the call, or
// after the Prelude has returned an error. This takes the the Service's
// response proto (which may be nil) and/or any error. The decorated
// service will return the response (possibly mutated) and error that Postlude
// returns.
Postlude func(c context.Context, methodName string, rsp proto.Message, err error) error
}
func (s *DecoratedAdmin) ImportCAConfigs(c context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "ImportCAConfigs", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportCAConfigs(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "ImportCAConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) ImportDelegationConfigs(c context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "ImportDelegationConfigs", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportDelegationConfigs(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "ImportDelegationConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) ImportServiceAccountsConfigs(c context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "ImportServiceAccountsConfigs", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportServiceAccountsConfigs(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "ImportServiceAccountsConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) ImportProjectIdentityConfigs(c context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "ImportProjectIdentityConfigs", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportProjectIdentityConfigs(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "ImportProjectIdentityConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) InspectMachineToken(c context.Context, req *InspectMachineTokenRequest) (rsp *InspectMachineTokenResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "InspectMachineToken", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.InspectMachineToken(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "InspectMachineToken", rsp, err)
}
return
}
func (s *DecoratedAdmin) InspectDelegationToken(c context.Context, req *InspectDelegationTokenRequest) (rsp *InspectDelegationTokenResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "InspectDelegationToken", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.InspectDelegationToken(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "InspectDelegationToken", rsp, err)
}
return
}
func (s *DecoratedAdmin) InspectOAuthTokenGrant(c context.Context, req *InspectOAuthTokenGrantRequest) (rsp *InspectOAuthTokenGrantResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "InspectOAuthTokenGrant", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.InspectOAuthTokenGrant(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "InspectOAuthTokenGrant", rsp, err)
}
return
}