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

// =============================
// OrganizationService Interface
// =============================

// OrganizationService is the Organization service.
// All methods on the Organization service require authentication.
type OrganizationService interface {
	// GetOrganization gets a organization by ID.
	GetOrganization(context.Context, *GetOrganizationRequest) (*GetOrganizationResponse, error)

	// GetOrganizationByName gets a organization by name.
	GetOrganizationByName(context.Context, *GetOrganizationByNameRequest) (*GetOrganizationByNameResponse, error)

	// ListOrganizations lists all organizations.
	ListOrganizations(context.Context, *ListOrganizationsRequest) (*ListOrganizationsResponse, error)

	// ListUserOrganizations lists all organizations a user is member of.
	ListUserOrganizations(context.Context, *ListUserOrganizationsRequest) (*ListUserOrganizationsResponse, error)

	// CreateOrganization creates a new organization.
	CreateOrganization(context.Context, *CreateOrganizationRequest) (*CreateOrganizationResponse, error)

	// UpdateOrganizationName updates a organization's name.
	UpdateOrganizationName(context.Context, *UpdateOrganizationNameRequest) (*UpdateOrganizationNameResponse, error)

	// UpdateOrganizationNameByName updates a organization's name by name.
	UpdateOrganizationNameByName(context.Context, *UpdateOrganizationNameByNameRequest) (*UpdateOrganizationNameByNameResponse, error)

	// DeleteOrganization deletes a organization.
	DeleteOrganization(context.Context, *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error)

	// DeleteOrganizationByName deletes a organization by name.
	DeleteOrganizationByName(context.Context, *DeleteOrganizationByNameRequest) (*DeleteOrganizationByNameResponse, error)

	// AddOrganizationBaseRepositoryScope adds a base repository scope to an organization by ID.
	AddOrganizationBaseRepositoryScope(context.Context, *AddOrganizationBaseRepositoryScopeRequest) (*AddOrganizationBaseRepositoryScopeResponse, error)

	// AddOrganizationBaseRepositoryScopeByName adds a base repository scope to an organization by name.
	AddOrganizationBaseRepositoryScopeByName(context.Context, *AddOrganizationBaseRepositoryScopeByNameRequest) (*AddOrganizationBaseRepositoryScopeByNameResponse, error)

	// RemoveOrganizationBaseRepositoryScope removes a base repository scope from an organization by ID.
	RemoveOrganizationBaseRepositoryScope(context.Context, *RemoveOrganizationBaseRepositoryScopeRequest) (*RemoveOrganizationBaseRepositoryScopeResponse, error)

	// RemoveOrganizationBaseRepositoryScopeByName removes a base repository scope from an organization by name.
	RemoveOrganizationBaseRepositoryScopeByName(context.Context, *RemoveOrganizationBaseRepositoryScopeByNameRequest) (*RemoveOrganizationBaseRepositoryScopeByNameResponse, error)
}

// ===================================
// OrganizationService Protobuf Client
// ===================================

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

