// Copyright 2020-2021 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-twirp v7.1.0, DO NOT EDIT.
// source: buf/alpha/registry/v1alpha1/user.proto

package registryv1alpha1

import bytes "bytes"
import strings "strings"
import context "context"
import fmt "fmt"
import ioutil "io/ioutil"
import http "net/http"
import strconv "strconv"

import jsonpb "github.com/golang/protobuf/jsonpb"
import proto "github.com/golang/protobuf/proto"
import twirp "github.com/twitchtv/twirp"
import ctxsetters "github.com/twitchtv/twirp/ctxsetters"

// This is a compile-time assertion to ensure that this generated file
// is compatible with the twirp package used in your project.
// A compilation error at this line likely means your copy of the
// twirp package needs to be updated.
const _ = twirp.TwirpPackageIsVersion7

// =====================
// UserService Interface
// =====================

// UserService is the User service.
type UserService interface {
	// CreateUser creates a new user with the given username.
	CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)

	// GetCurrentUser gets information associated with the current user.
	//
	// The user's ID is retrieved from the request's authentication header.
	GetCurrentUser(context.Context, *GetCurrentUserRequest) (*GetCurrentUserResponse, error)

	// GetUser gets a user by ID.
	GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)

	// GetUserByUsername gets a user by username.
	GetUserByUsername(context.Context, *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error)

	// ListUsers lists all users.
	ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)

	// ListOrganizationUsers lists all users for an organization.
	ListOrganizationUsers(context.Context, *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error)

	// UpdateUserUsername updates a user's username.
	UpdateUserUsername(context.Context, *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error)

	// DeleteUser deletes a user.
	DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)

	// AddUserOrganizationScope adds an organization scope for a specific organization to a user by ID.
	AddUserOrganizationScope(context.Context, *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error)

	// AddUserOrganizationScopeByName adds an organization scope for a specific organization to a user by name.
	AddUserOrganizationScopeByName(context.Context, *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error)

	// RemoveUserOrganizationScope removes an organization scope for a specific organization from a user by ID.
	RemoveUserOrganizationScope(context.Context, *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error)

	// RemoveUserOrganizationScopeByName removes an organization scope for a specific organization from a user by name.
	RemoveUserOrganizationScopeByName(context.Context, *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error)

	// AddUserServerScope adds a server scope for a user by ID.
	AddUserServerScope(context.Context, *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error)

	// AddUserServerScopeByName adds a server scope for a user by name.
	AddUserServerScopeByName(context.Context, *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error)

	// RemoveUserServerScope removes a server scope for a user by ID.
	RemoveUserServerScope(context.Context, *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error)

	// RemoveUserServerScopeByName removes a server scope for a user by name.
	RemoveUserServerScopeByName(context.Context, *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error)
}

// ===========================
// UserService Protobuf Client
// ===========================

type userServiceProtobufClient struct {
	client      HTTPClient
	urls        [16]string
	interceptor twirp.Interceptor
	opts        twirp.ClientOptions
}

// NewUserServiceProtobufClient creates a Protobuf client that implements the UserService interface.
// It communicates using Protobuf and can be configured with a custom HTTPClient.
func NewUserServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) UserService {
	if c, ok := client.(*http.Client); ok {
		client = withoutRedirects(c)
	}

	clientOpts := twirp.ClientOptions{}
	for _, o := range opts {
		o(&clientOpts)
	}

	// Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method>
	serviceURL := sanitizeBaseURL(baseURL)
	serviceURL += baseServicePath(clientOpts.PathPrefix(), "buf.alpha.registry.v1alpha1", "UserService")
	urls := [16]string{
		serviceURL + "CreateUser",
		serviceURL + "GetCurrentUser",
		serviceURL + "GetUser",
		serviceURL + "GetUserByUsername",
		serviceURL + "ListUsers",
		serviceURL + "ListOrganizationUsers",
		serviceURL + "UpdateUserUsername",
		serviceURL + "DeleteUser",
		serviceURL + "AddUserOrganizationScope",
		serviceURL + "AddUserOrganizationScopeByName",
		serviceURL + "RemoveUserOrganizationScope",
		serviceURL + "RemoveUserOrganizationScopeByName",
		serviceURL + "AddUserServerScope",
		serviceURL + "AddUserServerScopeByName",
		serviceURL + "RemoveUserServerScope",
		serviceURL + "RemoveUserServerScopeByName",
	}

	return &userServiceProtobufClient{
		client:      client,
		urls:        urls,
		interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...),
		opts:        clientOpts,
	}
}

