// SetQuota - assign a unique project id to directory and set the quota limits
// for that project id
511982
func (q *Control) SetQuota(targetPath string, quota Quota) error {

	projectID, ok := q.quotas[targetPath]
	if !ok {
		projectID = q.nextProjectID

		//
		// assign project id to new container directory
		//
		err := setProjectID(targetPath, projectID)
		if err != nil {
			return err
		}

		q.quotas[targetPath] = projectID
		q.nextProjectID++
	}

	//
	// set the quota limit for the container's project id
	//
	logrus.Debugf("SetQuota(%s, %d): projectID=%d", targetPath, quota.Size, projectID)
	return setProjectQuota(q.backingFsBlockDev, projectID, quota)
}
385197
func (s *StreamingDistributionList) SetQuantity(v int64) *StreamingDistributionList {
	s.Quantity = &v
	return s
}
1154263
func (d *RawData) SetData(data interface{}, args ...int) Data {
	d.Data = data
	if len(args) > 0 {
		d.SetCode(args[0])
	} else {
		d.SetCode(1)
	}
	return d
}
556743
func (s *OriginGroups) SetQuantity(v int64) *OriginGroups {
	s.Quantity = &v
	return s
}
214767
func (s *InvalidationList) SetQuantity(v int64) *InvalidationList {
	s.Quantity = &v
	return s
}
797893
func (e *clusterQuotaAccessor) UpdateQuotaStatus(newQuota *corev1.ResourceQuota) error {
	clusterQuota, err := e.clusterQuotaLister.Get(newQuota.Name)
	if err != nil {
		return err
	}
	clusterQuota = e.checkCache(clusterQuota)

	// re-assign objectmeta
	// make a copy
	clusterQuota = clusterQuota.DeepCopy()
	clusterQuota.ObjectMeta = newQuota.ObjectMeta
	clusterQuota.Namespace = ""

	// determine change in usage
	usageDiff := utilquota.Subtract(newQuota.Status.Used, clusterQuota.Status.Total.Used)

	// update aggregate usage
	clusterQuota.Status.Total.Used = newQuota.Status.Used

	// update per namespace totals
	oldNamespaceTotals, _ := quotav1conversions.GetResourceQuotasStatusByNamespace(clusterQuota.Status.Namespaces, newQuota.Namespace)
	namespaceTotalCopy := oldNamespaceTotals.DeepCopy()
	newNamespaceTotals := *namespaceTotalCopy
	newNamespaceTotals.Used = utilquota.Add(oldNamespaceTotals.Used, usageDiff)
	quotav1conversions.InsertResourceQuotasStatus(&clusterQuota.Status.Namespaces, quotav1.ResourceQuotaStatusByNamespace{
		Namespace: newQuota.Namespace,
		Status:    newNamespaceTotals,
	})

	updatedQuota, err := e.clusterQuotaClient.ClusterResourceQuotas().UpdateStatus(clusterQuota)
	if err != nil {
		return err
	}

	e.updatedClusterQuotas.Add(clusterQuota.Name, updatedQuota)
	return nil
}
279979
func (r *realisClient) SetQuota(role string, cpu *float64, ramMb *int64, diskMb *int64) (*aurora.Response, error) {
	ramRes := aurora.NewResource()
	ramRes.RamMb = ramMb
	cpuRes := aurora.NewResource()
	cpuRes.NumCpus = cpu
	diskRes := aurora.NewResource()
	diskRes.DiskMb = diskMb
	quota := aurora.NewResourceAggregate()
	quota.Resources = []*aurora.Resource{cpuRes, ramRes, diskRes}
	resp, retryErr := r.thriftCallWithRetries(func() (*aurora.Response, error) {
		return r.adminClient.SetQuota(nil, role, quota)
	})

	if retryErr != nil {
		return resp, errors.Wrap(retryErr, "Unable to set role quota")
	}
	return resp, retryErr

}
922053
func (api *ProjectsAPI) modifyQuota(method string, projectId string, spec *QuotaSpec) (task *Task, err error) {
	body, err := json.Marshal(spec)
	if err != nil {
		return
	}
	res, err := api.client.restClient.SendRequestCommon(
		method,
		api.client.Endpoint+projectUrl+projectId+"/quota",
		"application/json",
		bytes.NewReader(body),
		api.client.options.TokenOptions)
	if err != nil {
		return
	}
	defer res.Body.Close()
	task, err = getTask(getError(res))
	return
}
691547
func (s *CSVOutput) SetQuoteFields(v string) *CSVOutput {
	s.QuoteFields = &v
	return s
}
1128238
func (m *clusterQuotaMapper) requireQuota(quota *quotav1.ClusterResourceQuota) bool {
	m.lock.RLock()
	selector, exists := m.requiredQuotaToSelector[quota.Name]
	m.lock.RUnlock()

	if selectorMatches(selector, exists, quota) {
		return false
	}

	m.lock.Lock()
	defer m.lock.Unlock()
	selector, exists = m.requiredQuotaToSelector[quota.Name]
	if selectorMatches(selector, exists, quota) {
		return false
	}

	m.requiredQuotaToSelector[quota.Name] = quota.Spec.Selector
	return true
}
280831
func (p *AuroraAdminClient) SetQuota(ctx context.Context, ownerRole string, quota *ResourceAggregate) (r *Response, err error) {
  var _args316 AuroraAdminSetQuotaArgs
  _args316.OwnerRole = ownerRole
  _args316.Quota = quota
  var _result317 AuroraAdminSetQuotaResult
  if err = p.Client_().Call(ctx, "setQuota", &_args316, &_result317); err != nil {
    return
  }
  return _result317.GetSuccess(), nil
}
347160
func (s *GetProjectOutput) SetProject(v *Project) *GetProjectOutput {
	s.Project = v
	return s
}
710648
func (s *CustomErrorResponses) SetQuantity(v int64) *CustomErrorResponses {
	s.Quantity = &v
	return s
}
994281
func (s *Origins) SetQuantity(v int64) *Origins {
	s.Quantity = &v
	return s
}
540194
func (s *PublicKeyList) SetQuantity(v int64) *PublicKeyList {
	s.Quantity = &v
	return s
}
1094273
func (s *Job) SetData(v *JobData) *Job {
	s.Data = v
	return s
}
1234590
func (s *LambdaFunctionAssociations) SetQuantity(v int64) *LambdaFunctionAssociations {
	s.Quantity = &v
	return s
}