// NewOrganizationServiceProtobufClient creates a Protobuf client that implements the OrganizationService interface.
// It communicates using Protobuf and can be configured with a custom HTTPClient.
func NewOrganizationServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) OrganizationService {
	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", "OrganizationService")
	urls := [13]string{
		serviceURL + "GetOrganization",
		serviceURL + "GetOrganizationByName",
		serviceURL + "ListOrganizations",
		serviceURL + "ListUserOrganizations",
		serviceURL + "CreateOrganization",
		serviceURL + "UpdateOrganizationName",
		serviceURL + "UpdateOrganizationNameByName",
		serviceURL + "DeleteOrganization",
		serviceURL + "DeleteOrganizationByName",
		serviceURL + "AddOrganizationBaseRepositoryScope",
		serviceURL + "AddOrganizationBaseRepositoryScopeByName",
		serviceURL + "RemoveOrganizationBaseRepositoryScope",
		serviceURL + "RemoveOrganizationBaseRepositoryScopeByName",
	}

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

func (c *organizationServiceProtobufClient) GetOrganization(ctx context.Context, in *GetOrganizationRequest) (*GetOrganizationResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "GetOrganization")
	caller := c.callGetOrganization
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetOrganizationRequest) (*GetOrganizationResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetOrganizationRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetOrganizationRequest) when calling interceptor")
					}
					return c.callGetOrganization(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetOrganizationResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetOrganizationResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callGetOrganization(ctx context.Context, in *GetOrganizationRequest) (*GetOrganizationResponse, error) {
	out := new(GetOrganizationResponse)
	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 *organizationServiceProtobufClient) GetOrganizationByName(ctx context.Context, in *GetOrganizationByNameRequest) (*GetOrganizationByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "GetOrganizationByName")
	caller := c.callGetOrganizationByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetOrganizationByNameRequest) (*GetOrganizationByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetOrganizationByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetOrganizationByNameRequest) when calling interceptor")
					}
					return c.callGetOrganizationByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetOrganizationByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetOrganizationByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callGetOrganizationByName(ctx context.Context, in *GetOrganizationByNameRequest) (*GetOrganizationByNameResponse, error) {
	out := new(GetOrganizationByNameResponse)
	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 *organizationServiceProtobufClient) ListOrganizations(ctx context.Context, in *ListOrganizationsRequest) (*ListOrganizationsResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizations")
	caller := c.callListOrganizations
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListOrganizationsRequest) (*ListOrganizationsResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationsRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationsRequest) when calling interceptor")
					}
					return c.callListOrganizations(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationsResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationsResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callListOrganizations(ctx context.Context, in *ListOrganizationsRequest) (*ListOrganizationsResponse, error) {
	out := new(ListOrganizationsResponse)
	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 *organizationServiceProtobufClient) ListUserOrganizations(ctx context.Context, in *ListUserOrganizationsRequest) (*ListUserOrganizationsResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "ListUserOrganizations")
	caller := c.callListUserOrganizations
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListUserOrganizationsRequest) (*ListUserOrganizationsResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUserOrganizationsRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUserOrganizationsRequest) when calling interceptor")
					}
					return c.callListUserOrganizations(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUserOrganizationsResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUserOrganizationsResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callListUserOrganizations(ctx context.Context, in *ListUserOrganizationsRequest) (*ListUserOrganizationsResponse, error) {
	out := new(ListUserOrganizationsResponse)
	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 *organizationServiceProtobufClient) CreateOrganization(ctx context.Context, in *CreateOrganizationRequest) (*CreateOrganizationResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "CreateOrganization")
	caller := c.callCreateOrganization
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *CreateOrganizationRequest) (*CreateOrganizationResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateOrganizationRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateOrganizationRequest) when calling interceptor")
					}
					return c.callCreateOrganization(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateOrganizationResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateOrganizationResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callCreateOrganization(ctx context.Context, in *CreateOrganizationRequest) (*CreateOrganizationResponse, error) {
	out := new(CreateOrganizationResponse)
	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 *organizationServiceProtobufClient) UpdateOrganizationName(ctx context.Context, in *UpdateOrganizationNameRequest) (*UpdateOrganizationNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateOrganizationName")
	caller := c.callUpdateOrganizationName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateOrganizationNameRequest) (*UpdateOrganizationNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateOrganizationNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateOrganizationNameRequest) when calling interceptor")
					}
					return c.callUpdateOrganizationName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateOrganizationNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateOrganizationNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callUpdateOrganizationName(ctx context.Context, in *UpdateOrganizationNameRequest) (*UpdateOrganizationNameResponse, error) {
	out := new(UpdateOrganizationNameResponse)
	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 *organizationServiceProtobufClient) UpdateOrganizationNameByName(ctx context.Context, in *UpdateOrganizationNameByNameRequest) (*UpdateOrganizationNameByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateOrganizationNameByName")
	caller := c.callUpdateOrganizationNameByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateOrganizationNameByNameRequest) (*UpdateOrganizationNameByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateOrganizationNameByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateOrganizationNameByNameRequest) when calling interceptor")
					}
					return c.callUpdateOrganizationNameByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateOrganizationNameByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateOrganizationNameByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callUpdateOrganizationNameByName(ctx context.Context, in *UpdateOrganizationNameByNameRequest) (*UpdateOrganizationNameByNameResponse, error) {
	out := new(UpdateOrganizationNameByNameResponse)
	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 *organizationServiceProtobufClient) DeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteOrganization")
	caller := c.callDeleteOrganization
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteOrganizationRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteOrganizationRequest) when calling interceptor")
					}
					return c.callDeleteOrganization(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteOrganizationResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteOrganizationResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callDeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) {
	out := new(DeleteOrganizationResponse)
	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 *organizationServiceProtobufClient) DeleteOrganizationByName(ctx context.Context, in *DeleteOrganizationByNameRequest) (*DeleteOrganizationByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteOrganizationByName")
	caller := c.callDeleteOrganizationByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteOrganizationByNameRequest) (*DeleteOrganizationByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteOrganizationByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteOrganizationByNameRequest) when calling interceptor")
					}
					return c.callDeleteOrganizationByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteOrganizationByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteOrganizationByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callDeleteOrganizationByName(ctx context.Context, in *DeleteOrganizationByNameRequest) (*DeleteOrganizationByNameResponse, error) {
	out := new(DeleteOrganizationByNameResponse)
	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 *organizationServiceProtobufClient) AddOrganizationBaseRepositoryScope(ctx context.Context, in *AddOrganizationBaseRepositoryScopeRequest) (*AddOrganizationBaseRepositoryScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "AddOrganizationBaseRepositoryScope")
	caller := c.callAddOrganizationBaseRepositoryScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddOrganizationBaseRepositoryScopeRequest) (*AddOrganizationBaseRepositoryScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddOrganizationBaseRepositoryScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddOrganizationBaseRepositoryScopeRequest) when calling interceptor")
					}
					return c.callAddOrganizationBaseRepositoryScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddOrganizationBaseRepositoryScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddOrganizationBaseRepositoryScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callAddOrganizationBaseRepositoryScope(ctx context.Context, in *AddOrganizationBaseRepositoryScopeRequest) (*AddOrganizationBaseRepositoryScopeResponse, error) {
	out := new(AddOrganizationBaseRepositoryScopeResponse)
	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 *organizationServiceProtobufClient) AddOrganizationBaseRepositoryScopeByName(ctx context.Context, in *AddOrganizationBaseRepositoryScopeByNameRequest) (*AddOrganizationBaseRepositoryScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "AddOrganizationBaseRepositoryScopeByName")
	caller := c.callAddOrganizationBaseRepositoryScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddOrganizationBaseRepositoryScopeByNameRequest) (*AddOrganizationBaseRepositoryScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddOrganizationBaseRepositoryScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddOrganizationBaseRepositoryScopeByNameRequest) when calling interceptor")
					}
					return c.callAddOrganizationBaseRepositoryScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddOrganizationBaseRepositoryScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddOrganizationBaseRepositoryScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceProtobufClient) callAddOrganizationBaseRepositoryScopeByName(ctx context.Context, in *AddOrganizationBaseRepositoryScopeByNameRequest) (*AddOrganizationBaseRepositoryScopeByNameResponse, error) {
	out := new(AddOrganizationBaseRepositoryScopeByNameResponse)
	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 *organizationServiceProtobufClient) RemoveOrganizationBaseRepositoryScope(ctx context.Context, in *RemoveOrganizationBaseRepositoryScopeRequest) (*RemoveOrganizationBaseRepositoryScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveOrganizationBaseRepositoryScope")
	caller := c.callRemoveOrganizationBaseRepositoryScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveOrganizationBaseRepositoryScopeRequest) (*RemoveOrganizationBaseRepositoryScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveOrganizationBaseRepositoryScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveOrganizationBaseRepositoryScopeRequest) when calling interceptor")
					}
					return c.callRemoveOrganizationBaseRepositoryScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveOrganizationBaseRepositoryScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveOrganizationBaseRepositoryScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

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

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *organizationServiceProtobufClient) RemoveOrganizationBaseRepositoryScopeByName(ctx context.Context, in *RemoveOrganizationBaseRepositoryScopeByNameRequest) (*RemoveOrganizationBaseRepositoryScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveOrganizationBaseRepositoryScopeByName")
	caller := c.callRemoveOrganizationBaseRepositoryScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveOrganizationBaseRepositoryScopeByNameRequest) (*RemoveOrganizationBaseRepositoryScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveOrganizationBaseRepositoryScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveOrganizationBaseRepositoryScopeByNameRequest) when calling interceptor")
					}
					return c.callRemoveOrganizationBaseRepositoryScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveOrganizationBaseRepositoryScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveOrganizationBaseRepositoryScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

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

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

