// SetURL sets the URL optional argument. If specified, deletes all
// the cookies with the given name where domain and path match provided
// URL.
771312
func (a *DeleteCookiesArgs) SetURL(url string) *DeleteCookiesArgs {
	a.URL = &url
	return a
}
721815
func (s *CreateCloudFormationTemplateOutput) SetTemplateUrl(v string) *CreateCloudFormationTemplateOutput {
	s.TemplateUrl = &v
	return s
}
497163
func (u *Unit) SetCharmURL(curl *charm.URL) error {
	if curl == nil {
		return fmt.Errorf("cannot set nil charm url")
	}

	db, closer := u.st.newDB()
	defer closer()
	units, closer := db.GetCollection(unitsC)
	defer closer()
	charms, closer := db.GetCollection(charmsC)
	defer closer()

	buildTxn := func(attempt int) ([]txn.Op, error) {
		if attempt > 0 {
			// NOTE: We're explicitly allowing SetCharmURL to succeed
			// when the unit is Dying, because application/charm upgrades
			// should still be allowed to apply to dying units, so
			// that bugs in departed/broken hooks can be addressed at
			// runtime.
			if notDead, err := isNotDeadWithSession(units, u.doc.DocID); err != nil {
				return nil, errors.Trace(err)
			} else if !notDead {
				return nil, ErrDead
			}
		}
		sel := bson.D{{"_id", u.doc.DocID}, {"charmurl", curl}}
		if count, err := units.Find(sel).Count(); err != nil {
			return nil, errors.Trace(err)
		} else if count == 1 {
			// Already set
			return nil, jujutxn.ErrNoOperations
		}
		if count, err := charms.FindId(curl.String()).Count(); err != nil {
			return nil, errors.Trace(err)
		} else if count < 1 {
			return nil, errors.Errorf("unknown charm url %q", curl)
		}

		// Add a reference to the application settings for the new charm.
		incOps, err := appCharmIncRefOps(u.st, u.doc.Application, curl, false)
		if err != nil {
			return nil, errors.Trace(err)
		}

		// Set the new charm URL.
		differentCharm := bson.D{{"charmurl", bson.D{{"$ne", curl}}}}
		ops := append(incOps,
			txn.Op{
				C:      unitsC,
				Id:     u.doc.DocID,
				Assert: append(notDeadDoc, differentCharm...),
				Update: bson.D{{"$set", bson.D{{"charmurl", curl}}}},
			})
		if u.doc.CharmURL != nil {
			// Drop the reference to the old charm.
			// Since we can force this now, let's.. There is no point hanging on to the old charm.
			op := &ForcedOperation{Force: true}
			decOps, err := appCharmDecRefOps(u.st, u.doc.Application, u.doc.CharmURL, true, op)
			if err != nil {
				// No need to stop further processing if the old key could not be removed.
				logger.Errorf("could not remove old charm references for %v:%v", u.doc.CharmURL, err)
			}
			if len(op.Errors) != 0 {
				logger.Errorf("could not remove old charm references for %v:%v", u.doc.CharmURL, op.Errors)
			}
			ops = append(ops, decOps...)
		}
		return ops, nil
	}
	err := u.st.db().Run(buildTxn)
	if err == nil {
		u.doc.CharmURL = curl
	}
	return err
}
393064
func (s *UICustomizationType) SetImageUrl(v string) *UICustomizationType {
	s.ImageUrl = &v
	return s
}
407381
func (s *SourceRevision) SetRevisionUrl(v string) *SourceRevision {
	s.RevisionUrl = &v
	return s
}
1067018
func (a *DeleteCookiesArgs) SetDomain(domain string) *DeleteCookiesArgs {
	a.Domain = &domain
	return a
}
857489
func (c *Client) SetServerURL(serverURL string) error {
	u, err := url.Parse(serverURL)
	if err != nil {
		return fmt.Errorf("omaha: invalid server URL: %v", err)
	}
	if u.Scheme != "http" && u.Scheme != "https" {
		return fmt.Errorf("omaha: invalid server protocol: %s", u)
	}
	if u.Host == "" {
		return fmt.Errorf("omaha: invalid server host: %s", u)
	}
	if u.Path == "" || u.Path == "/" {
		u.Path = "/v1/update/"
	}

	c.apiEndpoint = u.String()
	return nil
}
759650
func (s *IngestEndpoint) SetUrl(v string) *IngestEndpoint {
	s.Url = &v
	return s
}
1326030
func (s *GetDownloadUrlForLayerOutput) SetDownloadUrl(v string) *GetDownloadUrlForLayerOutput {
	s.DownloadUrl = &v
	return s
}
310567
func (r *Request) SetPath(path string) {
	if r.URL == nil {
		r.URL = &url.URL{}
	}
	r.URL.Path = path
}
323457
func (s *Endpoint) SetUrl(v string) *Endpoint {
	s.Url = &v
	return s
}
686446
func (s *Recommendation) SetUrl(v string) *Recommendation {
	s.Url = &v
	return s
}
624591
func (s *GetOpenIDConnectProviderOutput) SetUrl(v string) *GetOpenIDConnectProviderOutput {
	s.Url = &v
	return s
}
656869
func (s *GetDomainOutput) SetDomain(v *Domain) *GetDomainOutput {
	s.Domain = v
	return s
}
639966
func (s *InputDestination) SetUrl(v string) *InputDestination {
	s.Url = &v
	return s
}
862745
func (s *BundleDetails) SetIconUrl(v string) *BundleDetails {
	s.IconUrl = &v
	return s
}
498231
func (s *UpdateOriginEndpointOutput) SetUrl(v string) *UpdateOriginEndpointOutput {
	s.Url = &v
	return s
}