// 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/repository.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

// ===========================
// RepositoryService Interface
// ===========================

// RepositoryService is the Repository service.
// All methods on the Repository service require authentication.
type RepositoryService interface {
	// GetRepository gets a repository by ID.
	GetRepository(context.Context, *GetRepositoryRequest) (*GetRepositoryResponse, error)

	// GetRepositoryByFullName gets a repository by full name.
	GetRepositoryByFullName(context.Context, *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error)

	// ListRepositories lists all repositories.
	ListRepositories(context.Context, *ListRepositoriesRequest) (*ListRepositoriesResponse, error)

	// ListUserRepositories lists all repositories belonging to a user.
	ListUserRepositories(context.Context, *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error)

	// ListOrganizationRepositories lists all repositories for an organization.
	ListOrganizationRepositories(context.Context, *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error)

	// CreateRepositoryByFullName creates a new repository by full name.
	CreateRepositoryByFullName(context.Context, *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error)

	// UpdateRepositoryName updates a repository's name.
	UpdateRepositoryName(context.Context, *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error)

	// UpdateRepositoryNameByFullName updates a repository's name by full name.
	UpdateRepositoryNameByFullName(context.Context, *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error)

	// UpdateRepositoryVisibility updates a repository's visibility.
	UpdateRepositoryVisibility(context.Context, *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error)

	// UpdateRepositoryVisibilityByName updates a repository's visibility by name.
	UpdateRepositoryVisibilityByName(context.Context, *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error)

	// DeleteRepository deletes a repository.
	DeleteRepository(context.Context, *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error)

	// DeleteRepositoryByFullName deletes a repository by full name.
	DeleteRepositoryByFullName(context.Context, *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error)
}

// =================================
// RepositoryService Protobuf Client
// =================================

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