// ===============================
// OrganizationService JSON Client
// ===============================

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

// NewOrganizationServiceJSONClient creates a JSON client that implements the OrganizationService interface.
// It communicates using JSON and can be configured with a custom HTTPClient.
func NewOrganizationServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) OrganizationService {
	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", "OrganizationService")
	urls := [13]string{
		serviceURL + "GetOrganization",
		serviceURL + "GetOrganizationByName",
		serviceURL + "ListOrganizations",
		serviceURL + "ListUserOrganizations",
		serviceURL + "CreateOrganization",
		serviceURL + "UpdateOrganizationName",
		serviceURL + "UpdateOrganizationNameByName",
		serviceURL + "DeleteOrganization",
		serviceURL + "DeleteOrganizationByName",
		serviceURL + "AddOrganizationBaseRepositoryScope",
		serviceURL + "AddOrganizationBaseRepositoryScopeByName",
		serviceURL + "RemoveOrganizationBaseRepositoryScope",
		serviceURL + "RemoveOrganizationBaseRepositoryScopeByName",
	}

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

func (c *organizationServiceJSONClient) GetOrganization(ctx context.Context, in *GetOrganizationRequest) (*GetOrganizationResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "GetOrganization")
	caller := c.callGetOrganization
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetOrganizationRequest) (*GetOrganizationResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetOrganizationRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetOrganizationRequest) when calling interceptor")
					}
					return c.callGetOrganization(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetOrganizationResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetOrganizationResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callGetOrganization(ctx context.Context, in *GetOrganizationRequest) (*GetOrganizationResponse, error) {
	out := new(GetOrganizationResponse)
	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 *organizationServiceJSONClient) GetOrganizationByName(ctx context.Context, in *GetOrganizationByNameRequest) (*GetOrganizationByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "GetOrganizationByName")
	caller := c.callGetOrganizationByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *GetOrganizationByNameRequest) (*GetOrganizationByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*GetOrganizationByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*GetOrganizationByNameRequest) when calling interceptor")
					}
					return c.callGetOrganizationByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*GetOrganizationByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*GetOrganizationByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callGetOrganizationByName(ctx context.Context, in *GetOrganizationByNameRequest) (*GetOrganizationByNameResponse, error) {
	out := new(GetOrganizationByNameResponse)
	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 *organizationServiceJSONClient) ListOrganizations(ctx context.Context, in *ListOrganizationsRequest) (*ListOrganizationsResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizations")
	caller := c.callListOrganizations
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListOrganizationsRequest) (*ListOrganizationsResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListOrganizationsRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListOrganizationsRequest) when calling interceptor")
					}
					return c.callListOrganizations(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListOrganizationsResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListOrganizationsResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callListOrganizations(ctx context.Context, in *ListOrganizationsRequest) (*ListOrganizationsResponse, error) {
	out := new(ListOrganizationsResponse)
	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 *organizationServiceJSONClient) ListUserOrganizations(ctx context.Context, in *ListUserOrganizationsRequest) (*ListUserOrganizationsResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "ListUserOrganizations")
	caller := c.callListUserOrganizations
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *ListUserOrganizationsRequest) (*ListUserOrganizationsResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*ListUserOrganizationsRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*ListUserOrganizationsRequest) when calling interceptor")
					}
					return c.callListUserOrganizations(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*ListUserOrganizationsResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*ListUserOrganizationsResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callListUserOrganizations(ctx context.Context, in *ListUserOrganizationsRequest) (*ListUserOrganizationsResponse, error) {
	out := new(ListUserOrganizationsResponse)
	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 *organizationServiceJSONClient) CreateOrganization(ctx context.Context, in *CreateOrganizationRequest) (*CreateOrganizationResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "CreateOrganization")
	caller := c.callCreateOrganization
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *CreateOrganizationRequest) (*CreateOrganizationResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*CreateOrganizationRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*CreateOrganizationRequest) when calling interceptor")
					}
					return c.callCreateOrganization(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*CreateOrganizationResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*CreateOrganizationResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callCreateOrganization(ctx context.Context, in *CreateOrganizationRequest) (*CreateOrganizationResponse, error) {
	out := new(CreateOrganizationResponse)
	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 *organizationServiceJSONClient) UpdateOrganizationName(ctx context.Context, in *UpdateOrganizationNameRequest) (*UpdateOrganizationNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateOrganizationName")
	caller := c.callUpdateOrganizationName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateOrganizationNameRequest) (*UpdateOrganizationNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateOrganizationNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateOrganizationNameRequest) when calling interceptor")
					}
					return c.callUpdateOrganizationName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateOrganizationNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateOrganizationNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callUpdateOrganizationName(ctx context.Context, in *UpdateOrganizationNameRequest) (*UpdateOrganizationNameResponse, error) {
	out := new(UpdateOrganizationNameResponse)
	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 *organizationServiceJSONClient) UpdateOrganizationNameByName(ctx context.Context, in *UpdateOrganizationNameByNameRequest) (*UpdateOrganizationNameByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "UpdateOrganizationNameByName")
	caller := c.callUpdateOrganizationNameByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *UpdateOrganizationNameByNameRequest) (*UpdateOrganizationNameByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*UpdateOrganizationNameByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*UpdateOrganizationNameByNameRequest) when calling interceptor")
					}
					return c.callUpdateOrganizationNameByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*UpdateOrganizationNameByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*UpdateOrganizationNameByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callUpdateOrganizationNameByName(ctx context.Context, in *UpdateOrganizationNameByNameRequest) (*UpdateOrganizationNameByNameResponse, error) {
	out := new(UpdateOrganizationNameByNameResponse)
	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 *organizationServiceJSONClient) DeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteOrganization")
	caller := c.callDeleteOrganization
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteOrganizationRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteOrganizationRequest) when calling interceptor")
					}
					return c.callDeleteOrganization(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteOrganizationResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteOrganizationResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callDeleteOrganization(ctx context.Context, in *DeleteOrganizationRequest) (*DeleteOrganizationResponse, error) {
	out := new(DeleteOrganizationResponse)
	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 *organizationServiceJSONClient) DeleteOrganizationByName(ctx context.Context, in *DeleteOrganizationByNameRequest) (*DeleteOrganizationByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "DeleteOrganizationByName")
	caller := c.callDeleteOrganizationByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *DeleteOrganizationByNameRequest) (*DeleteOrganizationByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*DeleteOrganizationByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*DeleteOrganizationByNameRequest) when calling interceptor")
					}
					return c.callDeleteOrganizationByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*DeleteOrganizationByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*DeleteOrganizationByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callDeleteOrganizationByName(ctx context.Context, in *DeleteOrganizationByNameRequest) (*DeleteOrganizationByNameResponse, error) {
	out := new(DeleteOrganizationByNameResponse)
	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 *organizationServiceJSONClient) AddOrganizationBaseRepositoryScope(ctx context.Context, in *AddOrganizationBaseRepositoryScopeRequest) (*AddOrganizationBaseRepositoryScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "AddOrganizationBaseRepositoryScope")
	caller := c.callAddOrganizationBaseRepositoryScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddOrganizationBaseRepositoryScopeRequest) (*AddOrganizationBaseRepositoryScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddOrganizationBaseRepositoryScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddOrganizationBaseRepositoryScopeRequest) when calling interceptor")
					}
					return c.callAddOrganizationBaseRepositoryScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddOrganizationBaseRepositoryScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddOrganizationBaseRepositoryScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callAddOrganizationBaseRepositoryScope(ctx context.Context, in *AddOrganizationBaseRepositoryScopeRequest) (*AddOrganizationBaseRepositoryScopeResponse, error) {
	out := new(AddOrganizationBaseRepositoryScopeResponse)
	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 *organizationServiceJSONClient) AddOrganizationBaseRepositoryScopeByName(ctx context.Context, in *AddOrganizationBaseRepositoryScopeByNameRequest) (*AddOrganizationBaseRepositoryScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "AddOrganizationBaseRepositoryScopeByName")
	caller := c.callAddOrganizationBaseRepositoryScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *AddOrganizationBaseRepositoryScopeByNameRequest) (*AddOrganizationBaseRepositoryScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*AddOrganizationBaseRepositoryScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*AddOrganizationBaseRepositoryScopeByNameRequest) when calling interceptor")
					}
					return c.callAddOrganizationBaseRepositoryScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*AddOrganizationBaseRepositoryScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*AddOrganizationBaseRepositoryScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

