Builds the DN based off of the "name" attribute. The name attribute should be mapped to the "cn" attribute in
pretty much all cases except for creating an OU object. Then the "name" attribute should be mapped to "ou".

@param AddOperation $operation
554808
protected function setDnToUse(AddOperation $operation)
    {
        // If the DN was explicitly set, don't do anything.
        if ($operation->getDn()) {
            return;
        }
        if (!$this->schema) {
            throw new LogicException("You must explicitly set the DN or specify a schema type.");
        }
        $location = $operation->getLocation() ?: $this->schema->getDefaultContainer();
        if (empty($location)) {
            throw new LogicException('You must specify a container or OU to place this LDAP object in.');
        }
        // Handles a possible multi-valued RDN, where each RDN is pieced together with a '+'
        $rdn = implode('+', array_map(function($rdn) use ($operation) {
            return $rdn.'='.LdapUtilities::escapeValue($operation->getAttributes()[$rdn], null, LDAP_ESCAPE_DN);
        }, $this->getRdnFromAttributes(array_keys($operation->getAttributes()))));
        $operation->setDn($rdn.','.$this->resolveParameters(['container' => $location])['container']);
    }
296506
private void buildOperationTitle(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
        buildOperationTitle(markupDocBuilder, operation.getTitle(), operation.getId());
        if (operation.getTitle().equals(operation.getOperation().getSummary())) {
            markupDocBuilder.block(operation.getMethod() + " " + operation.getPath(), MarkupBlockStyle.LITERAL);
        }
    }
1264659
public static base_response add(nitro_service client, dnsaction resource) throws Exception {
		dnsaction addresource = new dnsaction();
		addresource.actionname = resource.actionname;
		addresource.actiontype = resource.actiontype;
		addresource.ipaddress = resource.ipaddress;
		addresource.ttl = resource.ttl;
		addresource.viewname = resource.viewname;
		addresource.preferredloclist = resource.preferredloclist;
		return addresource.add_resource(client);
	}
388035
public static ModelNode createOperation(final String operation) {
        final ModelNode op = new ModelNode();
        op.get(OP).set(operation);
        op.get(OP_ADDR).setEmptyList();
        return op;
    }
6492
protected function unicodePwdHack(AddOperation $operation)
    {
        if (!$this->isUnicodePwdHackNeeded()) {
            return;
        }
        $attributes = $operation->getAttributes();

        foreach ($attributes as $attribute => $value) {
            if (strtolower($attribute) !== 'unicodepwd') {
                continue;
            }
            $value = is_array($value) ? reset($value) : $value;
            $attributes[$attribute] = base64_encode($value);
        }

        $operation->setAttributes($attributes);
    }
515374
public void addActivationName(String name)
    {
        if (sealed) onSealedMutation();
        if (activationNames == null)
            activationNames = new HashSet<String>();
        activationNames.add(name);
    }
521566
function it_should_generate_add_and_remove_operations_on_a_modify_operation($connection, BatchModifyOperation $operation)
    {
        $sid = 'S-1-5-21-1004336348-1177238915-682003330-512';
        $sidHex = '\01\05\00\00\00\00\00\05\15\00\00\00\dc\f4\dc\3b\83\3d\2b\46\82\8b\a6\28\00\02\00\00';
        $guid = 'a1131cd3-902b-44c6-b49a-1f6a567cda25';
        $guidHex = '\d3\1c\13\a1\2b\90\c6\44\b4\9a\1f\6a\56\7c\da\25';
        $dn = 'cn=foo,dc=example,dc=local';
        $objectDn = 'CN=SomeGroup,OU=Employees,DC=example,DC=com';
        $ldapObject = new LdapObject(['dn' => $objectDn], 'group');

        $connection->execute(Argument::that(function($operation) {
            return $operation->getFilter() == '(&(&(objectClass=bar))(sAMAccountName=Foo))';
        }))->willReturn($this->entry);
        $connection->execute(Argument::that(function($operation) use ($guid, $guidHex) {
            return $operation->getFilter() == '(&(&(objectClass=bar))(|(objectGuid='.$guidHex.')(sAMAccountName='.$guid.')))';
        }))->willReturn($this->entryGuid);
        $connection->execute(Argument::that(function($operation) use ($sid, $sidHex) {
            return $operation->getFilter() == '(&(&(objectClass=bar))(|(objectSid='.$sidHex.')(sAMAccountName='.$sid.')))';
        }))->willReturn($this->entrySid);

        $this->setOperation($operation);
        $this->setOperationType(AttributeConverterInterface::TYPE_MODIFY);
        $this->setDn($dn);

        $nameDn = $this->entry[0]['distinguishedname'][0];
        $guidDn = $this->entryGuid[0]['distinguishedname'][0];
        $sidDn = $this->entrySid[0]['distinguishedname'][0];

        $batchAdd1 = new Batch(Batch::TYPE['ADD'], 'member', 'Foo');
        $batchAdd2 = new Batch(Batch::TYPE['REMOVE'], 'member', $sid);
        $batchRemove = new Batch(Batch::TYPE['ADD'], 'member', [$guid, $ldapObject]);

        // Expected actions for the add batch...
        $this->setBatch($batchAdd1);
        $operation->addPostOperation(Argument::that(function ($op) use ($batchAdd1, $nameDn, $dn) {
            $batches = [new Batch(Batch::TYPE['ADD'], 'member', [$dn])];

            return $op instanceof BatchModifyOperation
                && $op->getBatchCollection()->toArray() == $batches
                && $op->getBatchCollection()->getDn() == $nameDn;
        }))->shouldBeCalled();
        $this->toLdap(['Foo'])->shouldBeArray();

        // Expected actions for the remove batch...
        $this->setBatch($batchRemove);
        $operation->addPostOperation(Argument::that(function ($op) use ($batchRemove, $sidDn, $dn) {
            $batches = [new Batch($batchRemove->getModType(), 'member', [$dn])];

            return $op instanceof BatchModifyOperation
            && $op->getBatchCollection()->toArray() == $batches
            && $op->getBatchCollection()->getDn() == $sidDn;
        }))->shouldBeCalled();
        $this->toLdap([$sid])->shouldBeArray();

        // Expected actions for the multi-add batch...
        $this->setBatch($batchAdd2);
        foreach ([$guidDn, $objectDn] as $value) {
            $operation->addPostOperation(Argument::that(function ($op) use ($batchAdd2, $value, $dn) {
                $batches = [new Batch($batchAdd2->getModType(), 'member', [$dn])];

                return $op instanceof BatchModifyOperation
                    && $op->getBatchCollection()->toArray() == $batches
                    && $op->getBatchCollection()->getDn() == $value;
            }))->shouldBeCalled();
        }
        $this->toLdap([$guid, $ldapObject])->shouldBeArray();
    }