func (c *userServiceProtobufClient) CreateUser(ctx context.Context, in *CreateUserRequest) (*CreateUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "CreateUser")
	caller := c.callCreateUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateUserRequest) when calling interceptor")
					}
					return c.callCreateUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callCreateUser(ctx context.Context, in *CreateUserRequest) (*CreateUserResponse, error) {
	out := new(CreateUserResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) GetCurrentUser(ctx context.Context, in *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "GetCurrentUser")
	caller := c.callGetCurrentUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetCurrentUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetCurrentUserRequest) when calling interceptor")
					}
					return c.callGetCurrentUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetCurrentUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetCurrentUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callGetCurrentUser(ctx context.Context, in *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
	out := new(GetCurrentUserResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) GetUser(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "GetUser")
	caller := c.callGetUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserRequest) when calling interceptor")
					}
					return c.callGetUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callGetUser(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error) {
	out := new(GetUserResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) GetUserByUsername(ctx context.Context, in *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "GetUserByUsername")
	caller := c.callGetUserByUsername
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserByUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserByUsernameRequest) when calling interceptor")
					}
					return c.callGetUserByUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserByUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserByUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callGetUserByUsername(ctx context.Context, in *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
	out := new(GetUserByUsernameResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) ListUsers(ctx context.Context, in *ListUsersRequest) (*ListUsersResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "ListUsers")
	caller := c.callListUsers
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUsersRequest) when calling interceptor")
					}
					return c.callListUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callListUsers(ctx context.Context, in *ListUsersRequest) (*ListUsersResponse, error) {
	out := new(ListUsersResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) ListOrganizationUsers(ctx context.Context, in *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationUsers")
	caller := c.callListOrganizationUsers
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationUsersRequest) when calling interceptor")
					}
					return c.callListOrganizationUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callListOrganizationUsers(ctx context.Context, in *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
	out := new(ListOrganizationUsersResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) UpdateUserUsername(ctx context.Context, in *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateUserUsername")
	caller := c.callUpdateUserUsername
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateUserUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateUserUsernameRequest) when calling interceptor")
					}
					return c.callUpdateUserUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateUserUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateUserUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callUpdateUserUsername(ctx context.Context, in *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
	out := new(UpdateUserUsernameResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) DeleteUser(ctx context.Context, in *DeleteUserRequest) (*DeleteUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteUser")
	caller := c.callDeleteUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteUserRequest) (*DeleteUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteUserRequest) when calling interceptor")
					}
					return c.callDeleteUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callDeleteUser(ctx context.Context, in *DeleteUserRequest) (*DeleteUserResponse, error) {
	out := new(DeleteUserResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) AddUserOrganizationScope(ctx context.Context, in *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScope")
	caller := c.callAddUserOrganizationScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeRequest) when calling interceptor")
					}
					return c.callAddUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callAddUserOrganizationScope(ctx context.Context, in *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
	out := new(AddUserOrganizationScopeResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) AddUserOrganizationScopeByName(ctx context.Context, in *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScopeByName")
	caller := c.callAddUserOrganizationScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return c.callAddUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callAddUserOrganizationScopeByName(ctx context.Context, in *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
	out := new(AddUserOrganizationScopeByNameResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) RemoveUserOrganizationScope(ctx context.Context, in *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScope")
	caller := c.callRemoveUserOrganizationScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeRequest) when calling interceptor")
					}
					return c.callRemoveUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callRemoveUserOrganizationScope(ctx context.Context, in *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
	out := new(RemoveUserOrganizationScopeResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) RemoveUserOrganizationScopeByName(ctx context.Context, in *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScopeByName")
	caller := c.callRemoveUserOrganizationScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return c.callRemoveUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callRemoveUserOrganizationScopeByName(ctx context.Context, in *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
	out := new(RemoveUserOrganizationScopeByNameResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[11], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) AddUserServerScope(ctx context.Context, in *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScope")
	caller := c.callAddUserServerScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeRequest) when calling interceptor")
					}
					return c.callAddUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callAddUserServerScope(ctx context.Context, in *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
	out := new(AddUserServerScopeResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[12], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) AddUserServerScopeByName(ctx context.Context, in *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScopeByName")
	caller := c.callAddUserServerScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeByNameRequest) when calling interceptor")
					}
					return c.callAddUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callAddUserServerScopeByName(ctx context.Context, in *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
	out := new(AddUserServerScopeByNameResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[13], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) RemoveUserServerScope(ctx context.Context, in *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScope")
	caller := c.callRemoveUserServerScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeRequest) when calling interceptor")
					}
					return c.callRemoveUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callRemoveUserServerScope(ctx context.Context, in *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
	out := new(RemoveUserServerScopeResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[14], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceProtobufClient) RemoveUserServerScopeByName(ctx context.Context, in *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScopeByName")
	caller := c.callRemoveUserServerScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeByNameRequest) when calling interceptor")
					}
					return c.callRemoveUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceProtobufClient) callRemoveUserServerScopeByName(ctx context.Context, in *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
	out := new(RemoveUserServerScopeByNameResponse)
	ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[15], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

// =======================
// UserService JSON Client
// =======================

type userServiceJSONClient struct {
	client      HTTPClient
	urls        [16]string
	interceptor twirp.Interceptor
	opts        twirp.ClientOptions
}

// NewUserServiceJSONClient creates a JSON client that implements the UserService interface.
// It communicates using JSON and can be configured with a custom HTTPClient.
func NewUserServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) UserService {
	if c, ok := client.(*http.Client); ok {
		client = withoutRedirects(c)
	}

	clientOpts := twirp.ClientOptions{}
	for _, o := range opts {
		o(&clientOpts)
	}

	// Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method>
	serviceURL := sanitizeBaseURL(baseURL)
	serviceURL += baseServicePath(clientOpts.PathPrefix(), "buf.alpha.registry.v1alpha1", "UserService")
	urls := [16]string{
		serviceURL + "CreateUser",
		serviceURL + "GetCurrentUser",
		serviceURL + "GetUser",
		serviceURL + "GetUserByUsername",
		serviceURL + "ListUsers",
		serviceURL + "ListOrganizationUsers",
		serviceURL + "UpdateUserUsername",
		serviceURL + "DeleteUser",
		serviceURL + "AddUserOrganizationScope",
		serviceURL + "AddUserOrganizationScopeByName",
		serviceURL + "RemoveUserOrganizationScope",
		serviceURL + "RemoveUserOrganizationScopeByName",
		serviceURL + "AddUserServerScope",
		serviceURL + "AddUserServerScopeByName",
		serviceURL + "RemoveUserServerScope",
		serviceURL + "RemoveUserServerScopeByName",
	}

	return &userServiceJSONClient{
		client:      client,
		urls:        urls,
		interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...),
		opts:        clientOpts,
	}
}

func (c *userServiceJSONClient) CreateUser(ctx context.Context, in *CreateUserRequest) (*CreateUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "CreateUser")
	caller := c.callCreateUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateUserRequest) when calling interceptor")
					}
					return c.callCreateUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callCreateUser(ctx context.Context, in *CreateUserRequest) (*CreateUserResponse, error) {
	out := new(CreateUserResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) GetCurrentUser(ctx context.Context, in *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "GetCurrentUser")
	caller := c.callGetCurrentUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetCurrentUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetCurrentUserRequest) when calling interceptor")
					}
					return c.callGetCurrentUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetCurrentUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetCurrentUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callGetCurrentUser(ctx context.Context, in *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
	out := new(GetCurrentUserResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) GetUser(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "GetUser")
	caller := c.callGetUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserRequest) when calling interceptor")
					}
					return c.callGetUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callGetUser(ctx context.Context, in *GetUserRequest) (*GetUserResponse, error) {
	out := new(GetUserResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) GetUserByUsername(ctx context.Context, in *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "GetUserByUsername")
	caller := c.callGetUserByUsername
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserByUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserByUsernameRequest) when calling interceptor")
					}
					return c.callGetUserByUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserByUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserByUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callGetUserByUsername(ctx context.Context, in *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
	out := new(GetUserByUsernameResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) ListUsers(ctx context.Context, in *ListUsersRequest) (*ListUsersResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "ListUsers")
	caller := c.callListUsers
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUsersRequest) when calling interceptor")
					}
					return c.callListUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callListUsers(ctx context.Context, in *ListUsersRequest) (*ListUsersResponse, error) {
	out := new(ListUsersResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) ListOrganizationUsers(ctx context.Context, in *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationUsers")
	caller := c.callListOrganizationUsers
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationUsersRequest) when calling interceptor")
					}
					return c.callListOrganizationUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callListOrganizationUsers(ctx context.Context, in *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
	out := new(ListOrganizationUsersResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) UpdateUserUsername(ctx context.Context, in *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateUserUsername")
	caller := c.callUpdateUserUsername
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateUserUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateUserUsernameRequest) when calling interceptor")
					}
					return c.callUpdateUserUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateUserUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateUserUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callUpdateUserUsername(ctx context.Context, in *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
	out := new(UpdateUserUsernameResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) DeleteUser(ctx context.Context, in *DeleteUserRequest) (*DeleteUserResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteUser")
	caller := c.callDeleteUser
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteUserRequest) (*DeleteUserResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteUserRequest) when calling interceptor")
					}
					return c.callDeleteUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callDeleteUser(ctx context.Context, in *DeleteUserRequest) (*DeleteUserResponse, error) {
	out := new(DeleteUserResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) AddUserOrganizationScope(ctx context.Context, in *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScope")
	caller := c.callAddUserOrganizationScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeRequest) when calling interceptor")
					}
					return c.callAddUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callAddUserOrganizationScope(ctx context.Context, in *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
	out := new(AddUserOrganizationScopeResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) AddUserOrganizationScopeByName(ctx context.Context, in *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScopeByName")
	caller := c.callAddUserOrganizationScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return c.callAddUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callAddUserOrganizationScopeByName(ctx context.Context, in *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
	out := new(AddUserOrganizationScopeByNameResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) RemoveUserOrganizationScope(ctx context.Context, in *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScope")
	caller := c.callRemoveUserOrganizationScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeRequest) when calling interceptor")
					}
					return c.callRemoveUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callRemoveUserOrganizationScope(ctx context.Context, in *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
	out := new(RemoveUserOrganizationScopeResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) RemoveUserOrganizationScopeByName(ctx context.Context, in *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScopeByName")
	caller := c.callRemoveUserOrganizationScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return c.callRemoveUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callRemoveUserOrganizationScopeByName(ctx context.Context, in *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
	out := new(RemoveUserOrganizationScopeByNameResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[11], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) AddUserServerScope(ctx context.Context, in *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScope")
	caller := c.callAddUserServerScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeRequest) when calling interceptor")
					}
					return c.callAddUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callAddUserServerScope(ctx context.Context, in *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
	out := new(AddUserServerScopeResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[12], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) AddUserServerScopeByName(ctx context.Context, in *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScopeByName")
	caller := c.callAddUserServerScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeByNameRequest) when calling interceptor")
					}
					return c.callAddUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callAddUserServerScopeByName(ctx context.Context, in *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
	out := new(AddUserServerScopeByNameResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[13], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) RemoveUserServerScope(ctx context.Context, in *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScope")
	caller := c.callRemoveUserServerScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeRequest) when calling interceptor")
					}
					return c.callRemoveUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callRemoveUserServerScope(ctx context.Context, in *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
	out := new(RemoveUserServerScopeResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[14], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *userServiceJSONClient) RemoveUserServerScopeByName(ctx context.Context, in *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScopeByName")
	caller := c.callRemoveUserServerScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeByNameRequest) when calling interceptor")
					}
					return c.callRemoveUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *userServiceJSONClient) callRemoveUserServerScopeByName(ctx context.Context, in *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
	out := new(RemoveUserServerScopeByNameResponse)
	ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[15], in, out)
	if err != nil {
		twerr, ok := err.(twirp.Error)
		if !ok {
			twerr = twirp.InternalErrorWith(err)
		}
		callClientError(ctx, c.opts.Hooks, twerr)
		return nil, err
	}

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

// ==========================
// UserService Server Handler
// ==========================

type userServiceServer struct {
	UserService
	interceptor      twirp.Interceptor
	hooks            *twirp.ServerHooks
	pathPrefix       string // prefix for routing
	jsonSkipDefaults bool   // do not include unpopulated fields (default values) in the response
}

// NewUserServiceServer builds a TwirpServer that can be used as an http.Handler to handle
// HTTP requests that are routed to the right method in the provided svc implementation.
// The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).
func NewUserServiceServer(svc UserService, opts ...interface{}) TwirpServer {
	serverOpts := twirp.ServerOptions{}
	for _, opt := range opts {
		switch o := opt.(type) {
		case twirp.ServerOption:
			o(&serverOpts)
		case *twirp.ServerHooks: // backwards compatibility, allow to specify hooks as an argument
			twirp.WithServerHooks(o)(&serverOpts)
		case nil: // backwards compatibility, allow nil value for the argument
			continue
		default:
			panic(fmt.Sprintf("Invalid option type %T on NewUserServiceServer", o))
		}
	}

	return &userServiceServer{
		UserService:      svc,
		pathPrefix:       serverOpts.PathPrefix(),
		interceptor:      twirp.ChainInterceptors(serverOpts.Interceptors...),
		hooks:            serverOpts.Hooks,
		jsonSkipDefaults: serverOpts.JSONSkipDefaults,
	}
}

// writeError writes an HTTP response with a valid Twirp error format, and triggers hooks.
// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
func (s *userServiceServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) {
	writeError(ctx, resp, err, s.hooks)
}

// UserServicePathPrefix is a convenience constant that could used to identify URL paths.
// Should be used with caution, it only matches routes generated by Twirp Go clients,
// that add a "/twirp" prefix by default, and use CamelCase service and method names.
// More info: https://twitchtv.github.io/twirp/docs/routing.html
const UserServicePathPrefix = "/twirp/buf.alpha.registry.v1alpha1.UserService/"

func (s *userServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
	ctx := req.Context()
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "UserService")
	ctx = ctxsetters.WithResponseWriter(ctx, resp)

	var err error
	ctx, err = callRequestReceived(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	if req.Method != "POST" {
		msg := fmt.Sprintf("unsupported method %q (only POST is allowed)", req.Method)
		s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path))
		return
	}

	// Verify path format: [<prefix>]/<package>.<Service>/<Method>
	prefix, pkgService, method := parseTwirpPath(req.URL.Path)
	if pkgService != "buf.alpha.registry.v1alpha1.UserService" {
		msg := fmt.Sprintf("no handler for path %q", req.URL.Path)
		s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path))
		return
	}
	if prefix != s.pathPrefix {
		msg := fmt.Sprintf("invalid path prefix %q, expected %q, on path %q", prefix, s.pathPrefix, req.URL.Path)
		s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path))
		return
	}

	switch method {
	case "CreateUser":
		s.serveCreateUser(ctx, resp, req)
		return
	case "GetCurrentUser":
		s.serveGetCurrentUser(ctx, resp, req)
		return
	case "GetUser":
		s.serveGetUser(ctx, resp, req)
		return
	case "GetUserByUsername":
		s.serveGetUserByUsername(ctx, resp, req)
		return
	case "ListUsers":
		s.serveListUsers(ctx, resp, req)
		return
	case "ListOrganizationUsers":
		s.serveListOrganizationUsers(ctx, resp, req)
		return
	case "UpdateUserUsername":
		s.serveUpdateUserUsername(ctx, resp, req)
		return
	case "DeleteUser":
		s.serveDeleteUser(ctx, resp, req)
		return
	case "AddUserOrganizationScope":
		s.serveAddUserOrganizationScope(ctx, resp, req)
		return
	case "AddUserOrganizationScopeByName":
		s.serveAddUserOrganizationScopeByName(ctx, resp, req)
		return
	case "RemoveUserOrganizationScope":
		s.serveRemoveUserOrganizationScope(ctx, resp, req)
		return
	case "RemoveUserOrganizationScopeByName":
		s.serveRemoveUserOrganizationScopeByName(ctx, resp, req)
		return
	case "AddUserServerScope":
		s.serveAddUserServerScope(ctx, resp, req)
		return
	case "AddUserServerScopeByName":
		s.serveAddUserServerScopeByName(ctx, resp, req)
		return
	case "RemoveUserServerScope":
		s.serveRemoveUserServerScope(ctx, resp, req)
		return
	case "RemoveUserServerScopeByName":
		s.serveRemoveUserServerScopeByName(ctx, resp, req)
		return
	default:
		msg := fmt.Sprintf("no handler for path %q", req.URL.Path)
		s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path))
		return
	}
}

