// Claim a position
776468
func (b *PositionsService) Claim(positionId int, amount string) (Position, error) {

	request := map[string]interface{}{
		"position_id": positionId,
		"amount":      amount,
	}

	req, err := b.client.newAuthenticatedRequest("POST", "position/claim", request)

	if err != nil {
		return Position{}, err
	}

	var position = &Position{}

	_, err = b.client.do(req, position)

	if err != nil {
		return Position{}, err
	}

	return *position, nil
}
396012
func (b *PositionsService) All() ([]Position, error) {
	req, err := b.client.newAuthenticatedRequest("POST", "positions", nil)
	if err != nil {
		return nil, err
	}

	var positions []Position
	_, err = b.client.do(req, &positions)
	if err != nil {
		return nil, err
	}

	return positions, nil
}
821276
func (p *OpenPrinter) ClaimPDF() ([]byte, error) {
	data, err := httpGET(&p.auth, p.register.InvitePageURL)
	if err != nil {
		return nil, fmt.Errorf("ClaimPDF: %v", err)
	}
	return data, nil
}
1071965
func (s *GetResourcesOutput) SetPosition(v string) *GetResourcesOutput {
	s.Position = &v
	return s
}
112369
func (s *GetApiKeysOutput) SetPosition(v string) *GetApiKeysOutput {
	s.Position = &v
	return s
}
456705
func (n namespace) claim(name string, line int) error {
	s := n.transform(name)
	if line, ok := n.names[s]; ok {
		return nameConflict{name: name, line: line}
	}
	n.names[s] = line
	return nil
}
109890
func (p *PullRequestComment) GetPosition() int {
	if p == nil || p.Position == nil {
		return 0
	}
	return *p.Position
}
1367312
func (ctrl *PersistentVolumeController) updateClaim(claim *v1.PersistentVolumeClaim) {
	// Store the new claim version in the cache and do not process it if this is
	// an old version.
	new, err := ctrl.storeClaimUpdate(claim)
	if err != nil {
		klog.Errorf("%v", err)
	}
	if !new {
		return
	}
	err = ctrl.syncClaim(claim)
	if err != nil {
		if errors.IsConflict(err) {
			// Version conflict error happens quite often and the controller
			// recovers from it easily.
			klog.V(3).Infof("could not sync claim %q: %+v", claimToClaimKey(claim), err)
		} else {
			klog.Errorf("could not sync volume %q: %+v", claimToClaimKey(claim), err)
		}
	}
}
912636
func (j *Jobs) Register(job *Job, q *WriteOptions) (*JobRegisterResponse, *WriteMeta, error) {
	return j.RegisterOpts(job, nil, q)
}
757269
func (v SList) Position(llink SList) int {
	return int(C.g_slist_position(v.GSList, llink.GSList))
}
1115004
func (s *GetDocumentationPartsInput) SetPosition(v string) *GetDocumentationPartsInput {
	s.Position = &v
	return s
}
832045
func NewClaimsHeader(opts ...Option) *ClaimsHeader {

	c := &ClaimsHeader{}

	for _, opt := range opts {
		opt(c)
	}

	return c
}
771947
func (self *FileSet) Position(idx Idx) *Position {
	for _, file := range self.files {
		if idx <= Idx(file.base+len(file.src)) {
			return file.Position(idx - Idx(file.base))
		}
	}

	return nil
}
857470
func (e *RoleService) Put(role *Role) (data *Role, err error) {
	path := fmt.Sprintf("roles/%s", role.Name)
	//  err = e.client.magicRequestDecoder("PUT", path, role, nil)
	body, err := JSONReader(role)
	if err != nil {
		return
	}

	err = e.client.magicRequestDecoder(
		"PUT",
		path,
		body,
		&data,
	)
	return
}
838599
func (s *MultiTermvectorItem) Positions(positions bool) *MultiTermvectorItem {
	s.positions = &positions
	return s
}
484181
func (s *GetDeploymentsInput) SetPosition(v string) *GetDeploymentsInput {
	s.Position = &v
	return s
}
952803
func (s *MappingRule) SetClaim(v string) *MappingRule {
	s.Claim = &v
	return s
}