183284
public function create($operation)
    {
        if (!is_string($operation)) {
            throw new \LogicException("Provided manipulation name {$operation} is not a string!");
        }

        $operation = str_replace('-', ' ', $operation);
        $operation = strtolower($operation);
        $operation = ucwords($operation);
        $operation = str_replace(' ', '', $operation);

        $className = "Todstoychev\\Icr\\Manipulator\\" . $operation;

        if (!class_exists($className)) {
            throw new IcrRuntimeException("Operation {$operation} does not exists!");
        }

        return new $className($this->box, $this->point);
    }
937956
public function setOperator($operator)
    {
        if (!$operator) {
            $operator = '==';
        }

        if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
            throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
        }

        $this->operator = $operator;
    }
1350176
public function addOperation(OperationInterface $operation)
    {
        if (!$this->operations->contains($operation)) {
            $this->operations->add($operation);
        }

        return $this;
    }
903166
protected function sign($operation) {
	
		$params = array(
			'AWSAccessKeyId' => $this->accesskey,
			'Timestamp' => gmdate('Y-m-d\TH:i:s.000\Z'),
		);

		$sign_str = 'AmazonS3' . $operation . $params['Timestamp'];
		
		$params['Signature'] = base64_encode(hash_hmac('sha1', $sign_str, $this->secretkey, TRUE));
		
		return $params;
	}
583505
public function addOperation($counterId, Models\Operation $operation)
    {
        $resource = 'counter/' . $counterId . '/operations';
        $response = $this->sendPostRequest($resource, ["operation" => $operation->toArray()]);
        $operationResponse = new Models\AddOperationResponse($response);
        return $operationResponse->getOperation();
    }
854855
public function addOperation(\CampaignChain\CoreBundle\Entity\Operation $operations)
    {
        $this->operations[] = $operations;

        return $this;
    }
132686
public function applyOperations(string $dn, iterable $operations): void
    {
        $operationsMapped = [];
        foreach ($operations as $modification) {
            $operationsMapped[] = $modification->toArray();
        }

        if (!@ldap_modify_batch($this->getConnectionResource(), $dn, $operationsMapped)) {
            throw new UpdateOperationException(sprintf('Error executing UpdateOperation on "%s": "%s".', $dn, ldap_error($this->getConnectionResource())));
        }
    }
839859
protected function setLdapControls(LdapOperationInterface $operation)
    {
        foreach ($operation->getControls() as $control) {
            $this->connection->setControl($control);
        }
    }
1279782
private function findOperationAttribute(?array $operations, ?string $operationName, string $key, $defaultValue, bool $resourceFallback)
    {
        if (null !== $operationName && isset($operations[$operationName][$key])) {
            return $operations[$operationName][$key];
        }

        if ($resourceFallback && isset($this->attributes[$key])) {
            return $this->attributes[$key];
        }

        return $defaultValue;
    }
918321
public function addOperation($operation)
    {
        if (!in_array($operation, $this->operations, true)) {
            $this->operations[] = $operation;
        }
    }