// NewRepositoryServiceProtobufClient creates a Protobuf client that implements the RepositoryService interface.
// It communicates using Protobuf and can be configured with a custom HTTPClient.
func NewRepositoryServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) RepositoryService {
	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", "RepositoryService")
	urls := [12]string{
		serviceURL + "GetRepository",
		serviceURL + "GetRepositoryByFullName",
		serviceURL + "ListRepositories",
		serviceURL + "ListUserRepositories",
		serviceURL + "ListOrganizationRepositories",
		serviceURL + "CreateRepositoryByFullName",
		serviceURL + "UpdateRepositoryName",
		serviceURL + "UpdateRepositoryNameByFullName",
		serviceURL + "UpdateRepositoryVisibility",
		serviceURL + "UpdateRepositoryVisibilityByName",
		serviceURL + "DeleteRepository",
		serviceURL + "DeleteRepositoryByFullName",
	}

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

func (c *repositoryServiceProtobufClient) GetRepository(ctx context.Context, in *GetRepositoryRequest) (*GetRepositoryResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "GetRepository")
	caller := c.callGetRepository
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetRepositoryRequest) (*GetRepositoryResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetRepositoryRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetRepositoryRequest) when calling interceptor")
					}
					return c.callGetRepository(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetRepositoryResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetRepositoryResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callGetRepository(ctx context.Context, in *GetRepositoryRequest) (*GetRepositoryResponse, error) {
	out := new(GetRepositoryResponse)
	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 *repositoryServiceProtobufClient) GetRepositoryByFullName(ctx context.Context, in *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "GetRepositoryByFullName")
	caller := c.callGetRepositoryByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetRepositoryByFullNameRequest) when calling interceptor")
					}
					return c.callGetRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callGetRepositoryByFullName(ctx context.Context, in *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error) {
	out := new(GetRepositoryByFullNameResponse)
	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 *repositoryServiceProtobufClient) ListRepositories(ctx context.Context, in *ListRepositoriesRequest) (*ListRepositoriesResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "ListRepositories")
	caller := c.callListRepositories
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListRepositoriesRequest) (*ListRepositoriesResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListRepositoriesRequest) when calling interceptor")
					}
					return c.callListRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callListRepositories(ctx context.Context, in *ListRepositoriesRequest) (*ListRepositoriesResponse, error) {
	out := new(ListRepositoriesResponse)
	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 *repositoryServiceProtobufClient) ListUserRepositories(ctx context.Context, in *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "ListUserRepositories")
	caller := c.callListUserRepositories
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUserRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUserRepositoriesRequest) when calling interceptor")
					}
					return c.callListUserRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUserRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUserRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callListUserRepositories(ctx context.Context, in *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error) {
	out := new(ListUserRepositoriesResponse)
	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 *repositoryServiceProtobufClient) ListOrganizationRepositories(ctx context.Context, in *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationRepositories")
	caller := c.callListOrganizationRepositories
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationRepositoriesRequest) when calling interceptor")
					}
					return c.callListOrganizationRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callListOrganizationRepositories(ctx context.Context, in *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error) {
	out := new(ListOrganizationRepositoriesResponse)
	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 *repositoryServiceProtobufClient) CreateRepositoryByFullName(ctx context.Context, in *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "CreateRepositoryByFullName")
	caller := c.callCreateRepositoryByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateRepositoryByFullNameRequest) when calling interceptor")
					}
					return c.callCreateRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callCreateRepositoryByFullName(ctx context.Context, in *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error) {
	out := new(CreateRepositoryByFullNameResponse)
	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 *repositoryServiceProtobufClient) UpdateRepositoryName(ctx context.Context, in *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryName")
	caller := c.callUpdateRepositoryName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryNameRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callUpdateRepositoryName(ctx context.Context, in *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error) {
	out := new(UpdateRepositoryNameResponse)
	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 *repositoryServiceProtobufClient) UpdateRepositoryNameByFullName(ctx context.Context, in *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryNameByFullName")
	caller := c.callUpdateRepositoryNameByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryNameByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryNameByFullNameRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryNameByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryNameByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryNameByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callUpdateRepositoryNameByFullName(ctx context.Context, in *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error) {
	out := new(UpdateRepositoryNameByFullNameResponse)
	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 *repositoryServiceProtobufClient) UpdateRepositoryVisibility(ctx context.Context, in *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibility")
	caller := c.callUpdateRepositoryVisibility
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryVisibilityRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryVisibilityRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryVisibility(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryVisibilityResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryVisibilityResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callUpdateRepositoryVisibility(ctx context.Context, in *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error) {
	out := new(UpdateRepositoryVisibilityResponse)
	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 *repositoryServiceProtobufClient) UpdateRepositoryVisibilityByName(ctx context.Context, in *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibilityByName")
	caller := c.callUpdateRepositoryVisibilityByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryVisibilityByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryVisibilityByNameRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryVisibilityByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryVisibilityByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryVisibilityByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callUpdateRepositoryVisibilityByName(ctx context.Context, in *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error) {
	out := new(UpdateRepositoryVisibilityByNameResponse)
	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 *repositoryServiceProtobufClient) DeleteRepository(ctx context.Context, in *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepository")
	caller := c.callDeleteRepository
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteRepositoryRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteRepositoryRequest) when calling interceptor")
					}
					return c.callDeleteRepository(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteRepositoryResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteRepositoryResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callDeleteRepository(ctx context.Context, in *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error) {
	out := new(DeleteRepositoryResponse)
	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 *repositoryServiceProtobufClient) DeleteRepositoryByFullName(ctx context.Context, in *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepositoryByFullName")
	caller := c.callDeleteRepositoryByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteRepositoryByFullNameRequest) when calling interceptor")
					}
					return c.callDeleteRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceProtobufClient) callDeleteRepositoryByFullName(ctx context.Context, in *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error) {
	out := new(DeleteRepositoryByFullNameResponse)
	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
}

// =============================
// RepositoryService JSON Client
// =============================

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

// NewRepositoryServiceJSONClient creates a JSON client that implements the RepositoryService interface.
// It communicates using JSON and can be configured with a custom HTTPClient.
func NewRepositoryServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) RepositoryService {
	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", "RepositoryService")
	urls := [12]string{
		serviceURL + "GetRepository",
		serviceURL + "GetRepositoryByFullName",
		serviceURL + "ListRepositories",
		serviceURL + "ListUserRepositories",
		serviceURL + "ListOrganizationRepositories",
		serviceURL + "CreateRepositoryByFullName",
		serviceURL + "UpdateRepositoryName",
		serviceURL + "UpdateRepositoryNameByFullName",
		serviceURL + "UpdateRepositoryVisibility",
		serviceURL + "UpdateRepositoryVisibilityByName",
		serviceURL + "DeleteRepository",
		serviceURL + "DeleteRepositoryByFullName",
	}

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

func (c *repositoryServiceJSONClient) GetRepository(ctx context.Context, in *GetRepositoryRequest) (*GetRepositoryResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "GetRepository")
	caller := c.callGetRepository
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetRepositoryRequest) (*GetRepositoryResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetRepositoryRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetRepositoryRequest) when calling interceptor")
					}
					return c.callGetRepository(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetRepositoryResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetRepositoryResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callGetRepository(ctx context.Context, in *GetRepositoryRequest) (*GetRepositoryResponse, error) {
	out := new(GetRepositoryResponse)
	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 *repositoryServiceJSONClient) GetRepositoryByFullName(ctx context.Context, in *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "GetRepositoryByFullName")
	caller := c.callGetRepositoryByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetRepositoryByFullNameRequest) when calling interceptor")
					}
					return c.callGetRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callGetRepositoryByFullName(ctx context.Context, in *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error) {
	out := new(GetRepositoryByFullNameResponse)
	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 *repositoryServiceJSONClient) ListRepositories(ctx context.Context, in *ListRepositoriesRequest) (*ListRepositoriesResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "ListRepositories")
	caller := c.callListRepositories
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListRepositoriesRequest) (*ListRepositoriesResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListRepositoriesRequest) when calling interceptor")
					}
					return c.callListRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callListRepositories(ctx context.Context, in *ListRepositoriesRequest) (*ListRepositoriesResponse, error) {
	out := new(ListRepositoriesResponse)
	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 *repositoryServiceJSONClient) ListUserRepositories(ctx context.Context, in *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "ListUserRepositories")
	caller := c.callListUserRepositories
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUserRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUserRepositoriesRequest) when calling interceptor")
					}
					return c.callListUserRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUserRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUserRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callListUserRepositories(ctx context.Context, in *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error) {
	out := new(ListUserRepositoriesResponse)
	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 *repositoryServiceJSONClient) ListOrganizationRepositories(ctx context.Context, in *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationRepositories")
	caller := c.callListOrganizationRepositories
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationRepositoriesRequest) when calling interceptor")
					}
					return c.callListOrganizationRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callListOrganizationRepositories(ctx context.Context, in *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error) {
	out := new(ListOrganizationRepositoriesResponse)
	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 *repositoryServiceJSONClient) CreateRepositoryByFullName(ctx context.Context, in *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "CreateRepositoryByFullName")
	caller := c.callCreateRepositoryByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateRepositoryByFullNameRequest) when calling interceptor")
					}
					return c.callCreateRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callCreateRepositoryByFullName(ctx context.Context, in *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error) {
	out := new(CreateRepositoryByFullNameResponse)
	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 *repositoryServiceJSONClient) UpdateRepositoryName(ctx context.Context, in *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryName")
	caller := c.callUpdateRepositoryName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryNameRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callUpdateRepositoryName(ctx context.Context, in *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error) {
	out := new(UpdateRepositoryNameResponse)
	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 *repositoryServiceJSONClient) UpdateRepositoryNameByFullName(ctx context.Context, in *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryNameByFullName")
	caller := c.callUpdateRepositoryNameByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryNameByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryNameByFullNameRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryNameByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryNameByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryNameByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callUpdateRepositoryNameByFullName(ctx context.Context, in *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error) {
	out := new(UpdateRepositoryNameByFullNameResponse)
	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 *repositoryServiceJSONClient) UpdateRepositoryVisibility(ctx context.Context, in *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibility")
	caller := c.callUpdateRepositoryVisibility
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryVisibilityRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryVisibilityRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryVisibility(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryVisibilityResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryVisibilityResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callUpdateRepositoryVisibility(ctx context.Context, in *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error) {
	out := new(UpdateRepositoryVisibilityResponse)
	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 *repositoryServiceJSONClient) UpdateRepositoryVisibilityByName(ctx context.Context, in *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibilityByName")
	caller := c.callUpdateRepositoryVisibilityByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryVisibilityByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryVisibilityByNameRequest) when calling interceptor")
					}
					return c.callUpdateRepositoryVisibilityByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryVisibilityByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryVisibilityByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callUpdateRepositoryVisibilityByName(ctx context.Context, in *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error) {
	out := new(UpdateRepositoryVisibilityByNameResponse)
	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 *repositoryServiceJSONClient) DeleteRepository(ctx context.Context, in *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepository")
	caller := c.callDeleteRepository
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteRepositoryRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteRepositoryRequest) when calling interceptor")
					}
					return c.callDeleteRepository(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteRepositoryResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteRepositoryResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callDeleteRepository(ctx context.Context, in *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error) {
	out := new(DeleteRepositoryResponse)
	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 *repositoryServiceJSONClient) DeleteRepositoryByFullName(ctx context.Context, in *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepositoryByFullName")
	caller := c.callDeleteRepositoryByFullName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteRepositoryByFullNameRequest) when calling interceptor")
					}
					return c.callDeleteRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *repositoryServiceJSONClient) callDeleteRepositoryByFullName(ctx context.Context, in *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error) {
	out := new(DeleteRepositoryByFullNameResponse)
	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
}

// ================================
// RepositoryService Server Handler
// ================================

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

// NewRepositoryServiceServer 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 NewRepositoryServiceServer(svc RepositoryService, 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 NewRepositoryServiceServer", o))
		}
	}

	return &repositoryServiceServer{
		RepositoryService: 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 *repositoryServiceServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) {
	writeError(ctx, resp, err, s.hooks)
}