func (c *organizationServiceJSONClient) callAddOrganizationBaseRepositoryScopeByName(ctx context.Context, in *AddOrganizationBaseRepositoryScopeByNameRequest) (*AddOrganizationBaseRepositoryScopeByNameResponse, error) {
	out := new(AddOrganizationBaseRepositoryScopeByNameResponse)
	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 *organizationServiceJSONClient) RemoveOrganizationBaseRepositoryScope(ctx context.Context, in *RemoveOrganizationBaseRepositoryScopeRequest) (*RemoveOrganizationBaseRepositoryScopeResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveOrganizationBaseRepositoryScope")
	caller := c.callRemoveOrganizationBaseRepositoryScope
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveOrganizationBaseRepositoryScopeRequest) (*RemoveOrganizationBaseRepositoryScopeResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveOrganizationBaseRepositoryScopeRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveOrganizationBaseRepositoryScopeRequest) when calling interceptor")
					}
					return c.callRemoveOrganizationBaseRepositoryScope(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveOrganizationBaseRepositoryScopeResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveOrganizationBaseRepositoryScopeResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

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

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

func (c *organizationServiceJSONClient) RemoveOrganizationBaseRepositoryScopeByName(ctx context.Context, in *RemoveOrganizationBaseRepositoryScopeByNameRequest) (*RemoveOrganizationBaseRepositoryScopeByNameResponse, error) {
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	ctx = ctxsetters.WithMethodName(ctx, "RemoveOrganizationBaseRepositoryScopeByName")
	caller := c.callRemoveOrganizationBaseRepositoryScopeByName
	if c.interceptor != nil {
		caller = func(ctx context.Context, req *RemoveOrganizationBaseRepositoryScopeByNameRequest) (*RemoveOrganizationBaseRepositoryScopeByNameResponse, error) {
			resp, err := c.interceptor(
				func(ctx context.Context, req interface{}) (interface{}, error) {
					typedReq, ok := req.(*RemoveOrganizationBaseRepositoryScopeByNameRequest)
					if !ok {
						return nil, twirp.InternalError("failed type assertion req.(*RemoveOrganizationBaseRepositoryScopeByNameRequest) when calling interceptor")
					}
					return c.callRemoveOrganizationBaseRepositoryScopeByName(ctx, typedReq)
				},
			)(ctx, req)
			if resp != nil {
				typedResp, ok := resp.(*RemoveOrganizationBaseRepositoryScopeByNameResponse)
				if !ok {
					return nil, twirp.InternalError("failed type assertion resp.(*RemoveOrganizationBaseRepositoryScopeByNameResponse) when calling interceptor")
				}
				return typedResp, err
			}
			return nil, err
		}
	}
	return caller(ctx, in)
}

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

	callClientResponseReceived(ctx, c.opts.Hooks)

	return out, nil
}

