public function all($priceRuleId, array $params = array())
    {
        $endpoint = '/admin/price_rules/'.$priceRuleId.'/discount_codes.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(DiscountCode::class, $response['discount_codes']);
    }
public function all($priceRuleId, array $params = array())
    {
        $endpoint = '/admin/price_rules/'.$priceRuleId.'/discount_codes.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(DiscountCode::class, $response['discount_codes']);
    }
public function all ( $ priceRuleId , array $ params = array ( ) ) { $ endpoint = '/admin/price_rules/' . $ priceRuleId . '/discount_codes.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createCollection ( DiscountCode :: class , $ response [ 'discount_codes' ] ) ; }
Receive a list of all discounts

@link   https://help.shopify.com/api/reference/discount#index
@param  integer $priceRuleId
@param  array $params
@return DiscountCode[]
Receive a list of all discounts