// RepositoryServicePathPrefix 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 RepositoryServicePathPrefix = "/twirp/buf.alpha.registry.v1alpha1.RepositoryService/"

func (s *repositoryServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
	ctx := req.Context()
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "RepositoryService")
	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.RepositoryService" {
		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 "GetRepository":
		s.serveGetRepository(ctx, resp, req)
		return
	case "GetRepositoryByFullName":
		s.serveGetRepositoryByFullName(ctx, resp, req)
		return
	case "ListRepositories":
		s.serveListRepositories(ctx, resp, req)
		return
	case "ListUserRepositories":
		s.serveListUserRepositories(ctx, resp, req)
		return
	case "ListOrganizationRepositories":
		s.serveListOrganizationRepositories(ctx, resp, req)
		return
	case "CreateRepositoryByFullName":
		s.serveCreateRepositoryByFullName(ctx, resp, req)
		return
	case "UpdateRepositoryName":
		s.serveUpdateRepositoryName(ctx, resp, req)
		return
	case "UpdateRepositoryNameByFullName":
		s.serveUpdateRepositoryNameByFullName(ctx, resp, req)
		return
	case "UpdateRepositoryVisibility":
		s.serveUpdateRepositoryVisibility(ctx, resp, req)
		return
	case "UpdateRepositoryVisibilityByName":
		s.serveUpdateRepositoryVisibilityByName(ctx, resp, req)
		return
	case "DeleteRepository":
		s.serveDeleteRepository(ctx, resp, req)
		return
	case "DeleteRepositoryByFullName":
		s.serveDeleteRepositoryByFullName(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 *repositoryServiceServer) serveGetRepository(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.serveGetRepositoryJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveGetRepositoryProtobuf(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 *repositoryServiceServer) serveGetRepositoryJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetRepository")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(GetRepositoryRequest)
	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.RepositoryService.GetRepository
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetRepositoryRequest) (*GetRepositoryResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetRepositoryRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetRepositoryRequest) when calling interceptor")
					}
					return s.RepositoryService.GetRepository(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetRepositoryResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetRepositoryResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetRepositoryResponse
	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 *GetRepositoryResponse and nil error while calling GetRepository. 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 *repositoryServiceServer) serveGetRepositoryProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetRepository")
	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(GetRepositoryRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *GetRepositoryResponse
	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 *GetRepositoryResponse and nil error while calling GetRepository. 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 *repositoryServiceServer) serveGetRepositoryByFullName(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.serveGetRepositoryByFullNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveGetRepositoryByFullNameProtobuf(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 *repositoryServiceServer) serveGetRepositoryByFullNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetRepositoryByFullName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(GetRepositoryByFullNameRequest)
	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.RepositoryService.GetRepositoryByFullName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *GetRepositoryByFullNameRequest) (*GetRepositoryByFullNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetRepositoryByFullNameRequest) when calling interceptor")
					}
					return s.RepositoryService.GetRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *GetRepositoryByFullNameResponse
	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 *GetRepositoryByFullNameResponse and nil error while calling GetRepositoryByFullName. 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 *repositoryServiceServer) serveGetRepositoryByFullNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetRepositoryByFullName")
	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(GetRepositoryByFullNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *GetRepositoryByFullNameResponse
	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 *GetRepositoryByFullNameResponse and nil error while calling GetRepositoryByFullName. 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 *repositoryServiceServer) serveListRepositories(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.serveListRepositoriesJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveListRepositoriesProtobuf(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 *repositoryServiceServer) serveListRepositoriesJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListRepositories")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(ListRepositoriesRequest)
	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.RepositoryService.ListRepositories
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *ListRepositoriesRequest) (*ListRepositoriesResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListRepositoriesRequest) when calling interceptor")
					}
					return s.RepositoryService.ListRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *ListRepositoriesResponse
	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 *ListRepositoriesResponse and nil error while calling ListRepositories. 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 *repositoryServiceServer) serveListRepositoriesProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListRepositories")
	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(ListRepositoriesRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *ListRepositoriesResponse
	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 *ListRepositoriesResponse and nil error while calling ListRepositories. 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 *repositoryServiceServer) serveListUserRepositories(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.serveListUserRepositoriesJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveListUserRepositoriesProtobuf(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 *repositoryServiceServer) serveListUserRepositoriesJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListUserRepositories")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(ListUserRepositoriesRequest)
	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.RepositoryService.ListUserRepositories
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *ListUserRepositoriesRequest) (*ListUserRepositoriesResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUserRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUserRepositoriesRequest) when calling interceptor")
					}
					return s.RepositoryService.ListUserRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUserRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUserRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *ListUserRepositoriesResponse
	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 *ListUserRepositoriesResponse and nil error while calling ListUserRepositories. 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 *repositoryServiceServer) serveListUserRepositoriesProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListUserRepositories")
	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(ListUserRepositoriesRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *ListUserRepositoriesResponse
	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 *ListUserRepositoriesResponse and nil error while calling ListUserRepositories. 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 *repositoryServiceServer) serveListOrganizationRepositories(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.serveListOrganizationRepositoriesJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveListOrganizationRepositoriesProtobuf(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 *repositoryServiceServer) serveListOrganizationRepositoriesJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationRepositories")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(ListOrganizationRepositoriesRequest)
	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.RepositoryService.ListOrganizationRepositories
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *ListOrganizationRepositoriesRequest) (*ListOrganizationRepositoriesResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationRepositoriesRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationRepositoriesRequest) when calling interceptor")
					}
					return s.RepositoryService.ListOrganizationRepositories(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationRepositoriesResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationRepositoriesResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *ListOrganizationRepositoriesResponse
	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 *ListOrganizationRepositoriesResponse and nil error while calling ListOrganizationRepositories. 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 *repositoryServiceServer) serveListOrganizationRepositoriesProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizationRepositories")
	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(ListOrganizationRepositoriesRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *ListOrganizationRepositoriesResponse
	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 *ListOrganizationRepositoriesResponse and nil error while calling ListOrganizationRepositories. 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 *repositoryServiceServer) serveCreateRepositoryByFullName(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.serveCreateRepositoryByFullNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveCreateRepositoryByFullNameProtobuf(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 *repositoryServiceServer) serveCreateRepositoryByFullNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "CreateRepositoryByFullName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(CreateRepositoryByFullNameRequest)
	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.RepositoryService.CreateRepositoryByFullName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *CreateRepositoryByFullNameRequest) (*CreateRepositoryByFullNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateRepositoryByFullNameRequest) when calling interceptor")
					}
					return s.RepositoryService.CreateRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *CreateRepositoryByFullNameResponse
	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 *CreateRepositoryByFullNameResponse and nil error while calling CreateRepositoryByFullName. 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 *repositoryServiceServer) serveCreateRepositoryByFullNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "CreateRepositoryByFullName")
	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(CreateRepositoryByFullNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *CreateRepositoryByFullNameResponse
	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 *CreateRepositoryByFullNameResponse and nil error while calling CreateRepositoryByFullName. 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 *repositoryServiceServer) serveUpdateRepositoryName(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.serveUpdateRepositoryNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveUpdateRepositoryNameProtobuf(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 *repositoryServiceServer) serveUpdateRepositoryNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(UpdateRepositoryNameRequest)
	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.RepositoryService.UpdateRepositoryName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *UpdateRepositoryNameRequest) (*UpdateRepositoryNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryNameRequest) when calling interceptor")
					}
					return s.RepositoryService.UpdateRepositoryName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *UpdateRepositoryNameResponse
	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 *UpdateRepositoryNameResponse and nil error while calling UpdateRepositoryName. 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 *repositoryServiceServer) serveUpdateRepositoryNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryName")
	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(UpdateRepositoryNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *UpdateRepositoryNameResponse
	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 *UpdateRepositoryNameResponse and nil error while calling UpdateRepositoryName. 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 *repositoryServiceServer) serveUpdateRepositoryNameByFullName(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.serveUpdateRepositoryNameByFullNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveUpdateRepositoryNameByFullNameProtobuf(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 *repositoryServiceServer) serveUpdateRepositoryNameByFullNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryNameByFullName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(UpdateRepositoryNameByFullNameRequest)
	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.RepositoryService.UpdateRepositoryNameByFullName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *UpdateRepositoryNameByFullNameRequest) (*UpdateRepositoryNameByFullNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryNameByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryNameByFullNameRequest) when calling interceptor")
					}
					return s.RepositoryService.UpdateRepositoryNameByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryNameByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryNameByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *UpdateRepositoryNameByFullNameResponse
	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 *UpdateRepositoryNameByFullNameResponse and nil error while calling UpdateRepositoryNameByFullName. 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 *repositoryServiceServer) serveUpdateRepositoryNameByFullNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryNameByFullName")
	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(UpdateRepositoryNameByFullNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *UpdateRepositoryNameByFullNameResponse
	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 *UpdateRepositoryNameByFullNameResponse and nil error while calling UpdateRepositoryNameByFullName. 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 *repositoryServiceServer) serveUpdateRepositoryVisibility(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.serveUpdateRepositoryVisibilityJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveUpdateRepositoryVisibilityProtobuf(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 *repositoryServiceServer) serveUpdateRepositoryVisibilityJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibility")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(UpdateRepositoryVisibilityRequest)
	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.RepositoryService.UpdateRepositoryVisibility
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *UpdateRepositoryVisibilityRequest) (*UpdateRepositoryVisibilityResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryVisibilityRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryVisibilityRequest) when calling interceptor")
					}
					return s.RepositoryService.UpdateRepositoryVisibility(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryVisibilityResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryVisibilityResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *UpdateRepositoryVisibilityResponse
	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 *UpdateRepositoryVisibilityResponse and nil error while calling UpdateRepositoryVisibility. 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 *repositoryServiceServer) serveUpdateRepositoryVisibilityProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibility")
	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(UpdateRepositoryVisibilityRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *UpdateRepositoryVisibilityResponse
	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 *UpdateRepositoryVisibilityResponse and nil error while calling UpdateRepositoryVisibility. 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 *repositoryServiceServer) serveUpdateRepositoryVisibilityByName(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.serveUpdateRepositoryVisibilityByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveUpdateRepositoryVisibilityByNameProtobuf(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 *repositoryServiceServer) serveUpdateRepositoryVisibilityByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibilityByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(UpdateRepositoryVisibilityByNameRequest)
	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.RepositoryService.UpdateRepositoryVisibilityByName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *UpdateRepositoryVisibilityByNameRequest) (*UpdateRepositoryVisibilityByNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateRepositoryVisibilityByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateRepositoryVisibilityByNameRequest) when calling interceptor")
					}
					return s.RepositoryService.UpdateRepositoryVisibilityByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateRepositoryVisibilityByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateRepositoryVisibilityByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *UpdateRepositoryVisibilityByNameResponse
	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 *UpdateRepositoryVisibilityByNameResponse and nil error while calling UpdateRepositoryVisibilityByName. 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 *repositoryServiceServer) serveUpdateRepositoryVisibilityByNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateRepositoryVisibilityByName")
	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(UpdateRepositoryVisibilityByNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *UpdateRepositoryVisibilityByNameResponse
	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 *UpdateRepositoryVisibilityByNameResponse and nil error while calling UpdateRepositoryVisibilityByName. 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 *repositoryServiceServer) serveDeleteRepository(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.serveDeleteRepositoryJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveDeleteRepositoryProtobuf(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 *repositoryServiceServer) serveDeleteRepositoryJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepository")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(DeleteRepositoryRequest)
	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.RepositoryService.DeleteRepository
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *DeleteRepositoryRequest) (*DeleteRepositoryResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteRepositoryRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteRepositoryRequest) when calling interceptor")
					}
					return s.RepositoryService.DeleteRepository(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteRepositoryResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteRepositoryResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *DeleteRepositoryResponse
	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 *DeleteRepositoryResponse and nil error while calling DeleteRepository. 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 *repositoryServiceServer) serveDeleteRepositoryProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepository")
	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(DeleteRepositoryRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *DeleteRepositoryResponse
	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 *DeleteRepositoryResponse and nil error while calling DeleteRepository. 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 *repositoryServiceServer) serveDeleteRepositoryByFullName(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.serveDeleteRepositoryByFullNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveDeleteRepositoryByFullNameProtobuf(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 *repositoryServiceServer) serveDeleteRepositoryByFullNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepositoryByFullName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

	reqContent := new(DeleteRepositoryByFullNameRequest)
	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.RepositoryService.DeleteRepositoryByFullName
	if s.interceptor != nil {
		handler = func(ctx context.Context, req *DeleteRepositoryByFullNameRequest) (*DeleteRepositoryByFullNameResponse, error) {
			resp, err := s.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteRepositoryByFullNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteRepositoryByFullNameRequest) when calling interceptor")
					}
					return s.RepositoryService.DeleteRepositoryByFullName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteRepositoryByFullNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteRepositoryByFullNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}

	// Call service method
	var respContent *DeleteRepositoryByFullNameResponse
	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 *DeleteRepositoryByFullNameResponse and nil error while calling DeleteRepositoryByFullName. 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 *repositoryServiceServer) serveDeleteRepositoryByFullNameProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteRepositoryByFullName")
	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(DeleteRepositoryByFullNameRequest)
	if err = proto.Unmarshal(buf, reqContent); err != nil {
		s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
		return
	}

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

	// Call service method
	var respContent *DeleteRepositoryByFullNameResponse
	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 *DeleteRepositoryByFullNameResponse and nil error while calling DeleteRepositoryByFullName. 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 *repositoryServiceServer) ServiceDescriptor() ([]byte, int) {
	return twirpFileDescriptor3, 0
}

func (s *repositoryServiceServer) 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 *repositoryServiceServer) PathPrefix() string {
	return baseServicePath(s.pathPrefix, "buf.alpha.registry.v1alpha1", "RepositoryService")
}

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