// DeleteCategory deletes the category.
178643
func (c *Conn) DeleteCategory(cat *Category) error {
	return c.do("smugmug.categories.delete", nil, "CategoryID", itoa64(cat.ID))
}
411374
func (o *Enterprise) CreateWebCategory(child *WebCategory) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
461883
func (gp *EpgPolicy) Delete() error {
	// delete from the DB
	delete(epgPolicyDb, gp.EpgPolicyKey)

	return gp.Clear()
}
1289647
func (c *Client) DeleteOrganization(ctx context.Context, id influxdb.ID) error {
	err := c.db.Update(func(tx *bolt.Tx) error {
		if pe := c.deleteOrganizationsBuckets(ctx, tx, id); pe != nil {
			return pe
		}
		if pe := c.deleteOrganization(ctx, tx, id); pe != nil {
			return pe
		}
		return nil
	})
	if err != nil {
		return &influxdb.Error{
			Op:  getOp(influxdb.OpDeleteOrganization),
			Err: err,
		}
	}
	return nil
}
1240103
func (a *StartArgs) SetCategories(categories string) *StartArgs {
	a.Categories = &categories
	return a
}
884193
func equalCategories(expected, actual string) bool {
	expectedCategories := strings.Split(expected, ",")
	actualCategories := strings.Split(actual, ",")

	sort.Strings(expectedCategories)
	sort.Strings(actualCategories)

	return util.EqualStringSlices(expectedCategories, actualCategories)
}
777034
func (s *ModifyEventSubscriptionInput) SetEventCategories(v []*string) *ModifyEventSubscriptionInput {
	s.EventCategories = v
	return s
}
957270
func (db *SQLStorage) Delete(gun data.GUN) error {
	tx, rb, err := db.getTransaction()
	if err != nil {
		return err
	}
	if err := func() error {
		res := tx.Unscoped().Where(&TUFFile{Gun: gun.String()}).Delete(TUFFile{})
		if err := res.Error; err != nil {
			return err
		}
		// if there weren't actually any records for the GUN, don't write
		// a deletion change record.
		if res.RowsAffected == 0 {
			return nil
		}
		c := &SQLChange{
			GUN:      gun.String(),
			Category: changeCategoryDeletion,
		}
		return tx.Create(c).Error
	}(); err != nil {
		return rb(err)
	}
	return tx.Commit().Error
}
896103
func ValidateCategory(name string) error {
	if strings.TrimSpace(name) == "" {
		return errBadCategory
	}
	if !validCategoryRE.MatchString(name) {
		return fmt.Errorf("must match %s", validCategoryRE)
	}
	cleaned := path.Clean(name)
	if cleaned != name {
		return errBadCategory
	}
	return nil
}
337963
func (s *EventTypeFilter) SetEventTypeCategories(v []*string) *EventTypeFilter {
	s.EventTypeCategories = v
	return s
}
803645
func (c *Conn) CreateCategory(name string) (*Category, error) {
	var out struct {
		Category *Category
	}
	if err := c.do("smugmug.categories.create", &out, "Name", name); err != nil {
		return nil, err
	}
	return out.Category, nil
}
316436
func (s *PlatformDescription) SetPlatformCategory(v string) *PlatformDescription {
	s.PlatformCategory = &v
	return s
}
637296
func (c *Manager) GetCategory(ctx context.Context, id string) (*Category, error) {
	if isName(id) {
		cat, err := c.GetCategories(ctx)
		if err != nil {
			return nil, err
		}

		for i := range cat {
			if cat[i].Name == id {
				return &cat[i], nil
			}
		}
	}
	url := internal.URL(c, internal.CategoryPath).WithID(id)
	var res Category
	return &res, c.Do(ctx, url.Request(http.MethodGet), &res)
}
28844
func (o *Enterprise) WebCategories(info *bambou.FetchingInfo) (WebCategoriesList, *bambou.Error) {

	var list WebCategoriesList
	err := bambou.CurrentSession().FetchChildren(o, WebCategoryIdentity, &list, info)
	return list, err
}
37483
func (c *Manager) DeleteLibrary(ctx context.Context, library *Library) error {
	url := internal.URL(c, internal.LocalLibraryPath).WithID(library.ID)
	return c.Do(ctx, url.Request(http.MethodDelete), nil)
}
1004570
func (s *EventSubscription) SetEventCategoriesList(v []*string) *EventSubscription {
	s.EventCategoriesList = v
	return s
}
1164861
func (c *Category) Validate() error {
	if c.Category == "" {
		return errors.New(ErrValidation, errorMessages, "channel category must not be empty")
	}
	return nil
}