// SetOperationState restores the state of the cryptographic operation in a session.
774549
func (c *Ctx) SetOperationState(sh SessionHandle, state []byte, encryptKey, authKey ObjectHandle) error {
	e := C.SetOperationState(c.ctx, C.CK_SESSION_HANDLE(sh), C.CK_BYTE_PTR(unsafe.Pointer(&state[0])),
		C.CK_ULONG(len(state)), C.CK_OBJECT_HANDLE(encryptKey), C.CK_OBJECT_HANDLE(authKey))
	return toError(e)
}
111609
func (cmd *baseCommand) setOperate(policy *WritePolicy, key *Key, operations []*Operation) (bool, error) {
	if len(operations) == 0 {
		return false, NewAerospikeError(PARAMETER_ERROR, "No operations were passed.")
	}

	cmd.begin()
	fieldCount := 0
	readAttr := 0
	writeAttr := 0
	hasWrite := false
	readBin := false
	readHeader := false
	RespondPerEachOp := policy.RespondPerEachOp

	for i := range operations {
		switch operations[i].opType {
		case _MAP_READ:
			// Map operations require RespondPerEachOp to be true.
			RespondPerEachOp = true
			// Fall through to read.
			fallthrough
		case _READ, _CDT_READ:
			if !operations[i].headerOnly {
				readAttr |= _INFO1_READ

				// Read all bins if no bin is specified.
				if operations[i].binName == "" {
					readAttr |= _INFO1_GET_ALL
				}
				readBin = true
			} else {
				readAttr |= _INFO1_READ
				readHeader = true
			}
		case _MAP_MODIFY:
			// Map operations require RespondPerEachOp to be true.
			RespondPerEachOp = true
			// Fall through to default.
			fallthrough
		default:
			writeAttr = _INFO2_WRITE
			hasWrite = true
		}
		cmd.estimateOperationSizeForOperation(operations[i])
	}

	ksz, err := cmd.estimateKeySize(key, policy.SendKey && hasWrite)
	if err != nil {
		return hasWrite, err
	}
	fieldCount += ksz

	if err := cmd.sizeBuffer(); err != nil {
		return hasWrite, err
	}

	if readHeader && !readBin {
		readAttr |= _INFO1_NOBINDATA
	}

	if RespondPerEachOp {
		writeAttr |= _INFO2_RESPOND_ALL_OPS
	}

	if writeAttr != 0 {
		cmd.writeHeaderWithPolicy(policy, readAttr, writeAttr, fieldCount, len(operations))
	} else {
		cmd.writeHeader(&policy.BasePolicy, readAttr, writeAttr, fieldCount, len(operations))
	}
	cmd.writeKey(key, policy.SendKey && hasWrite)

	for _, operation := range operations {
		if err := cmd.writeOperationForOperation(operation); err != nil {
			return hasWrite, err
		}
	}

	cmd.end()

	return hasWrite, nil
}
1015340
func (s *Handshake) SetState(v string) *Handshake {
	s.State = &v
	return s
}
45945
func (s *AvailabilityZone) SetState(v string) *AvailabilityZone {
	s.State = &v
	return s
}
514160
func (s *DeleteInstanceSnapshotOutput) SetOperations(v []*Operation) *DeleteInstanceSnapshotOutput {
	s.Operations = v
	return s
}
660086
func (s *JobDescriptor) SetOperation(v *JobOperation) *JobDescriptor {
	s.Operation = v
	return s
}
1103919
func (s *ReleaseStaticIpOutput) SetOperations(v []*Operation) *ReleaseStaticIpOutput {
	s.Operations = v
	return s
}
906372
func (s *CloseInstancePublicPortsOutput) SetOperation(v *Operation) *CloseInstancePublicPortsOutput {
	s.Operation = v
	return s
}
881031
func (s *DeleteDomainEntryOutput) SetOperation(v *Operation) *DeleteDomainEntryOutput {
	s.Operation = v
	return s
}
115047
func (s *UpdateDomainEntryOutput) SetOperations(v []*Operation) *UpdateDomainEntryOutput {
	s.Operations = v
	return s
}
1018547
func (s *AttachLoadBalancerTlsCertificateOutput) SetOperations(v []*Operation) *AttachLoadBalancerTlsCertificateOutput {
	s.Operations = v
	return s
}
693190
func (s *GetOperationsOutput) SetOperations(v []*Operation) *GetOperationsOutput {
	s.Operations = v
	return s
}
386678
func setOperation(s1, s2 StringSet, wantElemsInSet2 bool) map[string]struct{} {
	resultSet := make(map[string]struct{})
	for key, _ := range s1 {
		if _, ok := s2[key]; ok == wantElemsInSet2 {
			resultSet[key] = struct{}{}
		}
	}
	return resultSet
}
142863
func (s *CopySnapshotOutput) SetOperations(v []*Operation) *CopySnapshotOutput {
	s.Operations = v
	return s
}
607934
func (s *BlackoutSlate) SetState(v string) *BlackoutSlate {
	s.State = &v
	return s
}
227228
func (s *PutInstancePublicPortsOutput) SetOperation(v *Operation) *PutInstancePublicPortsOutput {
	s.Operation = v
	return s
}
1039325
func (s *SearchAvailablePhoneNumbersInput) SetState(v string) *SearchAvailablePhoneNumbersInput {
	s.State = &v
	return s
}