// UpdateOrganization updates a organization according the parameters set on upd.
491331
func (s *Service) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error) {
	var o *influxdb.Organization
	err := s.kv.Update(ctx, func(tx Tx) error {
		org, pe := s.updateOrganization(ctx, tx, id, upd)
		if pe != nil {
			return &influxdb.Error{
				Err: pe,
			}
		}
		o = org
		return nil
	})

	return o, err
}
463004
func (p *PushEventRepository) GetOrganization() string {
	if p == nil || p.Organization == nil {
		return ""
	}
	return *p.Organization
}
308372
func (s *DescribeOrganizationOutput) SetOrganizationId(v string) *DescribeOrganizationOutput {
	s.OrganizationId = &v
	return s
}
953909
func (c *Client) OrganizationUpdate(organizationIdentity string, options *OrganizationUpdateOpts) (*Organization, error) {
	var organizationRes Organization
	return &organizationRes, c.Patch(&organizationRes, "/organizations/"+organizationIdentity, options)
}
81548
func (s *DeleteNotificationSubscriptionInput) SetOrganizationId(v string) *DeleteNotificationSubscriptionInput {
	s.OrganizationId = &v
	return s
}
118398
func (s *UpdateResourceInput) SetOrganizationId(v string) *UpdateResourceInput {
	s.OrganizationId = &v
	return s
}
296959
func (s *UpdateServiceSettingsInput) SetOrganizationConfiguration(v *OrganizationConfiguration) *UpdateServiceSettingsInput {
	s.OrganizationConfiguration = v
	return s
}
1195314
func (s *Service) UpdateOrganization(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error) {
	o, err := s.FindOrganizationByID(ctx, id)
	if err != nil {
		return nil, &platform.Error{
			Err: err,
			Op:  OpPrefix + platform.OpUpdateOrganization,
		}
	}

	if upd.Name != nil {
		if *upd.Name = strings.TrimSpace(*upd.Name); *upd.Name == "" {
			return nil, platform.ErrOrgNameisEmpty
		}
		if _, err := s.FindOrganization(ctx, platform.OrganizationFilter{Name: upd.Name}); err == nil {
			return nil, &platform.Error{
				Code: platform.EConflict,
				Msg:  fmt.Sprintf("organization with name %s already exists", *upd.Name),
			}
		}
		o.Name = *upd.Name
	}

	s.organizationKV.Store(o.ID.String(), o)

	return o, nil
}
1140988
func (s *ASN1Subject) SetOrganizationalUnit(v string) *ASN1Subject {
	s.OrganizationalUnit = &v
	return s
}
802684
func (s *DeleteMailboxPermissionsInput) SetOrganizationId(v string) *DeleteMailboxPermissionsInput {
	s.OrganizationId = &v
	return s
}
71986
func (s *DescribeGroupsInput) SetOrganizationId(v string) *DescribeGroupsInput {
	s.OrganizationId = &v
	return s
}
1075298
func (c *Client) GetOrganization(orgID string, args Arguments) (organization *Organization, err error) {
	path := fmt.Sprintf("organizations/%s", orgID)
	err = c.Get(path, args, &organization)
	if organization != nil {
		organization.client = c
	}
	return
}
1232415
func (c *Client) UpdateOrganization(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error) {
	var o *platform.Organization
	err := c.db.Update(func(tx *bolt.Tx) error {
		org, pe := c.updateOrganization(ctx, tx, id, upd)
		if pe != nil {
			return &platform.Error{
				Err: pe,
				Op:  getOp(platform.OpUpdateOrganization),
			}
		}
		o = org
		return nil
	})

	return o, err
}
1193169
func (r *Client) UpdateOrg(org Org, oid uint) (StatusMessage, error) {
	var (
		raw  []byte
		resp StatusMessage
		err  error
	)
	if raw, err = json.Marshal(org); err != nil {
		return StatusMessage{}, err
	}
	if raw, _, err = r.put(fmt.Sprintf("api/orgs/%d", oid), nil, raw); err != nil {
		return StatusMessage{}, err
	}
	if err = json.Unmarshal(raw, &resp); err != nil {
		return StatusMessage{}, err
	}
	return resp, nil
}
1075338
func (s *OrganizationService) CreateOrganization(ctx context.Context, b *platform.Organization) error {
	return s.CreateOrganizationF(ctx, b)
}
579172
func (s *CreatePortfolioShareInput) SetOrganizationNode(v *OrganizationNode) *CreatePortfolioShareInput {
	s.OrganizationNode = v
	return s
}
802906
func (s *Service) OrganizationUpdate(ctx context.Context, organizationIdentity string, o OrganizationUpdateOpts) (*Organization, error) {
	var organization Organization
	return &organization, s.Patch(ctx, &organization, fmt.Sprintf("/organizations/%v", organizationIdentity), o)
}