blob: 712f23a624ec77492d0cb446e8a8ecc7ce55da93 [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(ctx 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(ctx context.Context, methodName string, rsp proto.Message, err error) error
}
func (s *DecoratedAdmin) ImportCAConfigs(ctx context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "ImportCAConfigs", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportCAConfigs(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "ImportCAConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) ImportDelegationConfigs(ctx context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "ImportDelegationConfigs", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportDelegationConfigs(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "ImportDelegationConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) ImportServiceAccountsConfigs(ctx context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "ImportServiceAccountsConfigs", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportServiceAccountsConfigs(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "ImportServiceAccountsConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) ImportProjectIdentityConfigs(ctx context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "ImportProjectIdentityConfigs", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportProjectIdentityConfigs(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "ImportProjectIdentityConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) ImportProjectOwnedAccountsConfigs(ctx context.Context, req *empty.Empty) (rsp *ImportedConfigs, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "ImportProjectOwnedAccountsConfigs", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.ImportProjectOwnedAccountsConfigs(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "ImportProjectOwnedAccountsConfigs", rsp, err)
}
return
}
func (s *DecoratedAdmin) InspectMachineToken(ctx context.Context, req *InspectMachineTokenRequest) (rsp *InspectMachineTokenResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "InspectMachineToken", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.InspectMachineToken(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "InspectMachineToken", rsp, err)
}
return
}
func (s *DecoratedAdmin) InspectDelegationToken(ctx context.Context, req *InspectDelegationTokenRequest) (rsp *InspectDelegationTokenResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "InspectDelegationToken", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.InspectDelegationToken(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "InspectDelegationToken", rsp, err)
}
return
}
func (s *DecoratedAdmin) InspectOAuthTokenGrant(ctx context.Context, req *InspectOAuthTokenGrantRequest) (rsp *InspectOAuthTokenGrantResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "InspectOAuthTokenGrant", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.InspectOAuthTokenGrant(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "InspectOAuthTokenGrant", rsp, err)
}
return
}