// subscriptionName returns full PubSub subscription name for AuthDB
// change notifications stream from given auth service.
777422
func subscriptionName(c context.Context, authServiceURL string) string {
	subIDPrefix := "gae-v1"
	if info.IsDevAppServer(c) {
		subIDPrefix = "dev-app-server-v1"
	}
	serviceURL, err := url.Parse(authServiceURL)
	if err != nil {
		panic(err)
	}
	return fmt.Sprintf("projects/%s/subscriptions/%s+%s", info.AppID(c), subIDPrefix, serviceURL.Host)
}
327012
func (s *SetDefaultAuthorizerOutput) SetAuthorizerName(v string) *SetDefaultAuthorizerOutput {
	s.AuthorizerName = &v
	return s
}
1309199
func newSubscription(db *Database) (*Subscription, error) {
	sub := &Subscription{
		database: db,
	}
	err := sub.ensureProtocol()
	if err != nil {
		return nil, err
	}
	// Perform authentication and database selection.
	err = sub.resp.authenticate()
	if err != nil {
		sub.database.pool.kill(sub.resp)
		return nil, err
	}
	return sub, nil
}
312929
func (r *Repo) dbName(ctx context.Context) string {
	ns := eh.NamespaceFromContext(ctx)
	return r.dbPrefix + "_" + ns
}
57357
func (logger *StreamLogger) Subscribe(name string) chan interface{} {
	logger.mu.Lock()
	defer logger.mu.Unlock()

	ch := make(chan interface{}, logger.size)
	logger.subscribed[ch] = name
	return ch
}
467561
func (c *client) removeReplySub(sub *subscription) {
	if sub == nil {
		return
	}
	// Lookup the account based on sub.sid.
	if i := bytes.Index(sub.sid, []byte(" ")); i > 0 {
		// First part of SID for route is account name.
		if acc, _ := c.srv.LookupAccount(string(sub.sid[:i])); acc != nil {
			acc.sl.Remove(sub)
		}
		c.mu.Lock()
		c.removeReplySubTimeout(sub)
		delete(c.subs, string(sub.sid))
		c.mu.Unlock()
	}
}
56407
func killPubSub(c context.Context, authServiceURL string) error {
	service := getAuthService(c, authServiceURL)
	return service.DeleteSubscription(c, subscriptionName(c, authServiceURL))
}
615683
func (s *CreateVPCEConfigurationInput) SetServiceDnsName(v string) *CreateVPCEConfigurationInput {
	s.ServiceDnsName = &v
	return s
}
9708
func (s *DescribeEventSubscriptionsInput) SetSubscriptionName(v string) *DescribeEventSubscriptionsInput {
	s.SubscriptionName = &v
	return s
}
363152
func (s *userService) UpdateUsername(id int64, newUsername string) (datamodels.User, error) {
	return s.Update(id, datamodels.User{
		Username: newUsername,
	})
}
492637
func (s *GroupMember) SetMemberName(v string) *GroupMember {
	s.MemberName = &v
	return s
}
362380
func (s *DvbSdtSettings) SetServiceProviderName(v string) *DvbSdtSettings {
	s.ServiceProviderName = &v
	return s
}
127203
func (br *BuilderRef) BuilderName() string {
	comp := strings.Split(br.ID, "/")
	return comp[len(comp)-1]
}
557129
func (ip *Interpreter) changeName(args []string) {
	ip.simpleResponder(ip.Backend.ChangeUserName(args[0], args[1], args[2]))
}
608349
func (s *RestoreDBInstanceFromS3Input) SetDBSubnetGroupName(v string) *RestoreDBInstanceFromS3Input {
	s.DBSubnetGroupName = &v
	return s
}
1301032
func (s *RestoreDBInstanceToPointInTimeInput) SetDBSubnetGroupName(v string) *RestoreDBInstanceToPointInTimeInput {
	s.DBSubnetGroupName = &v
	return s
}
592549
func (p *PubSub) Subscribe(id string, s Subscriber) error {
	p.m.Lock()
	defer p.m.Unlock()

	p.subscribers[id] = s
	return nil
}