func (s *userServiceServer) serveCreateUser(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveCreateUserJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveCreateUserProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveCreateUserJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "CreateUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(CreateUserRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.CreateUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateUserRequest) when calling interceptor")
					}
					return s.UserService.CreateUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *CreateUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateUserResponse and nil error while calling CreateUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveCreateUserProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "CreateUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(CreateUserRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.CreateUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateUserRequest) when calling interceptor")
					}
					return s.UserService.CreateUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *CreateUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateUserResponse and nil error while calling CreateUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveGetCurrentUser(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveGetCurrentUserJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveGetCurrentUserProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveGetCurrentUserJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetCurrentUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(GetCurrentUserRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.GetCurrentUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetCurrentUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetCurrentUserRequest) when calling interceptor")
					}
					return s.UserService.GetCurrentUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetCurrentUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetCurrentUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetCurrentUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *GetCurrentUserResponse and nil error while calling GetCurrentUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveGetCurrentUserProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetCurrentUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(GetCurrentUserRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.GetCurrentUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetCurrentUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetCurrentUserRequest) when calling interceptor")
					}
					return s.UserService.GetCurrentUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetCurrentUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetCurrentUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetCurrentUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *GetCurrentUserResponse and nil error while calling GetCurrentUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveGetUser(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveGetUserJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveGetUserProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveGetUserJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(GetUserRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.GetUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserRequest) when calling interceptor")
					}
					return s.UserService.GetUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *GetUserResponse and nil error while calling GetUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveGetUserProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(GetUserRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.GetUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserRequest) when calling interceptor")
					}
					return s.UserService.GetUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *GetUserResponse and nil error while calling GetUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveGetUserByUsername(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveGetUserByUsernameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveGetUserByUsernameProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveGetUserByUsernameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetUserByUsername")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(GetUserByUsernameRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.GetUserByUsername
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserByUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserByUsernameRequest) when calling interceptor")
					}
					return s.UserService.GetUserByUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserByUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserByUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetUserByUsernameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *GetUserByUsernameResponse and nil error while calling GetUserByUsername. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveGetUserByUsernameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetUserByUsername")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(GetUserByUsernameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.GetUserByUsername
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetUserByUsernameRequest) (*GetUserByUsernameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetUserByUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetUserByUsernameRequest) when calling interceptor")
					}
					return s.UserService.GetUserByUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetUserByUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetUserByUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetUserByUsernameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *GetUserByUsernameResponse and nil error while calling GetUserByUsername. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveListUsers(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveListUsersJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveListUsersProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveListUsersJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListUsers")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(ListUsersRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.ListUsers
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUsersRequest) when calling interceptor")
					}
					return s.UserService.ListUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *ListUsersResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *ListUsersResponse and nil error while calling ListUsers. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveListUsersProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListUsers")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(ListUsersRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.ListUsers
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUsersRequest) when calling interceptor")
					}
					return s.UserService.ListUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *ListUsersResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *ListUsersResponse and nil error while calling ListUsers. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveListOrganizationUsers(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveListOrganizationUsersJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveListOrganizationUsersProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveListOrganizationUsersJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationUsers")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(ListOrganizationUsersRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.ListOrganizationUsers
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationUsersRequest) when calling interceptor")
					}
					return s.UserService.ListOrganizationUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *ListOrganizationUsersResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *ListOrganizationUsersResponse and nil error while calling ListOrganizationUsers. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveListOrganizationUsersProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationUsers")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(ListOrganizationUsersRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.ListOrganizationUsers
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *ListOrganizationUsersRequest) (*ListOrganizationUsersResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationUsersRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationUsersRequest) when calling interceptor")
					}
					return s.UserService.ListOrganizationUsers(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationUsersResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationUsersResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *ListOrganizationUsersResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *ListOrganizationUsersResponse and nil error while calling ListOrganizationUsers. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveUpdateUserUsername(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveUpdateUserUsernameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveUpdateUserUsernameProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveUpdateUserUsernameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateUserUsername")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(UpdateUserUsernameRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.UpdateUserUsername
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateUserUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateUserUsernameRequest) when calling interceptor")
					}
					return s.UserService.UpdateUserUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateUserUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateUserUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *UpdateUserUsernameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateUserUsernameResponse and nil error while calling UpdateUserUsername. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveUpdateUserUsernameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateUserUsername")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(UpdateUserUsernameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.UpdateUserUsername
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *UpdateUserUsernameRequest) (*UpdateUserUsernameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateUserUsernameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateUserUsernameRequest) when calling interceptor")
					}
					return s.UserService.UpdateUserUsername(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateUserUsernameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateUserUsernameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *UpdateUserUsernameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateUserUsernameResponse and nil error while calling UpdateUserUsername. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveDeleteUser(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveDeleteUserJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveDeleteUserProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveDeleteUserJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(DeleteUserRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.DeleteUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *DeleteUserRequest) (*DeleteUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteUserRequest) when calling interceptor")
					}
					return s.UserService.DeleteUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *DeleteUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteUserResponse and nil error while calling DeleteUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveDeleteUserProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteUser")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(DeleteUserRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.DeleteUser
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *DeleteUserRequest) (*DeleteUserResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteUserRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteUserRequest) when calling interceptor")
					}
					return s.UserService.DeleteUser(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteUserResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteUserResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *DeleteUserResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteUserResponse and nil error while calling DeleteUser. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserOrganizationScope(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveAddUserOrganizationScopeJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveAddUserOrganizationScopeProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveAddUserOrganizationScopeJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(AddUserOrganizationScopeRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserOrganizationScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeRequest) when calling interceptor")
					}
					return s.UserService.AddUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserOrganizationScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserOrganizationScopeResponse and nil error while calling AddUserOrganizationScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserOrganizationScopeProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(AddUserOrganizationScopeRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserOrganizationScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserOrganizationScopeRequest) (*AddUserOrganizationScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeRequest) when calling interceptor")
					}
					return s.UserService.AddUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserOrganizationScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserOrganizationScopeResponse and nil error while calling AddUserOrganizationScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserOrganizationScopeByName(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveAddUserOrganizationScopeByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveAddUserOrganizationScopeByNameProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveAddUserOrganizationScopeByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(AddUserOrganizationScopeByNameRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserOrganizationScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.AddUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserOrganizationScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserOrganizationScopeByNameResponse and nil error while calling AddUserOrganizationScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserOrganizationScopeByNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserOrganizationScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(AddUserOrganizationScopeByNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserOrganizationScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserOrganizationScopeByNameRequest) (*AddUserOrganizationScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.AddUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserOrganizationScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserOrganizationScopeByNameResponse and nil error while calling AddUserOrganizationScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserOrganizationScope(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveRemoveUserOrganizationScopeJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveRemoveUserOrganizationScopeProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveRemoveUserOrganizationScopeJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(RemoveUserOrganizationScopeRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserOrganizationScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserOrganizationScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserOrganizationScopeResponse and nil error while calling RemoveUserOrganizationScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserOrganizationScopeProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(RemoveUserOrganizationScopeRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserOrganizationScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserOrganizationScopeRequest) (*RemoveUserOrganizationScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserOrganizationScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserOrganizationScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserOrganizationScopeResponse and nil error while calling RemoveUserOrganizationScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserOrganizationScopeByName(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveRemoveUserOrganizationScopeByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveRemoveUserOrganizationScopeByNameProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveRemoveUserOrganizationScopeByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(RemoveUserOrganizationScopeByNameRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserOrganizationScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserOrganizationScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserOrganizationScopeByNameResponse and nil error while calling RemoveUserOrganizationScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserOrganizationScopeByNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserOrganizationScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(RemoveUserOrganizationScopeByNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserOrganizationScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserOrganizationScopeByNameRequest) (*RemoveUserOrganizationScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserOrganizationScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserOrganizationScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserOrganizationScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserOrganizationScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserOrganizationScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserOrganizationScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserOrganizationScopeByNameResponse and nil error while calling RemoveUserOrganizationScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserServerScope(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveAddUserServerScopeJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveAddUserServerScopeProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveAddUserServerScopeJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(AddUserServerScopeRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserServerScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeRequest) when calling interceptor")
					}
					return s.UserService.AddUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserServerScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserServerScopeResponse and nil error while calling AddUserServerScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserServerScopeProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(AddUserServerScopeRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserServerScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserServerScopeRequest) (*AddUserServerScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeRequest) when calling interceptor")
					}
					return s.UserService.AddUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserServerScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserServerScopeResponse and nil error while calling AddUserServerScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserServerScopeByName(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveAddUserServerScopeByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveAddUserServerScopeByNameProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveAddUserServerScopeByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(AddUserServerScopeByNameRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserServerScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.AddUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserServerScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserServerScopeByNameResponse and nil error while calling AddUserServerScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveAddUserServerScopeByNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddUserServerScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(AddUserServerScopeByNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.AddUserServerScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *AddUserServerScopeByNameRequest) (*AddUserServerScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddUserServerScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.AddUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *AddUserServerScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *AddUserServerScopeByNameResponse and nil error while calling AddUserServerScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserServerScope(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveRemoveUserServerScopeJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveRemoveUserServerScopeProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveRemoveUserServerScopeJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(RemoveUserServerScopeRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserServerScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserServerScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserServerScopeResponse and nil error while calling RemoveUserServerScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserServerScopeProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(RemoveUserServerScopeRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserServerScope
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserServerScopeRequest) (*RemoveUserServerScopeResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserServerScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserServerScopeResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserServerScopeResponse and nil error while calling RemoveUserServerScope. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserServerScopeByName(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	header := req.Header.Get("Content-Type")
	i := strings.Index(header, ";")
	if i == -1 {
		i = len(header)
	}
	switch strings.TrimSpace(strings.ToLower(header[:i])) {
	case "application/json":
		s.serveRemoveUserServerScopeByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveRemoveUserServerScopeByNameProtobuf(ctx, resp, req)
	default:
		msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
		twerr := badRouteError(msg, req.Method, req.URL.Path)
		s.writeError(ctx, resp, twerr)
	}
}

func (s *userServiceServer) serveRemoveUserServerScopeByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(RemoveUserServerScopeByNameRequest)
	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
	if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserServerScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserServerScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserServerScopeByNameResponse and nil error while calling RemoveUserServerScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	var buf bytes.Buffer
	marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults}
	if err = marshaler.Marshal(&buf, respContent); err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	respBytes := buf.Bytes()
	resp.Header().Set("Content-Type", "application/json")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)

	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) serveRemoveUserServerScopeByNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveUserServerScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	buf, err := ioutil.ReadAll(req.Body)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
		return
	}
	reqContent := new(RemoveUserServerScopeByNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

	handler := s.UserService.RemoveUserServerScopeByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *RemoveUserServerScopeByNameRequest) (*RemoveUserServerScopeByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveUserServerScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveUserServerScopeByNameRequest) when calling interceptor")
					}
					return s.UserService.RemoveUserServerScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveUserServerScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveUserServerScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *RemoveUserServerScopeByNameResponse
	func() {
		defer ensurePanicResponses(ctx, resp, s.hooks)
		respContent, err = handler(ctx, reqContent)
	}()

	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}
	if respContent == nil {
		s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveUserServerScopeByNameResponse and nil error while calling RemoveUserServerScopeByName. nil responses are not supported"))
		return
	}

	ctx = callResponsePrepared(ctx, s.hooks)

	respBytes, err := proto.Marshal(respContent)
	if err != nil {
		s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response"))
		return
	}

	ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK)
	resp.Header().Set("Content-Type", "application/protobuf")
	resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes)))
	resp.WriteHeader(http.StatusOK)
	if n, err := resp.Write(respBytes); err != nil {
		msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error())
		twerr := twirp.NewError(twirp.Unknown, msg)
		ctx = callError(ctx, s.hooks, twerr)
	}
	callResponseSent(ctx, s.hooks)
}

func (s *userServiceServer) ServiceDescriptor() ([]byte, int) {
	return twirpFileDescriptor7, 0
}

func (s *userServiceServer) ProtocGenTwirpVersion() string {
	return "v7.1.0"
}

// PathPrefix returns the base service path, in the form: "/<prefix>/<package>.<Service>/"
// that is everything in a Twirp route except for the <Method>. This can be used for routing,
// for example to identify the requests that are targeted to this service in a mux.
func (s *userServiceServer) PathPrefix() string {
	return baseServicePath(s.pathPrefix, "buf.alpha.registry.v1alpha1", "UserService")
}

var twirpFileDescriptor7 = []byte{
	// 1099 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x41, 0x6f, 0x1b, 0x45,
	0x14, 0xd6, 0x38, 0x86, 0x26, 0xcf, 0x6d, 0x52, 0x0f, 0x14, 0x9c, 0x4d, 0x42, 0x9c, 0x45, 0x4d,
	0x8d, 0x02, 0xbb, 0xaa, 0xab, 0xb6, 0x82, 0x02, 0x2d, 0x09, 0x50, 0x50, 0x11, 0x45, 0x4e, 0x73,
	0xa9, 0x40, 0xd6, 0x3a, 0x9e, 0x38, 0x0b, 0xf6, 0xee, 0xb2, 0xb3, 0x4e, 0x9b, 0x70, 0x00, 0x21,
	0x21, 0x55, 0xe2, 0x8a, 0xc4, 0xa9, 0x57, 0x0e, 0x08, 0x89, 0x2b, 0x48, 0xdc, 0x91, 0xf8, 0x55,
	0x68, 0x66, 0x77, 0xed, 0x19, 0xef, 0xee, 0xec, 0xc6, 0x86, 0x56, 0xbd, 0x65, 0xdf, 0x7c, 0xef,
	0xbd, 0x6f, 0xde, 0x9b, 0xf7, 0xf2, 0xc9, 0xb0, 0xd9, 0x19, 0x1e, 0x98, 0x56, 0xdf, 0x3b, 0xb4,
	0x4c, 0x9f, 0xf4, 0x6c, 0x1a, 0xf8, 0xc7, 0xe6, 0xd1, 0x65, 0x6e, 0xb8, 0x6c, 0x0e, 0x29, 0xf1,
	0x0d, 0xcf, 0x77, 0x03, 0x17, 0xaf, 0x74, 0x86, 0x07, 0x06, 0x37, 0x1b, 0x31, 0xce, 0x88, 0x71,
	0x5a, 0x7d, 0x1c, 0xc4, 0xf2, 0xec, 0xb1, 0xbf, 0xe5, 0xd9, 0xa1, 0xbb, 0x76, 0x49, 0x95, 0x86,
	0xee, 0xbb, 0x1e, 0x89, 0x80, 0xeb, 0x3d, 0xd7, 0xed, 0xf5, 0x89, 0xc9, 0xbf, 0x98, 0x53, 0x60,
	0x0f, 0x08, 0x0d, 0xac, 0x81, 0x17, 0x02, 0xf4, 0xdf, 0x10, 0x94, 0xf7, 0x28, 0xf1, 0xf1, 0x22,
	0x94, 0xec, 0x6e, 0x0d, 0xd5, 0x51, 0x63, 0xa1, 0x55, 0xb2, 0xbb, 0xf8, 0x06, 0x54, 0xf6, 0x7d,
	0x62, 0x05, 0xa4, 0xcd, 0x5c, 0x6a, 0xa5, 0x3a, 0x6a, 0x54, 0x9a, 0x9a, 0x11, 0xc6, 0x33, 0xe2,
	0x78, 0xc6, 0xbd, 0x38, 0x5e, 0x0b, 0x42, 0x38, 0x33, 0x30, 0xe7, 0xa1, 0xd7, 0x1d, 0x39, 0xcf,
	0xe5, 0x3b, 0x87, 0x70, 0xee, 0xac, 0xc1, 0x3c, 0xab, 0x94, 0x63, 0x0d, 0x48, 0xad, 0xcc, 0xf9,
	0x8c, 0xbe, 0x75, 0x13, 0xaa, 0x3b, 0x3c, 0x0d, 0xe3, 0xdc, 0x22, 0x5f, 0x0f, 0x09, 0x0d, 0x24,
	0x07, 0x34, 0xe1, 0x70, 0x07, 0xb0, 0xe8, 0x40, 0x3d, 0xd7, 0xa1, 0x04, 0x5f, 0x85, 0x32, 0x43,
	0x70, 0x74, 0xa5, 0xb9, 0x61, 0x28, 0xba, 0x61, 0x70, 0x47, 0x0e, 0xd7, 0x5f, 0x86, 0x0b, 0xb7,
	0x49, 0xb0, 0x33, 0xf4, 0x7d, 0xe2, 0x04, 0x02, 0x03, 0xfd, 0x2e, 0xbc, 0x34, 0x79, 0x30, 0x5b,
	0xa6, 0x3a, 0x2c, 0xde, 0x26, 0x62, 0x8a, 0xc9, 0xfe, 0xe8, 0x1f, 0xc1, 0xd2, 0x08, 0x31, 0x5b,
	0xae, 0x6b, 0x50, 0x8b, 0x22, 0x6d, 0x1f, 0xef, 0x45, 0x75, 0x2b, 0x52, 0xda, 0x16, 0x2c, 0xa7,
	0xf8, 0xcd, 0xc6, 0xe5, 0x10, 0xce, 0x7f, 0x62, 0x53, 0x1e, 0x94, 0xc6, 0x1c, 0x56, 0x60, 0xc1,
	0xb3, 0x7a, 0xa4, 0x4d, 0xed, 0x93, 0x90, 0xc4, 0xb9, 0xd6, 0x3c, 0x33, 0xec, 0xda, 0x27, 0x04,
	0xaf, 0x01, 0xf0, 0xc3, 0xc0, 0xfd, 0x8a, 0x38, 0xfc, 0x95, 0x2e, 0xb4, 0x38, 0xfc, 0x1e, 0x33,
	0xe0, 0x1a, 0x9c, 0xf1, 0xc9, 0x11, 0xf1, 0x69, 0xf8, 0x08, 0xe7, 0x5b, 0xf1, 0xa7, 0x1e, 0x40,
	0x55, 0xc8, 0x14, 0xb1, 0xbe, 0x0e, 0xcf, 0x31, 0x1a, 0xb4, 0x86, 0xea, 0x73, 0xc5, 0x68, 0x87,
	0x78, 0xbc, 0x09, 0x4b, 0x0e, 0x79, 0x18, 0xb4, 0x13, 0x5c, 0xce, 0x31, 0xf3, 0x67, 0x31, 0x1f,
	0xfd, 0x31, 0x82, 0x55, 0x96, 0xf6, 0xae, 0xdf, 0xb3, 0x1c, 0xfb, 0xc4, 0x0a, 0x6c, 0xd7, 0x91,
	0x2e, 0x7b, 0x09, 0x96, 0x5c, 0xe1, 0xac, 0x3d, 0xea, 0xf9, 0xa2, 0x68, 0xfe, 0xb8, 0x2b, 0x57,
	0xa5, 0xa4, 0xac, 0xca, 0x9c, 0xa2, 0x2a, 0x65, 0xb9, 0x2a, 0xdf, 0x21, 0x58, 0xcb, 0xe0, 0xf7,
	0xa4, 0x4a, 0xf4, 0x2e, 0x2c, 0xef, 0xf1, 0x65, 0xc0, 0x9c, 0x27, 0xdf, 0xe3, 0x06, 0x9c, 0x75,
	0xc8, 0x83, 0xf6, 0xc4, 0x9b, 0xac, 0x38, 0xe4, 0x41, 0x8c, 0xd4, 0x77, 0x41, 0x4b, 0xf3, 0x9f,
	0xed, 0x5d, 0xbe, 0x00, 0xd5, 0xf7, 0x49, 0x9f, 0x48, 0x7b, 0x47, 0x7f, 0x11, 0xb0, 0x68, 0x0c,
	0x33, 0xe8, 0x7f, 0x22, 0x58, 0x7f, 0xaf, 0xdb, 0x65, 0x36, 0xb1, 0x8a, 0xbb, 0x6c, 0x2b, 0x67,
	0x0c, 0x73, 0x5a, 0xd7, 0x4b, 0xa9, 0x5d, 0xff, 0x02, 0xb0, 0x04, 0xe4, 0xbb, 0x9e, 0x37, 0x78,
	0xb1, 0x69, 0x28, 0x2f, 0x93, 0xe4, 0x52, 0x75, 0x27, 0x4d, 0xba, 0x0e, 0xf5, 0x6c, 0xea, 0xd1,
	0xfd, 0xfe, 0x46, 0x70, 0x31, 0x0b, 0xb4, 0x7d, 0xfc, 0xa9, 0xd0, 0x2c, 0x0c, 0x65, 0xa1, 0x49,
	0xfc, 0x6f, 0xbc, 0x05, 0x52, 0xda, 0x36, 0x07, 0x84, 0x77, 0x3d, 0x2f, 0x1e, 0xb0, 0x38, 0xff,
	0xf7, 0x6d, 0x1b, 0xb0, 0x99, 0x77, 0x91, 0xe8, 0xce, 0x7f, 0x21, 0xd0, 0x5b, 0x64, 0xe0, 0x1e,
	0x91, 0x67, 0xb2, 0xad, 0x17, 0xe1, 0x55, 0x25, 0xfb, 0xe8, 0x96, 0xff, 0x20, 0x68, 0x28, 0x70,
	0xcf, 0x56, 0x73, 0xb7, 0xe0, 0xb5, 0x02, 0x77, 0x89, 0x6e, 0xfe, 0x10, 0x96, 0xa3, 0x97, 0xb0,
	0x4b, 0xfc, 0x23, 0xe2, 0x2b, 0xbb, 0x7a, 0x07, 0xce, 0x52, 0x8e, 0x8a, 0x28, 0x97, 0x38, 0xe5,
	0x86, 0x92, 0xb2, 0x18, 0xb6, 0x42, 0xc7, 0x1f, 0xfa, 0x2a, 0x68, 0x69, 0x99, 0x23, 0x5e, 0xdf,
	0x8f, 0x77, 0x89, 0x70, 0x9c, 0xdf, 0x88, 0xff, 0x94, 0xe2, 0x78, 0x29, 0xa4, 0x70, 0x88, 0x88,
	0x7e, 0x03, 0xab, 0xe3, 0x6a, 0x3f, 0xe9, 0x1a, 0xae, 0xc3, 0x5a, 0x46, 0xf2, 0x88, 0xdd, 0x0f,
	0xd2, 0xf8, 0x3e, 0xbd, 0x4a, 0x4a, 0x73, 0x98, 0x59, 0xcc, 0xe6, 0xaf, 0x18, 0x2a, 0x31, 0xc2,
	0xde, 0x27, 0x98, 0x02, 0x8c, 0x35, 0x2c, 0x56, 0xcf, 0x46, 0x42, 0x1d, 0x6b, 0x66, 0x61, 0x7c,
	0x54, 0xad, 0xf2, 0xa3, 0x9f, 0xf5, 0x12, 0xfe, 0x96, 0x2b, 0x50, 0x41, 0xd2, 0xe2, 0xa6, 0x32,
	0x50, 0xaa, 0x30, 0xd6, 0xae, 0x9c, 0xca, 0x47, 0x20, 0x80, 0xf0, 0x97, 0x70, 0x26, 0x92, 0x97,
	0x78, 0x2b, 0x2f, 0x8a, 0x98, 0xf2, 0xf5, 0x62, 0x60, 0x29, 0xd7, 0x23, 0x04, 0xd5, 0x84, 0x96,
	0xc5, 0x57, 0x8b, 0x44, 0x4a, 0x68, 0x66, 0xed, 0xda, 0x69, 0xdd, 0x24, 0x2a, 0x1e, 0x2c, 0x8c,
	0x74, 0x29, 0x7e, 0x43, 0x19, 0x6a, 0x52, 0x29, 0x6b, 0x46, 0x51, 0xb8, 0x94, 0xf1, 0x27, 0x04,
	0x17, 0x52, 0x35, 0x1f, 0x7e, 0x33, 0x37, 0x5e, 0x96, 0x8e, 0xd5, 0xde, 0x9a, 0xc6, 0x55, 0xa2,
	0xf5, 0x23, 0x02, 0x9c, 0x14, 0x72, 0x58, 0x5d, 0xdd, 0x4c, 0xe5, 0xa8, 0x5d, 0x3f, 0xb5, 0x9f,
	0x34, 0x0e, 0x14, 0x60, 0xac, 0xf5, 0x72, 0x66, 0x30, 0xa1, 0x14, 0x73, 0x66, 0x30, 0x45, 0x44,
	0x86, 0x49, 0x1f, 0x23, 0xa8, 0x65, 0x29, 0x14, 0xfc, 0xb6, 0x32, 0x66, 0x8e, 0x02, 0xd5, 0xde,
	0x99, 0xd2, 0x5b, 0xe2, 0xf7, 0x3b, 0x82, 0x57, 0xd4, 0x0a, 0x0a, 0x6f, 0x4f, 0x95, 0x47, 0xda,
	0xcb, 0xda, 0xce, 0x4c, 0x31, 0x24, 0xc6, 0xbf, 0x20, 0x58, 0x51, 0xc8, 0x02, 0x7c, 0x53, 0x99,
	0x2a, 0x5f, 0x02, 0x6a, 0xb7, 0xa6, 0x0f, 0x20, 0x11, 0xfd, 0x03, 0xc1, 0x46, 0xae, 0x7e, 0xc1,
	0x1f, 0x4c, 0x9b, 0x4d, 0x2e, 0xf0, 0x87, 0xb3, 0x86, 0x91, 0xa8, 0xb3, 0xc1, 0x4d, 0x0a, 0x86,
	0x9c, 0xc1, 0xcd, 0x94, 0x5f, 0x39, 0x83, 0xab, 0x10, 0x4f, 0x89, 0x19, 0x4a, 0xfc, 0xc7, 0x2d,
	0x36, 0x43, 0x59, 0x7a, 0xa1, 0xd8, 0x0c, 0x65, 0x6b, 0xa6, 0x90, 0x1f, 0xdb, 0xbe, 0xa9, 0xa2,
	0x20, 0x67, 0xfb, 0xaa, 0xe4, 0x56, 0xce, 0xf6, 0x55, 0x8b, 0xa5, 0xb4, 0x41, 0x49, 0x56, 0xee,
	0xe6, 0xe9, 0x33, 0xc8, 0xc5, 0xbb, 0x35, 0x7d, 0x00, 0x91, 0xe8, 0xf6, 0xe7, 0xf7, 0xef, 0xf7,
	0xec, 0xe0, 0x70, 0xd8, 0x31, 0xf6, 0xdd, 0x81, 0xd9, 0x19, 0x1e, 0x74, 0x86, 0x76, 0xbf, 0xcb,
	0xfe, 0x30, 0x6d, 0x27, 0x60, 0xbb, 0xbc, 0x6f, 0xf6, 0x88, 0x13, 0xfe, 0x02, 0x6a, 0xf6, 0x5c,
	0x53, 0xf1, 0xd3, 0xe9, 0x8d, 0xd8, 0x12, 0x1b, 0x3a, 0xcf, 0x73, 0xb7, 0x2b, 0xff, 0x06, 0x00,
	0x00, 0xff, 0xff, 0xce, 0x41, 0x8e, 0xc8, 0xd8, 0x15, 0x00, 0x00,
}
