Create conditions for coupon rule in Magento 2

I’m trying to create conditions in the coupon rules, but when creating the conditions they are not aggregated correctly Im doing: $rule = $this->couponRule; $cond[‘conditions’][‘1’][‘type’]= ‘Magento\SalesRule\Model\Rule\Condition\Combine’; $cond[‘conditions’][‘1’][‘new_child’]= ”; $cond[‘conditions’][‘1’][‘aggregator’]= ‘all’; $cond[‘conditions’][‘1’][‘value’]= 1; $cond[‘conditions’][‘1–1’][‘type’]= ‘Magento\SalesRule\Model\Rule\Condition\Product\Found’; $cond[‘conditions’][‘1–1’][‘new_child’]= ”; $cond[‘conditions’][‘1–1’][‘value’]= 1; $cond[‘conditions’][‘1–1’][‘aggregator’]= ‘all’; $cond[‘conditions’][‘1–1–1’][‘type’]= ‘Magento\SalesRule\Model\Rule\Condition\Product’; $cond[‘conditions’][‘1–1–1’][‘attribute’]= ‘category_ids’; $cond[‘conditions’][‘1–1–1’][‘attribute_scope’]= ‘parent’; $cond[‘conditions’][‘1–1–1’][‘operator’]= ‘!{}’; $cond[‘conditions’][‘1–1–1’][‘value’]= 10; try { $rule->setName(‘Cupom Dinâmico’) ->setDescription(‘Criado…

Create conditions for coupon rule in Magento 2

I’m trying to create conditions in the coupon rules, but when creating the conditions they are not aggregated correctly Im doing: $rule = $this->couponRule; $cond[‘conditions’][‘1’][‘type’]= ‘Magento\SalesRule\Model\Rule\Condition\Combine’; $cond[‘conditions’][‘1’][‘new_child’]= ”; $cond[‘conditions’][‘1’][‘aggregator’]= ‘all’; $cond[‘conditions’][‘1’][‘value’]= 1; $cond[‘conditions’][‘1–1’][‘type’]= ‘Magento\SalesRule\Model\Rule\Condition\Product\Found’; $cond[‘conditions’][‘1–1’][‘new_child’]= ”; $cond[‘conditions’][‘1–1’][‘value’]= 1; $cond[‘conditions’][‘1–1’][‘aggregator’]= ‘all’; $cond[‘conditions’][‘1–1–1’][‘type’]= ‘Magento\SalesRule\Model\Rule\Condition\Product’; $cond[‘conditions’][‘1–1–1’][‘attribute’]= ‘category_ids’; $cond[‘conditions’][‘1–1–1’][‘attribute_scope’]= ‘parent’; $cond[‘conditions’][‘1–1–1’][‘operator’]= ‘!{}’; $cond[‘conditions’][‘1–1–1’][‘value’]= 10; try { $rule->setName(‘Cupom Dinâmico’) ->setDescription(‘Criado…