// ==================================
// OrganizationService Server Handler
// ==================================

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

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

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

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

func (s *organizationServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
	ctx := req.Context()
	ctx = ctxsetters.WithPackageName(ctx, "buf.alpha.registry.v1alpha1")
	ctx = ctxsetters.WithServiceName(ctx, "OrganizationService")
	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.OrganizationService" {
		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 "GetOrganization":
		s.serveGetOrganization(ctx, resp, req)
		return
	case "GetOrganizationByName":
		s.serveGetOrganizationByName(ctx, resp, req)
		return
	case "ListOrganizations":
		s.serveListOrganizations(ctx, resp, req)
		return
	case "ListUserOrganizations":
		s.serveListUserOrganizations(ctx, resp, req)
		return
	case "CreateOrganization":
		s.serveCreateOrganization(ctx, resp, req)
		return
	case "UpdateOrganizationName":
		s.serveUpdateOrganizationName(ctx, resp, req)
		return
	case "UpdateOrganizationNameByName":
		s.serveUpdateOrganizationNameByName(ctx, resp, req)
		return
	case "DeleteOrganization":
		s.serveDeleteOrganization(ctx, resp, req)
		return
	case "DeleteOrganizationByName":
		s.serveDeleteOrganizationByName(ctx, resp, req)
		return
	case "AddOrganizationBaseRepositoryScope":
		s.serveAddOrganizationBaseRepositoryScope(ctx, resp, req)
		return
	case "AddOrganizationBaseRepositoryScopeByName":
		s.serveAddOrganizationBaseRepositoryScopeByName(ctx, resp, req)
		return
	case "RemoveOrganizationBaseRepositoryScope":
		s.serveRemoveOrganizationBaseRepositoryScope(ctx, resp, req)
		return
	case "RemoveOrganizationBaseRepositoryScopeByName":
		s.serveRemoveOrganizationBaseRepositoryScopeByName(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 *organizationServiceServer) serveGetOrganization(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.serveGetOrganizationJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveGetOrganizationProtobuf(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 *organizationServiceServer) serveGetOrganizationJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetOrganization")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *GetOrganizationResponse
	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 *GetOrganizationResponse and nil error while calling GetOrganization. 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 *organizationServiceServer) serveGetOrganizationByName(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.serveGetOrganizationByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveGetOrganizationByNameProtobuf(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 *organizationServiceServer) serveGetOrganizationByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "GetOrganizationByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *GetOrganizationByNameResponse
	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 *GetOrganizationByNameResponse and nil error while calling GetOrganizationByName. 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 *organizationServiceServer) serveListOrganizations(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.serveListOrganizationsJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveListOrganizationsProtobuf(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 *organizationServiceServer) serveListOrganizationsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListOrganizations")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *ListOrganizationsResponse
	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 *ListOrganizationsResponse and nil error while calling ListOrganizations. 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 *organizationServiceServer) serveListUserOrganizations(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.serveListUserOrganizationsJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveListUserOrganizationsProtobuf(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 *organizationServiceServer) serveListUserOrganizationsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "ListUserOrganizations")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *ListUserOrganizationsResponse
	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 *ListUserOrganizationsResponse and nil error while calling ListUserOrganizations. 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 *organizationServiceServer) serveCreateOrganization(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.serveCreateOrganizationJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveCreateOrganizationProtobuf(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 *organizationServiceServer) serveCreateOrganizationJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "CreateOrganization")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *CreateOrganizationResponse
	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 *CreateOrganizationResponse and nil error while calling CreateOrganization. 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 *organizationServiceServer) serveUpdateOrganizationName(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.serveUpdateOrganizationNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveUpdateOrganizationNameProtobuf(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 *organizationServiceServer) serveUpdateOrganizationNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateOrganizationName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *UpdateOrganizationNameResponse
	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 *UpdateOrganizationNameResponse and nil error while calling UpdateOrganizationName. 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 *organizationServiceServer) serveUpdateOrganizationNameByName(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.serveUpdateOrganizationNameByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveUpdateOrganizationNameByNameProtobuf(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 *organizationServiceServer) serveUpdateOrganizationNameByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "UpdateOrganizationNameByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *UpdateOrganizationNameByNameResponse
	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 *UpdateOrganizationNameByNameResponse and nil error while calling UpdateOrganizationNameByName. 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 *organizationServiceServer) serveDeleteOrganization(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.serveDeleteOrganizationJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveDeleteOrganizationProtobuf(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 *organizationServiceServer) serveDeleteOrganizationJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteOrganization")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *DeleteOrganizationResponse
	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 *DeleteOrganizationResponse and nil error while calling DeleteOrganization. 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 *organizationServiceServer) serveDeleteOrganizationByName(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.serveDeleteOrganizationByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveDeleteOrganizationByNameProtobuf(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 *organizationServiceServer) serveDeleteOrganizationByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "DeleteOrganizationByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *DeleteOrganizationByNameResponse
	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 *DeleteOrganizationByNameResponse and nil error while calling DeleteOrganizationByName. 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 *organizationServiceServer) serveAddOrganizationBaseRepositoryScope(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.serveAddOrganizationBaseRepositoryScopeJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveAddOrganizationBaseRepositoryScopeProtobuf(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 *organizationServiceServer) serveAddOrganizationBaseRepositoryScopeJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddOrganizationBaseRepositoryScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *AddOrganizationBaseRepositoryScopeResponse
	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 *AddOrganizationBaseRepositoryScopeResponse and nil error while calling AddOrganizationBaseRepositoryScope. 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 *organizationServiceServer) serveAddOrganizationBaseRepositoryScopeByName(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.serveAddOrganizationBaseRepositoryScopeByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveAddOrganizationBaseRepositoryScopeByNameProtobuf(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 *organizationServiceServer) serveAddOrganizationBaseRepositoryScopeByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "AddOrganizationBaseRepositoryScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *AddOrganizationBaseRepositoryScopeByNameResponse
	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 *AddOrganizationBaseRepositoryScopeByNameResponse and nil error while calling AddOrganizationBaseRepositoryScopeByName. 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 *organizationServiceServer) serveRemoveOrganizationBaseRepositoryScope(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.serveRemoveOrganizationBaseRepositoryScopeJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveRemoveOrganizationBaseRepositoryScopeProtobuf(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 *organizationServiceServer) serveRemoveOrganizationBaseRepositoryScopeJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveOrganizationBaseRepositoryScope")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

	// Call service method
	var respContent *RemoveOrganizationBaseRepositoryScopeResponse
	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 *RemoveOrganizationBaseRepositoryScopeResponse and nil error while calling RemoveOrganizationBaseRepositoryScope. 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 *organizationServiceServer) serveRemoveOrganizationBaseRepositoryScopeByName(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.serveRemoveOrganizationBaseRepositoryScopeByNameJSON(ctx, resp, req)
	case "application/protobuf":
		s.serveRemoveOrganizationBaseRepositoryScopeByNameProtobuf(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 *organizationServiceServer) serveRemoveOrganizationBaseRepositoryScopeByNameJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
	var err error
	ctx = ctxsetters.WithMethodName(ctx, "RemoveOrganizationBaseRepositoryScopeByName")
	ctx, err = callRequestRouted(ctx, s.hooks)
	if err != nil {
		s.writeError(ctx, resp, err)
		return
	}

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

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

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

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

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

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